Repository navigation
Description
Overview
../nodespace-docs/DESIGN.md is explicit that node types do not each get their own color: "all node types map to primary... don't add a new node type color... all types share a single accent intentionally." Three different, disagreeing implementations of the node-type color variables (--node-text, --node-task, --node-ai-chat, --node-entity, --node-query, --node-user, --node-date, --node-document) currently exist simultaneously in the codebase, and which one visually applies depends on which component tree renders a given node — this is a live, user-visible correctness bug, not just a code-cleanliness issue.
Problem Statement
Three definitions of the same CSS variables coexist:
packages/desktop-app/src/app.css(correct, matches DESIGN.md) — all node-type variables equal--primary(teal,174 67% 35%light /173 50% 41%dark)packages/desktop-app/src/lib/design/components/base-node-viewer.svelte(lines 1510-1515) — a leftover experiment, literally commented/* NodeSpace Extension Colors - Subtle Tint System (Scheme 3) */, overriding--node-text/--node-task/--node-ai-chat/--node-entity/--node-queryto a blue-gray200 40% 45%. This was never cleaned up after the experiment concluded.packages/desktop-app/src/lib/styles/noderef.css(lines 22-24) — a third scheme giving each node type its own distinct hue:--node-user: 200 100% 45%(blue),--node-date: 45 100% 45%(gold),--node-document: 270 75% 50%(purple) — this is the exact opposite of DESIGN.md's single-accent rule. This file is globally imported inpackages/desktop-app/src/routes/+layout.svelte(line 4), so it is live in production, not dead code: node-reference pills rendered anywhere in the app currently pick up these off-spec hues.
The practical effect: depending on which component renders a node reference or node-type indicator, a user sees teal, blue-gray, or a per-type rainbow of colors for what is supposed to be one consistent visual identity across the whole app.
Proposed Solution
- Delete the override block in
base-node-viewer.svelte(lines 1510-1515, the "Subtle Tint System (Scheme 3)" comment block) entirely — it is dead experimental code, not a variant that needs reconciling - Replace the per-type hue definitions in
noderef.css(lines 22-24 and any related per-type accent declarations, including the hardcoded#dc2626/#7c3aed/#ea580c/#0891b2document-type accents noted in the related hardcoded-colors issue) with references to the single--primary-derived node-type variables already correctly defined inapp.css - After the fix,
app.cssshould be the only place any of--node-text,--node-task,--node-ai-chat,--node-entity,--node-query,--node-user,--node-date,--node-documentare defined; every other file should only consume them viavar(--node-*), never redefine them - Verify visually (or via a rendered snapshot / DOM inspection) that node references of every type render identically colored (primary teal) in both light and dark mode after the fix
Architecture Impact
No prior ADR governs node-type color assignment — searched ../nodespace-docs/decisions/, architecture/, and components/ for related terms and found nothing on point. The governing spec is ../nodespace-docs/DESIGN.md's existing single-accent rule, which this issue brings the code into compliance with; it does not change or reverse anything in nodespace-docs.
Acceptance Criteria
- The override block in
packages/desktop-app/src/lib/design/components/base-node-viewer.svelte(lines 1510-1515, "Subtle Tint System (Scheme 3)") is deleted -
packages/desktop-app/src/lib/styles/noderef.cssno longer defines its own values for--node-user,--node-date,--node-document, or any other--node-*variable — it either removes these declarations entirely (falling through toapp.css) or explicitly referencesvar(--primary)/ the existingapp.cssnode variables - Any hardcoded per-document-type hex accent colors in
noderef.css(#dc2626,#7c3aed,#ea580c,#0891b2) are removed in favor of the single shared node accent variable -
packages/desktop-app/src/app.cssremains the single source of truth for all--node-*variables — grep confirms no other file inpackages/desktop-app/srcredefines them - All node types (text, task, ai-chat, entity, query, user, date, document) render with the same primary-teal accent color in both light and dark mode, verified across at least: the node tree, a node-reference pill (wherever
noderef.cssstyles apply), and the base node viewer - No new Stylelint violations introduced (once Add Stylelint enforcement for design tokens, shadows, and transitions in Svelte components #2589 lands) for this file
- Code passes
bun run quality:fix - Tests pass (
bun run test:all)
Technical Specifications
Reference Files
- Correct definition (source of truth):
packages/desktop-app/src/app.css - Dead experiment to delete:
packages/desktop-app/src/lib/design/components/base-node-viewer.sveltelines 1510-1515 - Off-spec per-type scheme to fix:
packages/desktop-app/src/lib/styles/noderef.csslines 22-24 (and hardcoded hex accents elsewhere in the same file) - Global import making noderef.css live in production:
packages/desktop-app/src/routes/+layout.svelteline 4 - Design spec:
../nodespace-docs/DESIGN.md— "all node types map to primary... all types share a single accent intentionally"
Implementation Details
- Do not introduce a fourth color scheme — the fix is to delete two of the three definitions and let
app.css's existing correct one apply everywhere via normal CSS cascade/variable resolution - Check for any JS/TS logic that branches on node type to pick a color (as opposed to pure CSS variable usage) — if found, that logic should also be simplified to not vary by type, consistent with the "don't add a new node type color" rule
Dependencies
- Add Stylelint enforcement for design tokens, shadows, and transitions in Svelte components #2589 (Stylelint enforcement — not a hard blocker for starting this fix, but the enforcement issue is what prevents this exact bug from recurring; land or at least validate against it if available)
Related Issues
- Add Stylelint enforcement for design tokens, shadows, and transitions in Svelte components #2589 (CSS lint enforcement, sequenced to catch regressions of this fix)
Activity
malibio commentedon Sep 16, 2026
Baseline (worktree issue-2590-node-accent-colors): Frontend: 246 test files passed, 5078 tests passed.