Add persistent collapsible sidebar rail - #33
Merged
Conversation
Signed-off-by: Zeid Diez <zeidalidiez@gmail.com>
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.
Summary
Root cause
The shell only defined one desktop sidebar width, while the hamburger control was wired exclusively to the mobile sheet. The mobile trigger's low-specificity display rule could also be overridden by shared icon-button styles, leaving an ambiguous menu control visible on desktop.
User impact
Desktop users can reclaim horizontal space without losing navigation access, reopen the full sidebar when needed, and keep their preferred state between sessions. Mobile behavior remains unchanged.
Validation
npm --workspace packages/ui run typechecknpm --workspace packages/ui run test— 151 tests passednpm run build:webGreptile Summary
This PR adds a persistent collapsible desktop sidebar rail. The main changes are:
gph.sidebar.statepreference that restores the user’s expanded or collapsed sidebar state after reloads.Confidence Score: 5/5
Safe to merge with minimal risk.
No accepted issues were found in the changed shell logic, CSS breakpoint behavior, persistence handling, or tests.
No files require special attention.
What T-Rex did
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant User participant AppShell participant LocalStorage as localStorage participant CSS as Shell CSS AppShell->>LocalStorage: read gph.sidebar.state on mount LocalStorage-->>AppShell: collapsed or default expanded AppShell->>CSS: set data-sidebar-state CSS-->>User: render 232px sidebar or 56px icon rail User->>AppShell: click desktop sidebar toggle AppShell->>LocalStorage: persist expanded/collapsed preference AppShell->>CSS: update data-sidebar-state CSS-->>User: update desktop sidebar width and labels%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant User participant AppShell participant LocalStorage as localStorage participant CSS as Shell CSS AppShell->>LocalStorage: read gph.sidebar.state on mount LocalStorage-->>AppShell: collapsed or default expanded AppShell->>CSS: set data-sidebar-state CSS-->>User: render 232px sidebar or 56px icon rail User->>AppShell: click desktop sidebar toggle AppShell->>LocalStorage: persist expanded/collapsed preference AppShell->>CSS: update data-sidebar-state CSS-->>User: update desktop sidebar width and labelsReviews (1): Last reviewed commit: "Add persistent collapsible sidebar rail" | Re-trigger Greptile