A nested view's layout is the root's, per instance, in the root file - #66
Merged
Merged
Conversation
Navigating in place, a nested workflow is shown as an instance of the editor's root. Its layout was still the workflow's own: one per workflow, in the file that defines it, shared by every parent and every instance. With `nestedNavigation: 'in-place'` (now also in the storage options), a view at a trail reads and saves its layout in the root file's store under `root/<instance path>/<workflow>`, so two uses of a workflow can be laid out differently; until it has one it starts from the workflow's standalone layout, so earlier layouts carry over. The layout target is now recorded on the diagram model at load and read by every handler that saves a layout (`layoutTargetOf`). Eight of them -- moving a node, rerouting, resetting routes, the layout commands, placing new nodes -- recomputed the key from the shown workflow's name, so a hierarchical runtime's per-instance layouts were read per instance and saved per workflow. A rename also moves the node in the instance layout. Phase 4 of docs/proposals/single-editor-hierarchy.md. Claude-Session: https://claude.ai/code/session_015VK7fH1c4aKbexnq2QcuKU
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.
Phase 4 of
docs/proposals/single-editor-hierarchy.md(after #64 and #65).Navigating in place, a nested workflow is shown as an instance of the editor's root. Its layout was still the workflow's own: one per workflow, in the file that defines it, shared by every parent and every instance.
Per-instance layout
nestedNavigation: 'in-place', now also carried in the storage options, a view at a trail reads its layout from the root file's store underroot/<instance path>/<workflow>(layout-target.ts,instanceLayoutFor). Two uses of one workflow can then be laid out differently.One recorded save target. The load records the layout target on the diagram model (
layoutTarget), and every handler that saves a layout reads it throughlayoutTargetOf: moving a node, change-routing-points, reset routes, reroute (×2), boundary-flow and serpentine layouts, and placing new nodes. These eight sites each recomputed the key from the shown workflow's name. That also meant a hierarchical runtime's per-instance layouts (cal:rootWorkflow) were read per instance but saved per workflow, and this fixes that too. A rename also moves the node in the instance layout.Tests:
per-instance-layout.test.ts(8). It drives the real load path with a recording layout store and checks the instance key in the root file, the fallback order, unchanged behaviour in new-editor mode, and the target the handlers read. All workspaces pass, with neutrality 5/5 and typecheck 5/5.https://claude.ai/code/session_015VK7fH1c4aKbexnq2QcuKU