Skip to content

Fix #711: Retain sidebar panel state when switching tabs - #2189

Open
Borisserz wants to merge 1 commit into
CodeEditApp:mainfrom
Borisserz:fix/711-sidebar-panel-state
Open

Fix #711: Retain sidebar panel state when switching tabs#2189
Borisserz wants to merge 1 commit into
CodeEditApp:mainfrom
Borisserz:fix/711-sidebar-panel-state

Conversation

@Borisserz

Copy link
Copy Markdown

Description

Fixes navigator/inspector sidebar panels resetting expand and scroll state when switching between sidebar tabs.

WorkspacePanelView previously swapped content with if let selection = selectedTab { selection }, which destroyed and recreated AppKit outline views. It now keeps every tab panel mounted in a ZStack and toggles visibility with opacity / hit-testing, so NSOutlineView state survives.

Applies to both the left navigator and right inspector (they share WorkspacePanelView).

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Please verify locally (UI): expand folders in Project Navigator β†’ switch to Search β†’ switch back β†’ expansion/scroll retained.

Test plan

  • WorkspacePanelRetentionTests (all tab bodies stay mounted after selection change)
  • SidebarPanelRetentionUITests (expansion survives Project ↔ Search)
  • SwiftLint --strict on touched files (0 violations)
  • Manual: same flow in Inspector tabs
  • CI SwiftLint + tests green

Made with Cursor

Keep all WorkspacePanelView tab panels mounted and toggle visibility with opacity so navigator and inspector outline expand/scroll state survives switching tabs.
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.

🐞 Sidebar tab panel state is not retained when returning to it from another tab

1 participant