Skip to content

[Fix] Keep the Content panel folder selection when switching bottom dock tabs - #90

Open
miogds wants to merge 1 commit into
untoldengine:developfrom
miolabs:fix/content-panel-keeps-selection
Open

[Fix] Keep the Content panel folder selection when switching bottom dock tabs#90
miogds wants to merge 1 commit into
untoldengine:developfrom
miolabs:fix/content-panel-keeps-selection

Conversation

@miogds

@miogds miogds commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • Switching the bottom dock from Content to Console (or any other tab) and back reset the Content browser to the default Models folder, losing the selected category/folder, the open subfolder, expanded tree nodes and the highlighted asset.
  • Cause: the dock only builds the active tab's view, so AssetBrowserView was recreated on every switch and its @State started over.
  • Fix: move that navigation state into a new AssetBrowserNavigationState observable object, owned by EditorView as a @StateObject and passed into the browser. The browser reads and writes it through private computed properties, so the rest of the browser code is unchanged.

Test plan

  • swift build
  • swift test --filter AssetBrowserViewTests (27 tests pass, including two new ones covering the default state and a rebuilt browser restoring the shared navigation)
  • Manual: select a non-default folder in Content, switch to Console, switch back; the same folder, subfolder and expanded nodes are still shown

🤖 Generated with Claude Code

…ock tabs

The bottom dock builds only the active tab's view, so leaving the Content
(asset) browser for Console and coming back recreated AssetBrowserView and
reset its @State to the default Models category.

Move the browser's navigation state (selected category/folder, open subfolder
trail, expanded nodes, highlighted asset) into AssetBrowserNavigationState,
owned by EditorView as a @StateObject and passed into the browser, so the
same place is restored when the tab is shown again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant