Skip to content

Shell: the sidebar is there the moment the page shows - #798

Merged
futurepaul merged 1 commit into
masterfrom
claude/sidebar-first-frame
Oct 31, 2026
Merged

futurepaul merged 1 commit into
masterfrom
claude/sidebar-first-frame

Conversation

@futurepaul

Copy link
Copy Markdown
Collaborator

Closes #797.

The race

#layout starts hidden until the person is signed in.

  1. layout.js's first write() measured a grid 0 px wide, found no room for the left pane, and hid the sidebar (display: none without left-open).
  2. When showLayout() revealed the grid, the ResizeObserver fitted it again, but through requestAnimationFrame, so a frame later.
  3. For that frame every page load showed without its sidebar.

deploying_start_ui read the sidebar's buttons right after it saw the notice change, and now and then landed in that frame:

Fix (cell/shell/layout.js, fitted() only)

A grid that measures nothing has no window to fit, so its sides stay as saved: the sidebar is shown with the page. Its first measure then fits the sides as before, so a window too narrow for both panes still hides the left one.

The check, made exact (crates/e2e/src/lanes/shell.rs)

A script installed before the shell runs (DEPLOY_SEEN) does three things:

  • a MutationObserver records what the page shows at the moment its notice first says Updating: the layout shown, the sidebar's Settings and Apps visible, and no release on the page. It reads before any frame is drawn, instead of looking a moment later;
  • it collects the console's lines;
  • it counts the page's asks of /api/identities/me.

The detail reports each part separately, which answers #797's "which half was false".

Proof (local cargo xtask e2e --only shell-ui)

cargo xtask check passes.

🤖 Generated with Claude Code

The layout starts hidden (`#layout` until the person is signed in), so
its first fit measured a grid 0 px wide, found no room, and hid the
sidebar. The ResizeObserver fitted it again once shown, a frame later,
through requestAnimationFrame: for that frame the page showed without
its sidebar. `deploying_start_ui` read the sidebar right after the
notice changed and sometimes met that frame (#797; CI runs 41154120681
and 41158183481).

`fitted()` now leaves the saved widths as they are while the grid
measures nothing: the sidebar is shown with the page, and the first
measure fits the sides as before.

The check reads what the page shows at the moment its notice first says
Updating, in the page (a MutationObserver installed before the shell
runs), not by a later look, and says which part was missing: without
this fix it fails every time (`first.chrome: false`), with it it passes.

Closes #797

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@alexlwn123 alexlwn123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass at f9d62de3969664e85edd4645a89175719398ec7c.

The zero-width guard fixes the hidden-grid startup race while preserving saved open/closed choices and the existing fit once the grid is measurable. The regression check captures the first Updating notice in a MutationObserver and reports layout, sidebar visibility, and release-text exposure separately. I traced the startup, resize, narrow-screen, and retry paths and found no blocking regression. The implementation is appropriately small and uses the existing layout and browser-test helpers.

Validation: git diff HEAD^ HEAD --check passed. CI check and all four e2e shards are still pending; I did not run the suites locally. The referenced external engineering-style document was unavailable at its configured path.

@futurepaul
futurepaul added this pull request to the merge queue Oct 31, 2026
Merged via the queue into master with commit 8e4adf9 Oct 31, 2026
13 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.

e2e flake: shell-ui's deploying start once saw the sidebar's chrome missing (chrome: false)

2 participants