Commit 9e9dc54
authored
fix(emcn): stop the tab strip scrolling vertically by a pixel (#6113)
* fix(emcn): stop the tab strip scrolling vertically by a pixel
The active tab extends one pixel past the strip so it covers the bottom border and
reads as joined to the panel below. That pixel came from `-mb-px` on the tab itself,
which meant it overflowed the row containing it — and that row is a scroll container,
because `overflow-x: auto` computes a visible `overflow-y` to `auto` as well. The strip
was therefore scrollable on the y axis by exactly one pixel, which is enough for a
trackpad to nudge the tabs out of view.
Moving the overlap onto the row keeps the tabs flush inside it, so the scroll container
has nothing to scroll, while the row itself still hangs the pixel over the border. The
strip is unchanged visually.
Measured in a real renderer with the component's own classes: the row was scrollHeight
30 against clientHeight 29, and is now 30 against 30. A first attempt to reproduce it
with hand-written inline styles showed no overflow at all — the real class output was
needed to see it.
Shared by the browser and terminal panels, so both stop scrolling.
* test(emcn): pin the invariant, not the class placement
Review pointed out the guard read source strings rather than rendered geometry, so it
could pass while the overflow returned. Correct, and worth being precise about the
compromise: this package's vitest runs in `node` with no browser mode, and the repo's
only Playwright harness drives Electron against static HTML fixtures, so nothing here can
lay out a React tree against the compiled CSS. Adding that capability is real
infrastructure, not a line in this fix.
What the guard can do is pin the invariant instead of two particular class strings: no
negative bottom margin anywhere inside the scrolling row. That now catches the regression
wherever a descendant reintroduces it, rather than only on the tab button it came from —
verified against both shapes. The rendered behaviour stays measured rather than asserted,
and the numbers are recorded next to the guard.1 parent 7293b67 commit 9e9dc54
2 files changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
320 | 328 | | |
321 | | - | |
| 329 | + | |
322 | 330 | | |
323 | 331 | | |
324 | 332 | | |
| |||
0 commit comments