# Bug Fix Specification: Resolving Critical Row Desynchronization This document analyzes the root cause and provides a permanent structural solution to eliminate the vertical row desynchronization and internal horizontal scrolling artifacts occurring between the left Track Control Panel (TCP) and the right waveform lanes, based on the real-world visual analysis --- ## 1. Visual Symptom Analysis The layout engine is suffering from two critical alignment failures indicated by the red arrows: ```text [ LEFT COLUMN - TCP PANEL ] [ RIGHT COLUMN - TIMELINE GRID ] ┌──────────────────────────────┐ ┌──────────────────────────────────────────────┐ │ ... Track 05, 06 (Aligned) │ ══════════ │ Waveform 05, 06 (Aligned) │ ├──────────────────────────────┤ ├──────────────────────────────────────────────┤ │ 07 Track 3 (Channel Header) │ [MISALIGNED]│ [EMPTY BLACK DEAD SPACE] (Lower red arrow) │ │ [Junk horizontal scrollbar] │ ◄────────── │ ◄── Caused by Waveform 07 dropping height to 0│ │ (Upper red arrow) │ ├──────────────────────────────────────────────┤ ├──────────────────────────────┤ │ Waveform 07 (Pushed down to Track 08's row) │ │ 08 Track 3 │ ══════════ │ ... │ └──────────────────────────────┘ └──────────────────────────────────────────────┘ ``` ### 1.1. Defect Index 1: Spurious Internal Horizontal Scrollbar (Upper Red Arrow) * **Symptom:** A small gray horizontal scrollbar emerges directly beneath Track 07 within the left TCP column. * **Root Cause:** The container wrapper for the left TCP column enforces a rigid bounding layout (`fixed width` or missing an explicit `overflow-x: hidden` safety attribute). When inner structural components (such as long text labels, Mute/Solo clusters, or upload file actions) expand horizontally, the browser generates a local scrollbar. This automatically inflates the effective physical height of the left Track 07 by roughly $12\text{ px} \rightarrow 16\text{ px}$. ### 1.2. Defect Index 2: Vertical Row Desynchronization & Dead Black Space (Lower Red Arrow) * **Symptom:** On the right column (Timeline), a massive horizontal empty black gap disrupts the grid layout where Waveform 07 ought to sit. Consequently, all matching waveforms for Track 07 and Track 08 are offset downward, falling entirely out of phase with their corresponding control headers on the left. * **Root Cause:** The system evaluates the target height ($H$) of the left TCP container independently from the right Waveform Lane. When the left Track 07 column expands due to the rendering of the junk scrollbar, the right canvas lane does not dynamically adapt. This triggers a cumulative pixel error along the vertical axis ($Y$), producing progressive, severe desynchronization downstream (the lower the tracks sit, the worse the alignment drifts). --- ## 2. Structural Correction Blueprint To prevent this layout defect from recurring—especially when porting the interface to desktop Python using PyQt/PySide—the system must completely decouple from independent height calculations and embrace a **Unified Row Layout** model. ### 2.1. Standardized HTML / Tailwind CSS Architecture Blueprint Instead of splitting the page tree layout into two isolated columns (`Col1: [TCP1, TCP2, TCP3]` and `Col2: [Wave1, Wave2, Wave3]`), the application must encapsulate each matching TCP and Waveform pair within a shared, unified row wrapper: ```html