Repository navigation
fix(web): span the viewing-as banner full width outside the app shell - #1298
Conversation
The impersonation banner renders above every route, but its left margin came from a sidebar offset that resolved to 260px on any desktop viewport, whether or not Layout and its sidebar were mounted. On the profile picker, login, and player routes the banner reserved room for a sidebar that was not there, leaving a blank strip on the left. Gate the desktop offset values on html[data-app-shell], which Layout sets for exactly the sidebar's lifetime, so off-shell routes keep the 0px default. Add a CSS contract test that fails on the ungated rule. Closes #1290 Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Warning Review limit reachedNext included review available in 10 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc49b46b12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Gating the sidebar offset on data-app-shell also zeroed it inside the admin area, which has its own fixed 240px sidebar outside Layout. The audiobook MiniBar stays mounted across admin navigation and sets its left edge from that variable, so it would have started at 0px under the admin navigation. AdminLayout now publishes data-admin-shell for its lifetime and app.css resolves the offset to 240px while it is present. The CSS contract test requires every non-zero offset to hang off one of the two shell attributes, and AdminLayout.test covers the attribute's lifetime. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Problem
Related issue: #1290
While an admin views the app as another user, the "Viewing as" banner on the profile picker starts 260px from the left edge, leaving a blank strip where no sidebar exists. The banner renders above every route, but its left margin came from
--app-sidebar-offset, which resolved to 260px on any viewport at or above 1024px whether or notLayoutand its sidebar were mounted. The profile picker, login, and player routes live outsideLayout, so they reserved room for a sidebar that was not there.Approach
Gate the desktop offset values in
web/src/app.csson a shell attribute.Layoutalready setsdata-app-shellfor exactly as long as its sidebar exists, so routes outside the shell keep the 0px default and routes inside it keep the 260px and 64px values they had.The admin area is a second shell:
AdminLayoutsits outsideLayoutand draws its own fixed 240px sidebar, and the audiobook mini bar reads the same variable and stays mounted across admin navigation.AdminLayoutnow publishesdata-admin-shellfor its lifetime and the CSS resolves the offset to 240px while it is present. Codex review caught this after the first commit.The alternative was to make the banner and mini bar route-aware themselves, but that would duplicate knowledge the two layouts already publish. A CSS contract test in
sidebarCollapseCss.test.tsrequires every non-zero offset to hang off one of the two shell attributes and fails on the original ungated rule.AdminLayout.test.tsxcovers the new attribute's lifetime.Validation
/adminresolves the variable to 240px with the admin sidebar's right edge at 240px; returning to/profilesdrops it to 0px.sidebarCollapseCss.test.ts,navigationTransitionCss.test.ts,Layout.test.tsx, andAdminLayout.test.tsxpass. The contract test fails against the previous CSS.pnpm run lint,pnpm run format:check, andpnpm run buildpass.make test-webpassed twice in full on the first commit; a first run had one failure inAdminRequests.v2.test.tsxthat did not reproduce and is unrelated to these files.Risks
None identified. The change is web-only chrome. No Apple, Android, or jellycompat follow-up is needed.
Checklist
AI Disclosure
🤖 Generated with Claude Code