Keep a Main loop's children under it in the sidebar - #258
Merged
Merged
Conversation
A sketch is deliberately not an entry point, so the startAnchors walk never started at one: every loop a Main loop handed off to came back unreached, was read as a headless component, and was promoted to an anchor — a top-level sidebar row beside its parent that collapsing the parent could not hide. Seed the walk with the sketches sidebarRoots actually rows. A targeted sketch stays out of it: it has no row for its subtree to be reached through. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AoiYAyXWLj4b8xMumkDCNT
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.
The bug
Create child loops from a Main loop and they list as top-level rows beside their parent, not under it — and collapsing the parent leaves them on screen. Only Main-parented loops are affected; every other loop type nests correctly.
Why
LoopGraph.startAnchorspicks entry points from non-sketch nodes (a Main loop is.sketchon disk), then walks out from them; anything the walk never reaches is treated as a headless component and promoted to an anchor of its own.A Main loop is never an entry, so the walk never started at one — its children came back unreached and each got promoted.
sidebarRootsisstartAnchorsplus untargeted sketches, so the children landed at depth 0 as siblings, andflattenedNodeRows' collapse only hides rows that are actually nested.The fix
Seed the walk with the sketches
sidebarRootsactually rows. A targeted sketch stays out of it deliberately: it has no row of its own, so it cannot be the beginning its subtree is reached through — covering it would strand that subtree with no row at all (the handoff-ring case, pinned by the second test).startAnchorshas no other production caller — canvas entry ports come fromentryPoints/cycleOnlyNodeIDs— so the canvas is unaffected.Verification
xcodebuild testmake check🤖 Generated with Claude Code
https://claude.ai/code/session_01AoiYAyXWLj4b8xMumkDCNT