Skip to content

feat: v2 - ensure window order while seeding default layout#2198

Open
maxy-shpfy wants to merge 1 commit into05-03-feat_v2_-_add_runs_and_submissions_windowfrom
05-03-feat_v2_-_ensure_window_order_while_seeding_default_layout
Open

feat: v2 - ensure window order while seeding default layout#2198
maxy-shpfy wants to merge 1 commit into05-03-feat_v2_-_add_runs_and_submissions_windowfrom
05-03-feat_v2_-_ensure_window_order_while_seeding_default_layout

Conversation

@maxy-shpfy
Copy link
Copy Markdown
Collaborator

@maxy-shpfy maxy-shpfy commented May 4, 2026

Description

On a user's first visit to the editor (when no window layout exists in localStorage), the dock panel stacks are now automatically seeded to match the DEFAULT_VIEW_PRESET ordering. Previously, windows would appear in registration order rather than the intended preset order.

This was achieved by:

  • Replacing the flat dockPositions: Record<string, "left" | "right"> shape on ViewPreset with a structured dockAreas: PresetDockAreas object ({ left: string[], right: string[] }), where array order defines the desired stack order.
  • Adding a dockSideByWindowId utility that derives a Map<id, side> from a PresetDockAreas object, used by applyViewPreset to correct dock sides without reshuffling stack order.
  • Adding seedInitialDockLayoutFromPreset on WindowStoreImpl, which both corrects dock sides and rewrites windowOrder for each dock column to match the preset's declared order. This is intentionally called only when no persisted layout exists.
  • Adding a useSeedInitialDockLayoutFromPreset hook that gates the call on hasPersistedLayout() and wires it into the editor on mount.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Screen Recording 2026-05-04 at 1.43.48 PM.mov (uploaded via Graphite)

Test Instructions

  1. Clear localStorage (or open a private/incognito window) so no persisted dock layout exists.
  2. Open the editor and verify that the dock panels appear in the order defined by DEFAULT_DOCK_AREAS (left: runs-and-submission, component-library, pipeline-tree, history, debug-panel, recent-runs; right: pipeline-details, context-panel).
  3. Rearrange panels, reload the page, and confirm the custom order is preserved (persisted layout is respected and seeding does not run again).
  4. Apply a view preset and confirm dock sides are corrected without reshuffling the existing stack order.

Additional Comments

The applyViewPreset method intentionally does not reorder stacks — it only corrects which side a window belongs to. Stack order seeding is exclusively the responsibility of seedInitialDockLayoutFromPreset, which runs once on first visit.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

🎩 Preview

A preview build has been created at: 05-03-feat_v2_-_ensure_window_order_while_seeding_default_layout/73f69bd

Copy link
Copy Markdown
Collaborator Author

maxy-shpfy commented May 4, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_add_runs_and_submissions_window branch from 3c7b3e1 to f300e35 Compare May 4, 2026 05:36
@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_ensure_window_order_while_seeding_default_layout branch 2 times, most recently from 8d997d9 to 8a7e548 Compare May 4, 2026 05:42
@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_add_runs_and_submissions_window branch from f300e35 to 7fbeb40 Compare May 4, 2026 20:10
@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_ensure_window_order_while_seeding_default_layout branch 2 times, most recently from 205308a to 4c0fa3e Compare May 4, 2026 20:37
@maxy-shpfy maxy-shpfy marked this pull request as ready for review May 4, 2026 20:44
@maxy-shpfy maxy-shpfy requested a review from a team as a code owner May 4, 2026 20:44
@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_ensure_window_order_while_seeding_default_layout branch from 4c0fa3e to 2f273c0 Compare May 5, 2026 18:50
@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_add_runs_and_submissions_window branch from 7fbeb40 to 0ba40ca Compare May 5, 2026 18:50
@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_ensure_window_order_while_seeding_default_layout branch from 2f273c0 to 73f69bd Compare May 5, 2026 18:53
@maxy-shpfy maxy-shpfy force-pushed the 05-03-feat_v2_-_add_runs_and_submissions_window branch from 0ba40ca to 50ed8a5 Compare May 5, 2026 18:53
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.

2 participants