fix(sidebar): persist project and Space disclosure state - #411
Merged
Conversation
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
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.
💡 Change Scope
📝 What Does This PR Do?
Fixes #404.
Collapsed projects and Space groups previously expanded when the Sidebar remounted or the app restarted. Store these choices in the existing persisted settings and restore them using stable project IDs and workspace-scoped group IDs. Expanding a node removes its collapsed entry; older settings default to expanded.
🏗️ Large Change Spec (Required if "Large Change" is checked)
1. Context & Business Logic
Preserve explicit tree disclosure choices across remounts and cold restarts. Follow the stable-node-ID tree view state pattern used by VS Code Explorer. Project and Space preferences remain independent, so expanding a restored project preserves its collapsed Space groups.
2. State Ownership & Invariants
The existing settings/app-state persistence chain owns these preferences and writes them to SQLite. Sidebar reads and updates that owner. No new IPC channel or database schema is introduced.
workspaceId:groupId.truevalues survive normalization. Missing or malformed legacy values default to expanded.3. Verification Plan & Regression Layer
pnpm check: passed after correcting the new test fixture and DOM attribute assertions.OPENCOVE_REQUIRE_STAGED=1 pnpm pre-commitpassed: static checks, 809 related tests, 8 native recovery tests, and 323 Electron E2E passed / 79 skipped (23.1 minutes). The new two-cold-restart test also passed within this complete run. Platform skips are not claimed as verified.Target E2E command (run after a successful build):
✅ Delivery & Compliance Checklist
pnpm pre-commitis completely green.📸 Screenshots / Visual Evidence
The passing Electron test attaches
restored-project-and-space-disclosureafter the first cold restart. This is a persistence behavior change without layout changes; screenshots remain in Playwright artifacts and are not committed.