Skip to content

fix(nav-panel): add collapsible chevron indicator to workspace section header - #2135

Open
xielixing wants to merge 1 commit into
GCWing:mainfrom
xielixing:fix/issue-976-workspace-chevron
Open

fix(nav-panel): add collapsible chevron indicator to workspace section header#2135
xielixing wants to merge 1 commit into
GCWing:mainfrom
xielixing:fix/issue-976-workspace-chevron

Conversation

@xielixing

Copy link
Copy Markdown

Fix: Workspace section collapsed/expanded states look identical (#976)

Problem

The workspace section header in the NavPanel uses collapsible mode without onSceneOpen, so the ChevronRight indicator was never rendered. Users could collapse/expand the section but had no visual cue showing the current state — collapsed and expanded headers looked identical.

Additionally, when a user manually collapsed the workspace section and then added a new workspace, the section stayed collapsed, making the new workspace invisible until the user manually expanded it.

Root Cause

In SectionHeader.tsx, the chevron indicator was gated behind onSceneOpen ? (line 63), so collapsible-only sections (workspace, assistant sessions) never showed an indicator.

Changes

  1. SectionHeader.tsx — Render the chevron for both onSceneOpen and collapsible sections. Added --collapsed and --expanded CSS modifier classes that rotate the chevron based on isOpen state.

  2. NavPanel.scss — Added transform: rotate(0deg) for collapsed state and transform: rotate(90deg) for expanded state, with the existing transition: transform providing smooth animation.

  3. MainNav.tsx — Added a useEffect that auto-expands the workspace section when a new workspace is added (tracks normalWorkspacesList.length), so newly created workspaces are immediately visible even if the user had previously collapsed the section.

Validation

  • tsc --noEmit — no errors in changed files
  • vitest run NavPanelLayout.test.ts — 4/4 tests pass
  • Existing chevron hover behavior (translateX(1px) for scene-link sections) is preserved — the rotation classes only apply to collapsible sections without onSceneOpen

Fixes #976

…n header

SectionHeader now renders a ChevronRight icon that rotates based on
isOpen state for collapsible sections (not just scene-entry sections).
Collapsed state shows chevron pointing right; expanded shows rotated 90deg.

Also auto-expands workspace section when a new workspace is added,
so newly created workspaces are immediately visible even if the user
had previously collapsed the section.

Fixes GCWing#976
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.

[Feature]: 工作区目录显示问题

1 participant