Skip to content

feat(ux): truth & foundations — canonical palette, honest scope language, persistent settings - #19

Merged
jack-arturo merged 8 commits into
mainfrom
feat/ux-truth-foundations
Jun 11, 2026
Merged

jack-arturo merged 8 commits into
mainfrom
feat/ux-truth-foundations

Conversation

@jack-arturo

Copy link
Copy Markdown
Member

What

First of two UX workstreams from the six-surface UX audit (9 agents, 61 findings, three design lenses). This PR fixes everything that lies to the user:

Canonical palette (color stopped lying)

Four divergent type→color maps coexisted — VIBRANT_TYPE_COLORS in GraphCanvas, local maps in MiniMap and TagCloud, tailwind config — plus server meta.type_colors. The same memory type rendered as a different hue in the 3D scene vs the minimap vs the tag cloud vs the inspector. Now:

  • src/lib/palette.ts is the single source of truth (the scene palette, tuned for dark bg + bloom)
  • Resolved over server colors at the API chokepoint; normalizeNode prefers the type-keyed color
  • Pathfinding trace hues + pinch pre-select amber are named tokens
  • Settings relationship swatches derive from EDGE_STYLES instead of a duplicate table

Honest scope language ("in view" vs "in store")

The UI never said which universe a number referred to (loaded ~2k scene vs 10k–50k store):

  • StatsBar: 2,000 in view · 10,107 in store
  • Search badge: 43 in store with an explanatory tooltip; placeholder says "Search all memories…"
  • Pathfinding: a no-path result used to silently vanish — now an honest "No path among loaded memories" card with the expand-and-retry hint
  • TimelineBar counts say "in view"

Persistent workspace

Force/display/cluster/relationship configs and tag AND/OR mode survive reloads (usePersistentState, same pattern as sounds.ts) + "Reset all" in the settings header.

Empty state

A zero-node load no longer leaves a silent black canvas: empty store → onboarding card; over-filtered → count + one-click filter reset.

Connection visibility & auth recovery

  • One-time "Connected to " toast for URL-token (shared link / embedded) sessions
  • Settings → Connection: server, masked token, Disconnect
  • Auth rejection gets an "Access denied" card whose Enter credentials strips URL-borne tokens so TokenPrompt can take over
  • Bug fix: TanStack's networkMode: 'online' parked failed queries at fetchStatus: 'paused' forever when the browser's online-manager misdetects — infinite spinner instead of any error card (reproduced live; failureCount froze at 1). Now networkMode: 'always', and 401/403 skip retries entirely so the card is instant.

Verification

Live against a local AutoMem store (10,107 memories) via dev server:

  • ✅ Identical hue per type across scene, minimap, inspector dot, settings swatches (verified to exact rgb values)
  • ✅ Header reads 2,000 in view · 10,107 in store; search reads 43 in store
  • ✅ Display config survived reload (localStorage round-trip)
  • ✅ Connection section shows server + masked token + Disconnect
  • ✅ Bad token → instant "Access denied" → "Enter credentials" → TokenPrompt (full loop)
  • ✅ Pathfinding "Path Found" regression-checked
  • ✅ npm run lint (0 errors, 14 warnings = main's baseline) + npm run build green
  • Empty-state card + no-path card verified by code review (need an empty store / disconnected endpoints to trigger live)

Part 1 of 2 — PR-2 (expansion made visible: arrival animation, frontier cues, hover halo) stacks on this.

🤖 Generated with Claude Code

jack-arturo and others added 7 commits June 11, 2026 22:24
Four divergent type→color maps (GraphCanvas VIBRANT_TYPE_COLORS, MiniMap,
TagCloud, tailwind config) plus server meta.type_colors rendered the same
memory type as different hues per surface. Canonicalize on the scene palette
in src/lib/palette.ts, resolve it over server colors at the API chokepoint,
and make normalizeNode prefer the type-keyed color. Pathfinding trace hues
and the pinch pre-select amber become named tokens; settings relationship
swatches now derive from EDGE_STYLES instead of a duplicate table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The UI never said which universe a number referred to: the stats bar's bare
count read as exhaustive, the search badge counted the whole store while the
canvas highlighted only loaded matches, pathfinding silently vanished when no
path existed among loaded edges, and the timeline counted 'memories' that were
really just the loaded scene. Every count now names its scope, and pathfinding
failure gets an honest no-path card with the expand-and-retry hint.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Force, display, clustering, and relationship-visibility configs were plain
useState — every reload reset the workspace to defaults (only sound settings
persisted). Extract the sounds.ts localStorage pattern into usePersistentState,
apply it to all four configs plus the tag AND/OR mode, and add a 'Reset all'
escape hatch to the settings header.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A successful snapshot with zero nodes left an unexplained black canvas —
indistinguishable from a crash, and the literal first impression for anyone
opening a freshly deployed (empty) AutoMem store. Distinguish the two causes
via stats.total_nodes: an empty store gets a friendly onboarding card with
Refresh and a wire-up-an-agent link; an over-filtered view says how many
memories the filters excluded and offers one-click filter reset.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Embedded /viewer/#token= sessions authenticated silently — no confirmation,
no way to see which server you're on, no sign-out, and a rejected shared-link
token dead-ended at a generic 'Connection Error' whose Retry re-hit the same
401 forever. Add a one-time 'Connected to <host>' toast for URL-token
sessions, a Settings → Connection section (server, masked token, Disconnect),
and an auth-aware error card whose 'Enter credentials' strips URL-borne
tokens so TokenPrompt can actually take over.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
usePersistentState setters aren't lint-exempt like React's useState setters;
they're stable (useCallback on key), so listing them is behavior-neutral.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
TanStack Query's default networkMode 'online' parks a failed query at
fetchStatus 'paused' whenever the browser's online-manager misdetects
connectivity — no retry, no error state, an infinite spinner exactly where
the error card should be (reproduced in a managed browser; failureCount
froze at 1 with status 'pending'). This app talks to exactly one API, so
let the fetch itself be the connectivity check: networkMode 'always' for
queries and mutations. Auth rejections (401/403) additionally skip retries
entirely — they don't fix themselves, and failing fast is what makes the
new Access-denied card render immediately.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 11, 2026 20:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR implements the first UX workstream from the audit by standardizing type colors across all UI surfaces, making count/scope language explicit (“in view” vs “in store”), and persisting key workspace settings across reloads (plus clearer auth/connection feedback and improved empty/no-path states).

Changes:

  • Introduces a canonical client palette (src/lib/palette.ts) and applies it at the API “chokepoint” + node normalization to keep all surfaces color-consistent.
  • Updates multiple UI surfaces (Stats/Search/Timeline/Pathfinding/Empty states) to communicate scope honestly and avoid silent failure states.
  • Adds localStorage-backed persisted settings via usePersistentState and surfaces connection/session visibility + auth recovery improvements (including React Query networkMode/retry behavior).

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tailwind.config.js Aligns Tailwind utility type colors to match the canonical palette values.
src/main.tsx Adjusts React Query defaults (networkMode: 'always') and retries to fail fast on auth errors.
src/lib/palette.ts Adds canonical TYPE_COLORS + named interaction tokens (trace/preselect).
src/lib/normalizeNode.ts Makes type-keyed palette colors override per-node server colors for consistency.
src/hooks/useTagCloud.ts Persists tag AND/OR filter mode using usePersistentState.
src/hooks/usePersistentState.ts New hook for localStorage-backed state hydration and write-through persistence.
src/components/TimelineBar.tsx Updates copy/tooltips to clarify counts are scoped to “in view”.
src/components/TagCloud.tsx Removes local default palette and backs type colors with canonical TYPE_COLORS.
src/components/StatsBar.tsx Makes “in view” vs “in store” explicit and adds explanatory tooltips.
src/components/settings/SettingsPanel.tsx Derives relationship swatches from EDGE_STYLES; adds Reset + Connection sections.
src/components/SelectionHighlight.tsx Replaces hardcoded preselect color with canonical PRE_SELECT token.
src/components/SearchBar.tsx Makes store-wide search scope explicit in placeholder + badge/tooltip text.
src/components/PathfindingOverlay.tsx Adds explicit “no path among loaded memories” card instead of silently vanishing.
src/components/MiniMap.tsx Uses node’s canonical color (with fallback) rather than a local type-color table.
src/components/GraphCanvas.tsx Removes local vibrant palette and uses canonical node colors + trace tokens.
src/App.tsx Persists tuning configs, adds reset-all handler, improves auth recovery + empty state + connection toast.
src/api/client.ts Canonicalizes meta.type_colors and snapshot node colors; exports auth/connection helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot review: the button implied it reset everything in the panel but only
covered forces/display/clustering/relationships. It now also resets audio
(enabled/volume) and the tag AND/OR mode; the tooltip states exactly what it
covers and that filters (view state) are deliberately untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jack-arturo
jack-arturo merged commit cc25224 into main Jun 11, 2026
3 checks passed
@jack-arturo
jack-arturo deleted the feat/ux-truth-foundations branch June 11, 2026 21:24
jack-arturo added a commit that referenced this pull request Jun 11, 2026
Merging stacked PRs #19 and #20 re-applied the connection-visibility block
(connectionToastShownRef / handleReenterCredentials / connectionInfo /
isAuthError) a second time — #20's branch still carried the rebased #19
commits, and after #19's squash-merge the second merge duplicated the block
in a shifted context, breaking tsc (TS2451 redeclarations) and the image
build. src/ now matches the reviewed #20 branch tip exactly.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants