[WIP] Add Galaxy view to the Content Graph#306
Draft
epeicher wants to merge 1 commit into
Draft
Conversation
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.
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.
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
Galaxy chrome
desktop_mode_content_graph_viewuser meta, saved over REST)Server changes
comment_count,word_count(shortcode/tag-stripped),modified_tscg2_→cg3_(schema change, one-time rebuild)Layout notes (tuned against a 1,000-post seeded corpus)
resizeToignores element resizes, which left the canvas stale after window maximize).GraphScene'snodeClickActivepattern so selecting a dot doesn't immediately close its own panel.Testing
npm run lint,npm run typecheckclean;npm run test:js1,577 tests green (new:content-graph-galaxy.test.tscovering the brightness curve + tab filter predicate)test_galaxy_payload_fields_populated)Notes for review
galaxy-scene.tsis a sibling ofscene.ts, not an extension — the two share theForceSimand the payload types but nothing at the render layer, so keeping them separate avoids "is the mode active" branching through the existing scene.