Skip to content

fix(web): keep a scrolled tab strip where it was put when a tab resizes - #754

Merged
PastaPastaPasta merged 4 commits into
masterfrom
fix/tab-strip-holds-scroll
Nov 26, 2026
Merged

PastaPastaPasta merged 4 commits into
masterfrom
fix/tab-strip-holds-scroll

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Problem

Master's Web e2e has been red since #747 (run 45653175751, mobile.spec.ts:138 "iPhone SE: every repo tab is reachable…", tab Code on screen). It isn't a layout break from #746/#747: both passed on their own, and the iPhone SE header and tabs render correctly. It's a race in TabStrip:

  1. The strip re-places itself on the active tab at every tab resize (a count that loads late) until a pointerdown/wheel/keydown touches it. A scroll from scrollIntoView (Playwright, a screen reader moving focus, the browser revealing a focused tab) isn't one of those, so a late Platform read snaps it back. In the failing trace a getIdentity reply landed 15 ms after Playwright scrolled Code into view.
  2. Even after a real swipe, a resize snapped the strip back whenever the active tab was out of view, and after scrolling away from it, it always is. A phone user who swipes to Code while counts are still loading gets thrown back to Releases.
  3. Found in review (also on master): a tab that appears after mount (Boards before Releases, Settings/Members) resizes nothing the ResizeObserver watches, so an untouched strip can leave the active tab cut off.

Reproduced on live testnet at 375 px (build 59df356): scroll Code into view, widen a tab, and the strip jumps to scrollLeft 213, with Code at x = −197.

Fix

  • Any scroll the strip didn't make itself (scrollLeft differs from where it last put it) counts as the user's.
  • After that, a resize moves the strip only if it pushed a shown active tab out of view.
  • A MutationObserver observes tabs added later and re-places the strip.
  • The e2e pins each case: a tab before the active one widens; a tab appears before it; a scrolled-to Code stays on screen when it widens.

Evidence (boat sandbox, testnet build, --project mobile)

  • Master build: the new check fails 2/2 (Code stays on screen after a tab resizes).
  • This branch: the strip test passes 3/3 (--repeat-each 3). tsc, eslint and tab-strip.test.ts (13) pass.
  • The rest of mobile.spec.ts has 21 failures, all at expectLanded with Verification failed: Platform's answer did not match its proof or That read did not land. That's testnet's protocol 15 upgrade against our v5.0.0-rc.8 SDK, which hits master equally. None are layout or size failures.
  • Independent review: two passes, both approved with suggestions; the suggestions are applied.

Compat / data loss

Client-side scroll behaviour only. No storage, no Platform writes, no URL or data format change. Nothing can lose data.

🤖 Generated with Claude Code

The repo tab strip re-placed itself on every tab resize (a count that
loads late) unless a pointer, wheel or key gesture had touched it, and
even after one it snapped back whenever the active tab was out of view,
which is always the case after scrolling away from it. A tab scrolled
into view by a screen reader or the browser, or swiped to while counts
were still loading, was thrown back to the active tab (master Web e2e,
mobile.spec.ts:138, "tab Code on screen").

Any scroll the strip did not make itself now counts as the user's, and
after it a resize moves the strip only if it pushed a shown active tab
out of view. The e2e pins the case: scroll Code into view, widen it,
Code stays on screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

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 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73cf0402-c17a-4097-9375-cd029d5eaa6c
Commits

Reviewing files that changed from the base of the PR and between 78cbc53 and af92906.

Files selected for processing: 2

  • forge-web/components/ui/tab-strip.tsx
  • forge-web/e2e/mobile.spec.ts

No actionable comments were generated in the recent review.

Walkthrough

TabStrip now tracks user scrolling and active-tab visibility. After user scrolling, it repositions the strip only when the active tab was visible and is pushed out of view. The mobile test checks that the Code tab stays within the screen after widening.

Changes: Tab Strip Visibility

Layer / File(s) Summary
Scroll tracking and resize validation
forge-web/components/ui/tab-strip.tsx, forge-web/e2e/mobile.spec.ts
TabStrip records its programmatically placed scroll position and active-tab visibility. A passive scroll listener updates this tracking and is removed during cleanup. The mobile test widens the Code tab and asserts that it remains within the screen after two animation frames.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 78cbc

This change stops the tab strip from snapping back to the active tab when a tab resizes. It affects only UI scroll behavior, with no data or storage changes. No material merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: TabStrip should keep its scroll position when a tab resizes, and the title follows the fix(web) convention. The changeset tracks user scrolling and moves the strip onl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is detailed and covers the problem, the fix, and the test evidence, but it does not follow the repository template. The template requires a "What and why" section, a "How it was tested…
Full details: Title check

Explanation

The title names the main change: TabStrip should keep its scroll position when a tab resizes, and the title follows the fix(web) convention. The changeset tracks user scrolling and moves the strip only when a shown active tab is pushed out of view, which matches the title's intent. The title is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description is detailed and covers the problem, the fix, and the test evidence, but it does not follow the repository template. The template requires a "What and why" section, a "How it was tested" section with the template checklist, and a "Screenshots" section for web changes. The author's sections (Problem, Fix, Evidence, Compat / data loss) do not match those headings. Most required information is present in substance. Two items are missing: the checklist items (make check-rust and make check-web, rule vectors, and docs/guides updates) are not addressed, and there is no screenshot or statement that screenshots are not applicable at 390 px in both themes. Because the core content is present, the check passes with a note on the gaps.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 68a3cfab-395d-4b51-a4b3-d71e688f2b11
Commits

Reviewing files that changed from the base of the PR and between cc5c7fa and 78cbc53.

Files selected for processing: 2

  • forge-web/components/ui/tab-strip.tsx
  • forge-web/e2e/mobile.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

PastaPastaPasta and others added 3 commits November 26, 2026 15:37
Boards (inserted before Releases) and Settings/Members (appended) arrive
once their reads resolve. The ResizeObserver only watched the tabs that
existed at mount and none of them resizes when a tab is inserted, so an
untouched strip left the active tab cut off. A MutationObserver now
observes added tabs and re-places the strip. The e2e pins both cases
for an untouched strip: a tab before the active one widens, and a tab
appears before it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit a8a8109 into master Nov 26, 2026
21 checks passed
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.

1 participant