fix: sidebar styling#21
Conversation
Greptile SummaryThis PR makes minor sidebar polish fixes: it widens icon-label gaps from
Confidence Score: 3/5The transition:persist change is safe for scroll preservation but introduces a navigation regression where collapsed sidebar sections won't auto-expand when linking into them. The transition:persist addition preserves sidebar DOM across page transitions, a good UX improvement for scroll position. However, NestedCategory relies on useState(selfActive || childActive) — an initialiser that only fires on first mount — so any collapsed category won't auto-expand during subsequent in-app navigation, leaving users without a visible active section cue. src/layouts/DocsLayout.astro deserves a second look because the transition:persist interaction with React state initialisation in sidebar-tree-view.tsx is the core risk here. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User navigates to new page\nAstro View Transition] --> B{transition:persist\non Sidebar?}
B -- Before PR\nNo --> C[Sidebar unmounts & remounts]
C --> D[NestedCategory useState\ninitialised from selfActive\n OR childActive]
D --> E[Correct category auto-expands]
B -- After PR\nYes --> F[Sidebar DOM persisted]
F --> G[currentPath prop updates\nactive highlight refreshes]
G --> H{Was target category\nalready expanded?}
H -- Yes --> I[Correct category visible]
H -- No --> J[expanded state unchanged\nCategory stays collapsed]
Reviews (1): Last reviewed commit: "fix: sidebar styling" | Re-trigger Greptile |
* fix: sidebar styling * revert
Minor styling fixes for sidebar.