Skip to content

fix(tabs): scroll an overflowing tab strip sideways with a vertical mouse wheel - #2095

Merged
devswha merged 1 commit into
mainfrom
fix/tabstrip-wheel
Oct 28, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/tabstrip-wheel

Conversation

@devswha

@devswha devswha commented Oct 27, 2026

Copy link
Copy Markdown
Owner

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.

  • TabStrip adds a native non-passive wheel listener to the strip, because React's onWheel is 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), or end coming or going when a split opens or closes.
  • This is the final wheel-only form of the closed fix(tabs): scroll an overflowing tab strip with a vertical wheel #1516 (c099bf1), as the maintainer asked on the issue, ported to current main (loneTabHidden, the ovis:* 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.md's tab strip section notes the behavior, and a changelog fragment is included.

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

  • New scripts/tab-overflow-regression.ts, wired into ui-contexts-checks.ts. It uses the isolated test herdr session with 20 tabs at 1024 px, port: 0 and a mkdtemp state dir.
    • Before the fix it fails: solo strip: a vertical wheel over the overflowing strip left it unscrolled.
    • After the fix it passes: wheeling down scrolls the strip and brings the last tab fully into view before the +, 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.
    • The test has no fixed sleeps: every wait is on a DOM condition with a timeout.
  • bun run check fast: green (workflow syntax, generated types and themes, typecheck, build, unit tests: 7719 pass, 0 fail).
  • Reviews:
    • omo-native-code-reviewer: APPROVE, LOW findings only. Two were taken: the line height is now computed only for line-mode wheels, and the design reference names Zed.
    • Codex (gpt-6.1-sol, xhigh): no HIGH or MEDIUM findings. Its one LOW finding was taken: before closing the split, the test now waits for the split half's own strip.

…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
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4d5edf3 and 1cc1a64.

Files selected for processing: 5
  • DESIGN.md
  • changelog.d/tab-strip-wheel-scroll.md
  • scripts/tab-overflow-regression.ts
  • scripts/ui-contexts-checks.ts
  • src/components/TabStrip.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

Integration tests failed in server/gjc.contract.test.ts ("binds the visible neighboring answer to the exact native process record without invoking the SDK", ConversationUnavailable: no_session_path). This PR changes only the tab strip and a browser script; the same file passes 10/10 on this branch locally, and gjc.contract is on the known-flake list. Rerunning the failed job once.

@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

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.

@devswha
devswha merged commit 0d43960 into main Oct 28, 2026
18 of 20 checks passed
@devswha
devswha deleted the fix/tabstrip-wheel branch October 28, 2026 00:18
devswha added a commit that referenced this pull request Oct 28, 2026
, #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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabs past the end of a full tab strip cannot be reached with a mouse

1 participant