Repository navigation
feat(ux): truth & foundations — canonical palette, honest scope language, persistent settings - #19
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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
usePersistentStateand 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>
This was referenced Jun 11, 2026
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>
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
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_COLORSin GraphCanvas, local maps in MiniMap and TagCloud, tailwind config — plus servermeta.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.tsis the single source of truth (the scene palette, tuned for dark bg + bloom)normalizeNodeprefers the type-keyed colorEDGE_STYLESinstead of a duplicate tableHonest scope language ("in view" vs "in store")
The UI never said which universe a number referred to (loaded ~2k scene vs 10k–50k store):
2,000 in view · 10,107 in store43 in storewith an explanatory tooltip; placeholder says "Search all memories…"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
networkMode: 'online'parked failed queries atfetchStatus: 'paused'forever when the browser's online-manager misdetects — infinite spinner instead of any error card (reproduced live;failureCountfroze at 1). NownetworkMode: '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:
2,000 in view · 10,107 in store; search reads43 in storenpm run lint(0 errors, 14 warnings = main's baseline) +npm run buildgreenPart 1 of 2 — PR-2 (expansion made visible: arrival animation, frontier cues, hover halo) stacks on this.
🤖 Generated with Claude Code