Skip to content

Add support for persistent storage of panel layouts, sizes, and active tabs#4017

Merged
Keavon merged 6 commits intomasterfrom
persistent-panels
Apr 9, 2026
Merged

Add support for persistent storage of panel layouts, sizes, and active tabs#4017
Keavon merged 6 commits intomasterfrom
persistent-panels

Conversation

@Keavon
Copy link
Copy Markdown
Member

@Keavon Keavon commented Apr 8, 2026

Closes #195

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements workspace layout persistence, enabling the editor to save and restore panel arrangements and sizes across sessions. It adds new message types and handlers across the desktop backend, WASM wrapper, and frontend, including support for a "Reset Workspace" action and a "Focus Document" mode. Review feedback suggests ensuring the persistence directory is created before writing files, refactoring duplicate tree traversal logic into a helper method, and validating input lengths when updating panel group sizes to ensure consistency.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 16 files

Confidence score: 3/5

  • There is a concrete data-integrity risk in frontend/src/utility-functions/persistence.ts: converting BigInt to Number can silently lose precision and corrupt persisted workspace layout values when they exceed Number.MAX_SAFE_INTEGER.
  • I’m scoring this as moderate merge risk because the issue is user-impacting (corrupted persisted data) and has medium-high confidence, even though it appears localized to one persistence path.
  • Pay close attention to frontend/src/utility-functions/persistence.ts - ensure BigInt values are stored in a lossless format (for example, strings) before merging.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/utility-functions/persistence.ts">

<violation number="1" location="frontend/src/utility-functions/persistence.ts:179">
P2: Converting BigInt to Number here can silently lose precision for large IDs/sizes. That will corrupt workspace layout data when values exceed Number.MAX_SAFE_INTEGER. Preserve BigInt as a string (or another lossless representation) instead of Number().</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/src/workspace_layout.rs">

<violation number="1" location="desktop/src/workspace_layout.rs:13">
P2: Changing the persisted layout filename without a read fallback or migration drops previously saved workspace layouts for existing users.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/window/PanelSubdivision.svelte">

<violation number="1" location="frontend/src/components/window/PanelSubdivision.svelte:253">
P2: This `:has(.panel.document-panel)` selector is too broad in the recursive layout and will match ancestor subdivisions too. Limit it to direct containment so only the intended subdivision gets the hole-punch overlay.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@Keavon Keavon force-pushed the persistent-panels branch from 6cb2a6f to 2962fe7 Compare April 9, 2026 01:10
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 12 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="frontend/src/components/window/PanelSubdivision.svelte">

<violation number="1" location="frontend/src/components/window/PanelSubdivision.svelte:15">
P2: `subdivision` is now optional, but the pointer-up callback still uses `"Split" in subdivision` without a null check, which can throw at runtime if the prop changes during a drag.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@Keavon Keavon merged commit b100892 into master Apr 9, 2026
10 checks passed
@Keavon Keavon deleted the persistent-panels branch April 9, 2026 04:06
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.

Rearrange and dock tabs and panel groups in the editor workspace

1 participant