Skip to content

fix(content-graph): address #132 review comments#133

Merged
epeicher merged 8 commits into
trunkfrom
fix/content-graph-review-132
May 11, 2026
Merged

fix(content-graph): address #132 review comments#133
epeicher merged 8 commits into
trunkfrom
fix/content-graph-review-132

Conversation

@epeicher
Copy link
Copy Markdown
Collaborator

@epeicher epeicher commented May 9, 2026

Summary

Batches the eight review items from #132 into a single PR. Addresses the issue end-to-end.

  • Centre dashicons in satellite bubbles — the font's bbox reserves descender space the icons never use, so the bare 0.5/0.5 anchor parked the visible glyph in the disc's upper half. Anchor lowered to 0.5/0.62 for dashicons plus a per-icon nudge map (KIND_ICON_NUDGE) for outliers (admin-comments). Disc bumped 12 → 14, glyph 13 → 18.
  • Spokes behind the focused node — new spokeLayer container between edgeLayer and nodeLayer; the focused node's disc now occludes the spoke origins instead of being painted across by them.
  • Selected satellite state — each ref gets a synthetic key (user:42, term:category:7, …) and the matching bubble picks up a thicker stroke + soft halo while its dossier is open. Selection auto-clears on back-to-post navigation via a new onViewChange panel callback.
  • iOS-style panel transition — replaced the abrupt content swap with a sliding page stack: forward = new-from-right + outgoing parallax-left, back = new-from-left parallax + outgoing-to-right. 240ms cubic-bezier(0.32, 0.72, 0, 1), honours prefers-reduced-motion.
  • Tooltip pinned to cursor — Pixi v8's event.global is already canvas-local; subtracting the host's viewport rect was producing the drift the reviewer flagged. Dropped.
  • Label backing for readability — each node label is now a Container with a translucent rounded-rect graphic + the text, drawn in labelLayer so the whole thing fades together.
  • Smooth label fade on zoom — replaced the binary scale > 0.85 cutoff with smoothstep(0.55, 0.95) over world.scale.x.

"Different orbits per type" — tried, reverted

Implemented the per-kind concentric rings as suggested in the issue. With the typical 1-2 satellites per kind the result was an off-balance cluster (each kind landed on its own ring at increasing distances, and the staggered start angles bunched everyone on one side). Kept the single-ring layout with even angular distribution — much closer to the reference image attached in the issue. Refs come out of flattenDetail already banded by kind, so the ring still reads as colour-grouped as you walk around it.

Closes #132

Test plan

  • Open Content Graph, focus a post with 4-12 satellites — verify ring is tight and evenly distributed
  • Hover a satellite — tooltip sits next to the cursor (not far away)
  • Click a satellite — bubble shows the selected halo, panel slides forward; click breadcrumb back — panel slides back, halo clears
  • Drag a node — only neighbours move (existing behaviour preserved)
  • Pinch-zoom in/out — labels fade smoothly between ~0.55 and ~0.95 zoom
  • Verify spoke lines start visually from BEHIND the focused node disc
  • Toggle prefers-reduced-motion in OS settings — panel transitions become instant
Open WordPress Playground Preview
Review feedback from #132 batched into one branch:

- Centre dashicon glyphs in satellite bubbles. The dashicons font's
  bbox reserves descender space the icons never use, so a bare 0.5
  anchor parked the visible glyph in the disc's upper half. Anchor
  lowered to ~0.62 for dashicons + a per-icon nudge map for the
  outliers (admin-comments) + a larger 18px font in 28px discs so
  the optical centre is unambiguous.
- Render satellite spokes BEHIND the focused node. Added a
  dedicated spokeLayer between edges and nodes; the focused
  node's disc now occludes the spoke origins instead of being
  painted across by them.
- Selected state on the clicked satellite. Each ref gets a
  synthetic key (user:42, term:category:7, …) and the matching
  bubble picks up a thicker stroke + soft halo while its dossier
  is open. Selection auto-clears on back-to-post navigation.
- iOS-style page transition on the side panel. The panel body is
  now a clipped stage holding sliding pages; forward push uses
  new-from-right + parallax-left, back pop uses new-from-left
  parallax + old-to-right. 240ms cubic-bezier(0.32, 0.72, 0, 1).
  Honors prefers-reduced-motion.
- Tooltip pinned to the cursor. Pixi v8's event.global is already
  in canvas-local coordinates; the previous code subtracted the
  host's viewport rect, which is why the tooltip drifted far from
  the hovered satellite. Drop the rect subtraction.
- Translucent rounded backing behind every node label so they
  remain legible over edge tangles + the dot-grid background.
- Smooth alpha fade for labels across a smoothstep zoom band
  (0.55..0.95) instead of the previous binary cutoff at 0.85.

Re: "different orbits per type" — tried it, but with the typical
1-2 satellites per kind it produced an off-balance cluster (each
kind on its own concentric ring). Reverted to a single ring with
even angular distribution; refs come from flattenDetail already
banded by kind, so the ring still reads as colour-grouped as you
walk around it.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Satellite labels (e.g. "Recipe", "admin") were rendering directly
on the dot-grid background and frequently fused with neighbour-
post labels or the focused-node disc when the layout placed them
in tight proximity. Add a translucent rounded backing per
satellite — same pattern the node labels already use — so each
name reads as its own object regardless of what's behind it.

Backing is computed once per satellite at build time (label width
is fixed for the satellite's lifetime), so this is not an
additional per-frame cost.
@epeicher epeicher marked this pull request as ready for review May 9, 2026 11:17
epeicher and others added 2 commits May 9, 2026 13:32
Two related fixes for the side panel:

- Open / close now slide. The panel's outer container animates its
  width 0 ↔ 320px while the inner frame eases off to the right and
  fades, so the canvas reclaims the space smoothly when the user
  closes the panel and the panel arrives with a subtle parallax
  when opening. 220ms cubic-bezier + 180ms opacity, honors
  prefers-reduced-motion. Replaced the binary `host.hidden` toggle
  with a `--closed` class so the transition can run; the initial
  PHP-rendered `[hidden]` paint is pinned to no-transition so
  page load stays flicker-free.
- The iOS-style sub-view transition (post → user/term/comment …
  and back) was wired correctly but never animated because
  `swapPage` read `currentPage` AFTER `renderCurrent` had already
  reassigned it to the new page — `prev === next` short-circuited
  the slide. Capture the outgoing page in `renderCurrent` and pass
  it explicitly so swapPage has a real `prev` to animate out.
Copy link
Copy Markdown
Collaborator

@AllTerrainDeveloper AllTerrainDeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

image

Not great :)

  • Seems the icon centering is not addressed.

Awesome!

  • The text transition is superb
  • The select state is good!
  • The tooltip positioning is great!
  • The "Back" smooth transition is nice!
  • The post title font could be bigger, matching the rest of labels.

Also

  • What about removing the alpha so the lines are truly hidden?
  • That "bug"/glitch when a node is slightly moving and we click on it and its not opening is a bit annoying... I believe it has to be with the DRAG state. I don't think we need to drag anything in this view. Removing the drag features would solve it immediately I believe?
image
epeicher added 4 commits May 11, 2026 11:13
Earlier attempt used an off-centre anchor (0.5, 0.62) plus a single
per-kind y nudge, but that left the asymmetric glyphs (notably
admin-comments — bubble in upper-left + tail trailing down-right)
parked in the disc's upper-left corner.

Reset anchor to a clean (0.5, 0.5), bump the glyph to 20px so it
fills more of the 28px disc, and turn KIND_ICON_NUDGE into a per-
kind {x, y} map. The comment glyph gets {x: 2, y: 2} so the bubble
lands on the disc centre with the tail trailing past the lower-
right disc edge. Other kinds stay near zero with a +1y for users /
media / revisions.
Earlier values (+1 to +2) were not enough — every kind of glyph was
still parked in the upper half of its disc. Pixi.Text bbox =
ascent + descent for the font, but dashicons leave the descent
empty, so the glyph centre sits ~ascent/2 above the bbox centre.
For fontSize:20 that's ~3px upward. Setting y:3 across every kind
brings the visible glyph onto the disc centre; comment keeps its
+2 x nudge for the left-loaded speech-bubble bbox.
Bundle of fixes from the PR-comment round:

- No double loading. The native-window registry callback was
  dropping the render Promise with `void`, so the framework's big-W
  overlay hid before the graph had fetched its data. Await the
  render and forward the returned `abort` as the framework's
  teardown, so cleanup (Pixi destroy, panel destroy, toolbar
  destroy) actually fires on close.
- Non-focus edges truly hidden during focus (alpha 0, not 0.05),
  and the focused-side endpoint of every visible edge / spoke is
  geometry-trimmed at the halo's outer edge so no line crosses the
  focused-node disc.
- Edge visibility now zoom-aware. Smoothstep(0.45, 1.1) over the
  world scale lifts the default edge alpha from 0.2 (overview) to
  0.55 (1×+), so post-to-post links read clearly the moment you
  zoom in, without cluttering the overview.
- Drag is back, threshold-gated. The earlier "click on a moving
  node didn't open" bug was incidental `globalpointermove` events
  flipping `isDragging` to true between down + up. Now drag only
  promotes after the pointer travels >6px; small jitter stays a
  click. Click also pins the node briefly so simulation drift
  can't yank it from under the cursor.
- Sim warm-start in setData: spin the integrator min(90, 30 + n)
  steps synchronously before the first paint so the window opens
  onto a near-settled layout instead of nodes flying into place.
  Initial reheat alpha lowered 0.15 → 0.12 for a calmer final
  settle.
- Per-icon nudge for the speech-bubble glyph (`{x:1, y:4}`) and
  media (`{x:-1, y:1}`) tuned visually against the rendered
  output. Comment kept its own override because its tail-loaded
  bbox isn't centre-balanced like the other dashicons.
@epeicher
Copy link
Copy Markdown
Collaborator Author

Thanks for your review @AllTerrainDeveloper! I have addressed all the comments:

  • Seems the icon centering is not addressed
  • What about removing the alpha so the lines are truly hidden?
CleanShot 2026-05-11 at 12 32 22@2x
  • That "bug"/glitch when a node is slightly moving and we click on it and its not opening is a bit annoying... I believe it has to be with the DRAG state. I don't think we need to drag anything in this view. Removing the drag features would solve it immediately I believe? ✅

  • One more thing, I realised that a "double" loading is happening. That's we can use the hook that we have to. indicate that we have finished load everythign (that way, the BIG W loading icon stays until the initial render is completed:

    • @AllTerrainDeveloper I believe this is fixed, but please let me know if that is the case as I am not 100 % sure

This is ready for another review

@AllTerrainDeveloper
Copy link
Copy Markdown
Collaborator

Looking!

Copy link
Copy Markdown
Collaborator

@AllTerrainDeveloper AllTerrainDeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ship it! I found an unrelated not-nice UX that we can address on a new issue I will open now

@epeicher epeicher merged commit a66b7b0 into trunk May 11, 2026
6 checks passed
@epeicher epeicher deleted the fix/content-graph-review-132 branch May 11, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants