Commit a360ed7
authored
The 30ms async timer debounce had race conditions between ArrowDebounceTimeout
and event batch processing, causing scroll/history misfires. The tail-window
rendering model drifted during output because window_size depended on
scroll_offset, creating a feedback loop.
Changes:
- Delete scroll_debounce.rs (197 lines) and all timer machinery
- Batch detection in tui_loop: ≥2 arrows in one batch = mouse wheel → scroll;
1 arrow = keyboard → history. No timers, no races.
- ContentScroll struct encapsulates offset + prev_total + LineCache with
reset()/to_bottom()/scroll_up()/scroll_down() methods
- Absolute position indexing via slice() replaces tail() feedback loop;
offset auto-compensated on content growth while pinned
- E2E regression tests for both bugs + unit tests for compensation logic
1 parent 8b5eab1 commit a360ed7
21 files changed
Lines changed: 657 additions & 548 deletions
File tree
- crates/loopal-tui
- src
- app
- input
- views/progress
- tests
- suite
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | | - | |
54 | | - | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
| |||
63 | 59 | | |
64 | 60 | | |
65 | 61 | | |
66 | | - | |
67 | | - | |
| 62 | + | |
| 63 | + | |
68 | 64 | | |
69 | 65 | | |
70 | 66 | | |
| |||
82 | 78 | | |
83 | 79 | | |
84 | 80 | | |
85 | | - | |
86 | 81 | | |
87 | 82 | | |
88 | 83 | | |
| |||
97 | 92 | | |
98 | 93 | | |
99 | 94 | | |
100 | | - | |
101 | 95 | | |
102 | 96 | | |
103 | 97 | | |
104 | 98 | | |
105 | | - | |
| 99 | + | |
106 | 100 | | |
107 | 101 | | |
108 | 102 | | |
| |||
123 | 117 | | |
124 | 118 | | |
125 | 119 | | |
126 | | - | |
| 120 | + | |
127 | 121 | | |
128 | 122 | | |
129 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | 67 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | | - | |
34 | 30 | | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | 34 | | |
39 | | - | |
40 | 35 | | |
41 | 36 | | |
42 | 37 | | |
| |||
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 43 | | |
57 | 44 | | |
58 | 45 | | |
| |||
123 | 110 | | |
124 | 111 | | |
125 | 112 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 113 | + | |
132 | 114 | | |
133 | 115 | | |
134 | 116 | | |
| |||
138 | 120 | | |
139 | 121 | | |
140 | 122 | | |
141 | | - | |
| 123 | + | |
142 | 124 | | |
143 | 125 | | |
144 | 126 | | |
| |||
177 | 159 | | |
178 | 160 | | |
179 | 161 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 162 | + | |
| 163 | + | |
184 | 164 | | |
185 | 165 | | |
186 | 166 | | |
187 | | - | |
| 167 | + | |
188 | 168 | | |
189 | 169 | | |
190 | 170 | | |
191 | | - | |
| 171 | + | |
192 | 172 | | |
193 | 173 | | |
194 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
| |||
This file was deleted.
0 commit comments