| 1 | // Message Navigation Component |
| 2 | import { renderMathContent } from '../services/mathRendering.js'; |
| 3 | |
| 4 | export default class MessageNavigation { |
| 5 | constructor(app) { |
| 6 | this.app = app; |
| 7 | this.currentMessageIndex = 0; |
| 8 | this.messages = []; |
| 9 | this.container = null; |
| 10 | this.isVisible = false; |
| 11 | this.hideTimeout = null; |
| 12 | this.isNavigating = false; // Flag to prevent scroll handler from overriding click navigation |
| 13 | this.clickedIndex = null; // Tracks user-clicked bar, null = use viewport-based detection |
| 14 | this.awaitingScrollEnd = false; // True while waiting for programmatic scroll to finish |
| 15 | this.scrollEndTimer = null; |
| 16 | this.scrollFrame = null; |
| 17 | |
| 18 | this.init(); |
| 19 | } |