close
Skip to content

[WIP] Add Galaxy view to the Content Graph#306

Draft
epeicher wants to merge 1 commit into
trunkfrom
content-graph-galaxy-view
Draft

[WIP] Add Galaxy view to the Content Graph#306
epeicher wants to merge 1 commit into
trunkfrom
content-graph-galaxy-view

Conversation

@epeicher

@epeicher epeicher commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

What

A second render mode for the Content Graph window, toggled with a Graph / Galaxy segmented control in the toolbar. Galaxy renders the corpus as a starfield: every post is a tiny additive-blended dot, each group-by cluster glows as a coloured nebula with a name + post-count label at its heart, and recently-edited or focused posts twinkle.

Visual encoding

Channel Meaning
Colour Active group facet (hashed hue per term/author, chronological ramp for year / year-month)
Brightness Comments + word count, log-normalised
Twinkle Modified in the last 30 days, or the focused post + neighbours

Galaxy chrome

  • All / Drafts / Recent tabs (drafts = your own drafts, now included in the payload; recent = modified in the last 30 days)
  • Min comments + Zoom sliders, "X of Y visible" readout
  • Bottom legend, hover tooltips, click-to-focus opens the same detail panel as Graph view
  • Last-used view persists per user (desktop_mode_content_graph_view user meta, saved over REST)

Server changes

  • Per-node payload gains comment_count, word_count (shortcode/tag-stripped), modified_ts
  • The posts query now includes the current user's own drafts; the transient cache key is bucketed per user so one user's drafts never surface in another's payload
  • Cache prefix bumped cg2_cg3_ (schema change, one-time rebuild)

Layout notes (tuned against a 1,000-post seeded corpus)

  • Single-membership commit: each dot clusters under its first group key only. With realistic 2-3-terms-per-post data, multi-membership pulls chain every cluster together and the layout collapses into one ball. Colour, forces, nebulae, and labels all share the commit.
  • Hyperlink springs drop to near zero while grouping is active (one cross-cluster link otherwise out-pulls the attractor).
  • Labels sit at the cluster centroid and fade in together with the nebulae only after clusters visibly separate, so convergence doesn't render as a stack of names over one blob.
  • Cluster radius = 80th-percentile member distance (a stray dot can't balloon a nebula).
  • Auto-fit-follow keeps the camera framing the layout while the sim spreads it; any manual wheel/drag cancels it. The resize observer resizes the Pixi renderer explicitly (Pixi's resizeTo ignores element resizes, which left the canvas stale after window maximize).
  • Dot taps vs background clicks reuse GraphScene's nodeClickActive pattern so selecting a dot doesn't immediately close its own panel.

Testing

  • npm run lint, npm run typecheck clean; npm run test:js 1,577 tests green (new: content-graph-galaxy.test.ts covering the brightness curve + tab filter predicate)
  • New PHPUnit coverage for the payload fields (test_galaxy_payload_fields_populated)
  • Browser-verified end to end on a 1,001-post / 25-category / 36-tag corpus: grouping by category, tag, and year-month; maximize/restore; view-toggle round trips; selection + deselection; view persistence across reopen

Notes for review

  • galaxy-scene.ts is a sibling of scene.ts, not an extension — the two share the ForceSim and the payload types but nothing at the render layer, so keeping them separate avoids "is the mode active" branching through the existing scene.
  • Docs: Content Graph has no public-contract docs surface (internal feature window), so no doc updates ship with this.
Open WordPress Playground Preview

Alternate render mode for the Content Graph window: every post is a
tiny additive-blended dot, clusters glow as coloured nebulae, and
recently-edited or focused posts twinkle. Toggled via a Graph/Galaxy
segmented control; the last choice persists per user via the
desktop_mode_content_graph_view user meta key.

Visual encoding: colour = active group facet (hashed hue for
categorical facets, chronological ramp for year/year-month),
brightness = log-normalised comments + word count, twinkle = modified
in the last 30 days or focused. Galaxy chrome adds All/Drafts/Recent
tabs, min-comments and zoom sliders, a visible-count readout, and a
bottom legend.

Server payload gains per-node comment_count, word_count, and
modified_ts; the posts query now includes the current user's own
drafts (cache key bucketed per user so drafts never leak across
accounts). Cache prefix bumped to cg3_ for the schema change.

Galaxy-specific layout decisions, learned against a 1000-post corpus:

- Single-membership commit: each dot belongs to its FIRST group key
  only. Multi-membership pulls chain every cluster to every other on
  a corpus where most posts carry 2-3 terms, and the layout collapses
  into one entangled ball. Colour, force assignment, nebulae, and
  labels all share the commit so the picture stays consistent.
- Hyperlink springs drop to near zero while grouping is active; a
  single cross-cluster link otherwise out-pulls the cluster attractor.
- Labels sit at the cluster centroid and fade in (with the nebulae)
  only after the clusters have visibly separated, so the convergence
  phase doesn't render as a stack of names over one blob.
- Cluster radius is the 80th-percentile member distance, not the max,
  so a stray dot can't balloon a nebula.
- Auto-fit-follow keeps the camera framing the layout while the sim
  spreads it (cancelled by any manual wheel/drag), and the resize
  observer resizes the Pixi renderer explicitly because resizeTo only
  reacts to browser-window resizes, not element resizes.
- Dot taps and background clicks share the GraphScene nodeClickActive
  pattern so selecting a dot doesn't immediately close its own panel.
@epeicher epeicher changed the title Add Galaxy view to the Content Graph [WIP] Add Galaxy view to the Content Graph Jun 13, 2026
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