fix: sidebar footer items stay as text when the sidebar is collapsed#550
Open
IliaAvdeev wants to merge 1 commit into
Open
fix: sidebar footer items stay as text when the sidebar is collapsed#550IliaAvdeev wants to merge 1 commit into
IliaAvdeev wants to merge 1 commit into
Conversation
1aa4f9c to
b0b79b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When auth is enabled and the sidebar is collapsed, the footer items (Admin and
Sign out) keep rendering as full-width text inside the narrow 60px rail instead
of shrinking to icons like the rest of the nav.
AdminLinkandLogoutButtonalready have an icon-only mode behind acollapsedprop, butSidebarShellrendersfooterSlotas a static node andnever passes the collapsed state down, so the prop stays
falsein both theexpanded and collapsed layouts.
This changes
footerSlotto also accept a render function that receives thecurrent
collapsedstate, and updates both sidebars to forward it:Plain nodes are still accepted, so nothing else needs to change.
Before / After (collapsed sidebar)
Reproducing
The footer items only render when auth is enabled, so reproduce with auth on
(e.g.
npm run devwith auth configured), then collapse the sidebar — Admin andSign out overflow the rail as text.
In the Docker image you also need #549 for the footer to show up at all
(
NEXT_PUBLIC_AUTH_ENABLEDwas being constant-folded tofalse), but the twochanges are independent — this one is purely the collapsed-rendering fix.
Notes:
pre-commit run --all-files; my changes pass. The only failures arepre-existing on
devand unrelated to this change (a duplicate key inweb/locales/{en,zh}/app.json, and Unix-onlyosattributes inruntime/launcher.pyflagged by mypy on Windows).render test if you'd prefer.
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstests...Checklist
pre-commit run --all-filesand fixed any issues.