PR8.10: Fix file-detail blank view — debug selectors + force visible …#16
Merged
PR8.10: Fix file-detail blank view — debug selectors + force visible …#16
Conversation
…detail nodes
Root causes fixed:
1. deferredFit fallback was mode-unaware (primary bug)
The `target.length === 0` fallback always tried to restore a files-only view
by hiding ALL type/func nodes. In file-detail mode there are no file nodes,
so the view went silently blank. Fixed by skipping the fallback entirely
when `state.mode === 'file-detail'`.
2. rawFileNodeId not stored on overview cards (Part 4)
Overview file cards now carry `rawFileNodeId: n.id` in their data.
The tap handler reads this instead of relying on `node.id()`, making the
ID handoff to showFileDetail robust against any future display-id rewrites.
3. buildDetailElements rebuilt from raw graph (Part 2)
- Adds a file context node (kind="file") at the top of the detail view so
the selected file is always visible as a card above the type stack.
- Includes calls edges between funcs visible in this view, enabling call-
edge highlight when a func is tapped in detail mode.
- Extended debug logging: direct children count, type/free-func split,
edge count, and total element count.
4. showFileDetail — comprehensive debug logging (Part 1)
Logs at every critical decision point: entry (fileNodeId, mode, graph size),
fileData-not-found (with available file IDs), detailElements counts
(types/funcs/edges), and post-cy.add counts (cy nodes, visible types).
5. Defensive guard — force type visibility (Part 3)
After cy.add(), if typeCount > 0 but cy shows 0 visible type nodes,
force-removes hidden-node from all type nodes before layout runs.
Guards against compound-parent sizing edge cases.
6. layoutDetailTypeNodes — positions file context node (Part 3)
File context card is placed at y=0; type stack starts below it with
GROUP_GAP/2 separation. deferredFit now fits both file and type nodes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
…detail nodes
Root causes fixed:
deferredFit fallback was mode-unaware (primary bug) The
target.length === 0fallback always tried to restore a files-only view by hiding ALL type/func nodes. In file-detail mode there are no file nodes, so the view went silently blank. Fixed by skipping the fallback entirely whenstate.mode === 'file-detail'.rawFileNodeId not stored on overview cards (Part 4) Overview file cards now carry
rawFileNodeId: n.idin their data. The tap handler reads this instead of relying onnode.id(), making the ID handoff to showFileDetail robust against any future display-id rewrites.buildDetailElements rebuilt from raw graph (Part 2)
showFileDetail — comprehensive debug logging (Part 1) Logs at every critical decision point: entry (fileNodeId, mode, graph size), fileData-not-found (with available file IDs), detailElements counts (types/funcs/edges), and post-cy.add counts (cy nodes, visible types).
Defensive guard — force type visibility (Part 3) After cy.add(), if typeCount > 0 but cy shows 0 visible type nodes, force-removes hidden-node from all type nodes before layout runs. Guards against compound-parent sizing edge cases.
layoutDetailTypeNodes — positions file context node (Part 3) File context card is placed at y=0; type stack starts below it with GROUP_GAP/2 separation. deferredFit now fits both file and type nodes.