Skip to content

PR8.10: Fix file-detail blank view — debug selectors + force visible …#16

Merged
adgk2349 merged 1 commit intomainfrom
flowmap-pr8-10-file-detail-fix
Mar 7, 2026
Merged

PR8.10: Fix file-detail blank view — debug selectors + force visible …#16
adgk2349 merged 1 commit intomainfrom
flowmap-pr8-10-file-detail-fix

Conversation

@adgk2349
Copy link
Owner

@adgk2349 adgk2349 commented Mar 7, 2026

…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.

…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>
@adgk2349 adgk2349 merged commit 7fbe572 into main Mar 7, 2026
2 checks passed
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.

1 participant