Skip to content

Unify node-type accent colors to a single primary-based system #2590

Closed

Description

@malibio

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:

  1. 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)
  2. 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-query to a blue-gray 200 40% 45%. This was never cleaned up after the experiment concluded.
  3. 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 in packages/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/#0891b2 document-type accents noted in the related hardcoded-colors issue) with references to the single --primary-derived node-type variables already correctly defined in app.css
  • After the fix, app.css should be the only place any of --node-text, --node-task, --node-ai-chat, --node-entity, --node-query, --node-user, --node-date, --node-document are defined; every other file should only consume them via var(--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.css no 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 to app.css) or explicitly references var(--primary) / the existing app.css node 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.css remains the single source of truth for all --node-* variables — grep confirms no other file in packages/desktop-app/src redefines 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.css styles 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.svelte lines 1510-1515
  • Off-spec per-type scheme to fix: packages/desktop-app/src/lib/styles/noderef.css lines 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.svelte line 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

Related Issues

Activity

  1. malibio commented on Sep 16, 2026

    @malibio
    CollaboratorAuthor

    Baseline (worktree issue-2590-node-accent-colors): Frontend: 246 test files passed, 5078 tests passed.

  2. self-assigned this
    on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions