Repository navigation
fix(tabs): scroll an overflowing tab strip sideways with a vertical mouse wheel - #2095
Conversation
…ouse wheel A vertical-only mouse could not reach tabs past the strip's edge: the strip scrolls only sideways and its scrollbar is hidden. A vertical wheel over a strip whose tabs do not fit now moves it sideways, by the wheel's own unit; a sideways wheel, a pinch and a strip that fits stay the browser's. Port of #1516's wheel-only form. Fixes #1515
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Integration tests failed in |
|
Merging 1cc1a64: omo-native-code-reviewer and Codex both pass this head, and the required checks are green. CodeRabbit's review limit was reached, so it did not review this PR. The non-blocking findings (a diagonal trackpad case and LOW notes) go to a follow-up issue. |
, #2172, #2103) (#2240) Fixes three follow-ups from the merge pass's reviews (bundle 5 of the follow-up sweep). ### #2111: a folded block reopens when it merges with hidden reasoning With Show thinking off, a run of hidden reasoning alone draws no block, but it still took a name and left it in the row's memory. When it merged with a folded block (words before the tools became commentary), or split from one again, the folded block lost its name and fold and opened again, also after a remount. A run that draws no block now neither keeps a name (`runNames`'s new `drawn` predicate) nor leaves one (`Turn`). ### #2172: an unconfirmed message is lost on reload with a bridge that names no herdr A PC whose snapshot has no `herdr_lifetime` keeps pane state only in page memory (`lib/paneLifetime.ts`). The "Not confirmed" row `keepUnconfirmed` adds there was lost on reload, while the composer was already empty. When the PC's pane state is not stored, the text now also goes to Recover unsent text (kind `pending`). That record is untargeted: it is offered for a pane the user picks and never restored under the pane id, which a later herdr may reuse. Each row gets its own record (`PaneLifetimes.keep(..., own)`), so discarding the row (`removeCopy`) removes only that row's copy, never another tab's or an older one with the same words. Once storage takes the row on the same herdr (`forget`), the copy goes too, so a reload offers the text once. ### #2103: a diagonal trackpad swipe moves the tab strip the wrong way The strip cancelled a vertical-dominant wheel event even when it had sideways motion, and moved by `deltaY` alone (at `scrollLeft=400`, `deltaX=-20, deltaY=40` went to 440). Any event with `deltaX` is now the browser's, as the issue suggested. Design reference: unchanged from #2095, which follows Zed's tab bar and VS Code's editor tabs in turning a vertical mouse wheel into sideways scroll. A trackpad gesture with any sideways motion now gets the browser's own native scrolling instead. The regression script's last bare `waitForFunction` also gets an explicit timeout. ### Tests (each fails before its fix) - `src/components/ChatTurn.test.ts` (#2111): with showThinking=false, fold `[thinking, text, tool]`, merge (the text becomes commentary), split (the text becomes the answer); the block stays `aria-expanded=false` after each draw and remount. On main it fails at the merge. - `src/lib/paneLifetime.test.ts` (#2172): a reload on the same storage keeps the text in recovery and not in the pane's rows; discarding the row removes only its own copy (also across two tabs, and beside an older record with the same text); the copy goes once storage takes the row on the same herdr; a stored PC gets no copy. Without the fix, 2 (then 3) of these failed. - `scripts/tab-overflow-regression.ts` (#2103): diagonals `deltaX=±20, deltaY=40` are not cancelled. On main: `AssertionError: a diagonal trackpad swipe (deltaX 20) is the browser's`; after the fix the whole script passes against the test herdr. ### Reviews - omo-native-code-reviewer: APPROVE, LOW findings only. L1 (a duplicate recovery copy once storage took the row on the same herdr) is fixed with a test; the comment it flagged is reworded. - Codex Sol 6.1 (fast, xhigh): round 1 found two MEDIUMs, both fixed with tests: a shared, deduplicated recovery record could be deleted from another tab, and hidden reasoning could still take the name on a split. Round 2: APPROVE, no findings. - CodeRabbit: two findings, both fixed with tests that fail before. A run of hidden reasoning now keeps a dormant name, so a folded block whose words became the answer stays folded when a tool joins. That was a regression of this PR; main kept the fold. A row that storage refused on a stored PC also goes to recovery. The merge pass's review of 4e8b206 found a HIGH: once a later write saved a refused row, its recovery copy stayed, so a reload offered the text twice and discarding the row left it in recovery. Fixed in the last commit: a successful write on a stored PC drops the recovery copies of the rows it saved. The regression test refuses a write, resumes writes, reloads and discards one row. Delta re-review: omo APPROVE. Its MEDIUM test gap is fixed: the test now redraws the hidden run, so it fails when a hidden run does not take its dormant name back (checked against that change). Codex round 3: APPROVE, with one LOW listed below. Known LOW notes, not fixed here and not filed as issues (follow-up bar: only reproduced user-visible MEDIUMs get an issue): - Every message sent to a PC whose bridge cannot confirm messages now also leaves a recovery record, with no expiry; the issue's suggested "Discard all" would help. - A thinking-only block that took another block's name, after Show thinking is turned off and on, comes back with a fresh name and loses its fold. - Recover unsent text labels these records with the dialog's existing "pending" kind ("Held message", described as not sent). An unconfirmed send may already have reached the pane, so the dialog doesn't say that this message's delivery is uncertain. - A mouse that reports small sideways jitter with its vertical wheel no longer scrolls the strip sideways. - From the issues, untouched here: the wheel listener's rebinding, the Firefox line-mode comment, a wheel at the strip's end still cancelled, and old toggle entries never pruned. `bun run check fast` passes locally. Closes #2111 Closes #2172 Closes #2103
Change
Fixes #1515. Thanks to @adnankassem for the report.
Problem. When a workspace has more tabs than the strip can show, the tabs past its edge cannot be reached with a mouse that has only a vertical wheel. The strip scrolls only sideways, its scrollbar is hidden, and a vertical wheel over it did nothing.
Behavior after this PR. A vertical mouse wheel over a strip whose tabs do not fit now scrolls the strip sideways, as far as the last tab. The wheel's own unit is respected: pixels, lines (Firefox's mouse wheel) or pages. The browser keeps everything else: a sideways wheel or trackpad swipe, a pinch (ctrl+wheel) and a strip whose tabs fit are not touched, so most workspaces see no change.
TabStripadds a native non-passivewheellistener to the strip, because React'sonWheelis passive and cannot cancel the page's own handling. The listener is attached again when the strip is drawn as a new node: shown or hidden, the lone-tab hiding on a cramped phone (loneTabHidden), orendcoming or going when a split opens or closes.loneTabHidden, theovis:*storage keys). It does not include fix(tabs): scroll an overflowing tab strip with a vertical wheel #1516's earlier chevron tab list, which is held as a feature.Design reference: Zed's tab bar and VS Code's editor tabs both scroll sideways with a vertical wheel when their tabs overflow. This follows them. The Codex and Claude apps have no overflowing tab row to compare against.
Validation
scripts/tab-overflow-regression.ts, wired intoui-contexts-checks.ts. It uses the isolated test herdr session with 20 tabs at 1024 px,port: 0and amkdtempstate dir.solo strip: a vertical wheel over the overflowing strip left it unscrolled.+, and wheeling up scrolls it back. Line and page units move the strip too. A sideways wheel, a pinch and a strip whose tabs fit are not cancelled. All of this still holds after a split that was restored beside the strip is closed, which draws the strip as a new node.bun run check fast: green (workflow syntax, generated types and themes, typecheck, build, unit tests: 7719 pass, 0 fail).