Repository navigation
Corkboard: disc nodes by default, pins one row away - #510
Merged
Merged
Conversation
Nodes were the post type's Dashicon glyph, which for posts is the pushpin — the loudest possible mark for the most common node. They are now discs coloured by post type, using the same palette the relationship satellites use so a focused post and the bubbles fanned around it read as one system. Focus and hover reveal the glyph inside the disc, so neither costs the user the type information. Discs repaint only when their signature changes; a fill + stroke per node per frame is affordable for a demo graph and is not for a real site's few hundred posts. The pins are still there, behind "Show pins" in the window's ⋯ menu, persisted in localStorage. That row is a checkbox, and window actions had only ever been verbs — so `WindowActionDef` grows `checkable` plus a `checked` reader re-read on every menu open, which is what lets a plugin persist a preference and repaint nothing. `closeOnSelect` overrides the per-shape default: a verb closes the menu, a checkbox stays open so the user watches the tick land. `flipStartupCheckOptimistically` becomes `flipMenuItemCheckOptimistically` — the body was always generic, and plugin checkboxes now share it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The scene asked for MSAA and rendered at the display's own density, which is enough for a large shape and not for these: a node is 8-16 world units across and wears a 1.5-unit keyline, and the overview sits at ~0.5x zoom. There the keyline is under a device pixel, MSAA has nothing to average, and the ring breaks into a dotted shimmer - losing exactly the thing it is for, which is keeping two overlapping nodes readable as two nodes. Render 1.5x above device-pixel ratio (clamped at 3, since the cost is quadratic and the canvas is full-window) and let the browser resolve the extra samples down on composite. `autoDensity` already keeps the canvas at its CSS size, so nothing about the layout moves. Both `Text` layers move off their pinned `resolution: 2` onto the same number. A glyph rasterised below the density of the canvas around it is upscaled, and the icon is now the focus/hover reveal *inside* the disc - it would have been the one soft thing on a sharper screen. Set RENDER_SUPERSAMPLE to 1 to get the previous behaviour back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AllTerrainDeveloper
force-pushed
the
corkboard-node-style
branch
from
August 23, 2026 17:23
da3bd6d to
f034a58
Compare
AllTerrainDeveloper
enabled auto-merge (squash)
August 23, 2026 17:24
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.
Why
Every Corkboard node was the post type's Dashicon glyph — for posts, the pushpin. The loudest possible mark on the most common node, and it didn't sit with the rest of the app.
What
Nodes are discs coloured by post type. Same palette the relationship satellites already use, so a focused post and the bubbles fanned around it read as one system rather than two. Sizing is unchanged (
8 + √degree × 2.4); a keyline keeps overlapping nodes readable at low zoom. Focus scales the disc, fills it with the accent, and reveals the glyph inside — hover does too — so neither costs the user the type information.Discs repaint only when their signature changes. A fill + stroke per node per frame is fine for a demo graph and not for a real site's few hundred posts; in steady state it's zero repaints.
Pins are one row away. "Show pins" in the window's ⋯ menu, persisted in
localStorage(desktop-mode/corkboard-node-style).Checkbox rows for
registerWindowAction()(This replaces the
registerWindowMenuItem()API the first draft of this PR proposed.registerWindowAction()landed on trunk in the meantime and is the better-developed surface — it has a PHP opt-in, a server-sync module, and a working owner sweep. Shipping a second parallel registry alongside it would have been a mistake, so the new API is gone and its one genuinely new capability moved across.)Window actions had only ever been verbs. "Show pins" is a preference, so
WindowActionDefgrows a second row shape:checkable: true+checked( win )— painted asrole="menuitemcheckbox", ticked from the reader.checkablewithoutcheckedthrows: a checkbox nobody can ask renders permanently unticked, which reads as broken persistence in the plugin rather than a missing field in the def.checked()is asked, never told — re-read on every menu open, so a plugin persists its preference and repaints nothing, and the row can't disagree with the plugin for longer than one open.closeOnSelectoverrides the per-shape default in either direction.flipStartupCheckOptimistically→flipMenuItemCheckOptimistically. The body was always generic; plugin checkboxes now share it with "Open on startup".The docs make the choice between the two shapes explicit, because they aren't interchangeable: a relabelling
labelfunction is right when the two states are two places the window can be ("Send to your Mac" / "Bring back into OpenStation") — the row names the move. A checkbox is right when they're one setting the window either has or doesn't: a tick says "there is a thing here, and it is currently off", which a label reading "Show pins" alone cannot.Supersampling the canvas
Second commit, and separable if you'd rather it went on its own.
The scene asked for
antialias: trueand rendered atmin(devicePixelRatio, 2)— native density on any Retina display, so MSAA and no supersampling. Enough for a large shape; not for these. A node is 8–16 world units across wearing a 1.5-unit keyline, and the overview sits near 0.5× zoom. There the keyline is under a device pixel: MSAA has nothing to average and the ring breaks into a dotted shimmer — losing exactly the thing the ring is for, which is keeping two overlapping nodes readable as two nodes.So: render 1.5× above DPR, clamped at 3 (the cost is quadratic and the canvas is full-window; a 1400×800 stage is 10M pixels at 3 and 18M at 4).
autoDensityalready holds the canvas at its CSS size, so nothing about the layout moves.RENDER_SUPERSAMPLE = 1restores the old behaviour.Both
Textlayers move off their pinnedresolution: 2onto the same number. A glyph rasterised below the density of the canvas around it gets upscaled, and the icon is now the focus/hover reveal inside the disc — it would have been the one soft thing on a screen that just got sharper everywhere else.If it's still not clean enough the next step is different in kind: bake one white circle+ring into a
RenderTextureand use tintedSprites, which gives free filtering at every zoom and collapses every disc into one draw call. The trade is that the keyline then scales with the disc instead of holding a constant world width.Tests
typecheck/lint/buildclean,test:jsgreen (380 files, 4838 tests). New coverage: checkable-row validation (including thecheckable-without-checkedthrow), thecheckedresolver's re-read-never-cache contract and its throwing-reader containment, checkbox painting and the glyphless leading edge, the optimistic flip surviving a throwing handler,closeOnSelectin both directions; plus node-style default, constructor-passed style, cache invalidation on toggle and non-invalidation on a redundant call.No PHP changed. Docs updated in the same change:
javascript-reference.md,api-index.md, the Corkboard section ofhooks-reference.md, and a checkbox section in the existingexamples/window-action.md.Rebased onto trunk (was 101 commits behind).
Manual check
Open Corkboard, confirm discs on first paint, ⋯ → Show pins and back — the tick should flip with the menu staying open — then reload to confirm it sticks. Worth an eye on whether the keyline reads cleanly at overview zoom now, and on whether disc sizes work at that zoom — the one thing tests can't tell you.
🤖 Generated with Claude Code