Skip to content

Replace hardcoded shadows and colors in modal/toast/banner components with design tokens #2591

Closed

Description

@malibio

Overview

../nodespace-docs/DESIGN.md specifies modals use "a backdrop overlay at low opacity; no drop shadow on the panel itself," and that all colors come from the CSS variable token system defined in packages/desktop-app/src/app.css. An audit found several modal/toast/banner components with hand-picked custom box-shadow values (violating the no-shadow rule) and, in at least one case, an entirely separate hardcoded color palette unrelated to the token system.

Problem Statement

Forbidden shadows (DESIGN.md: "no drop shadow on the panel itself"):

  • delete-confirmation-modal.svelte — box-shadow: 0 8px 32px rgba(0,0,0,0.4)
  • subtree-access-denied-modal.svelte — same 0 8px 32px rgba(0,0,0,0.4)
  • version-conflict-modal.svelte — custom shadow
  • first-pro-consent-modal.svelte — 0 4px 16px rgba(...)
  • first-pro-consent-slot.svelte — 0 4px 16px rgba(...)
  • pro-relogin-modal.svelte — 0 4px 16px rgba(...)
  • update-banner.svelte — custom shadow
  • conflict-toast.svelte — custom shadow

Only base-node.svelte's date-picker popover currently uses the one shadow value DESIGN.md actually sanctions for floating surfaces: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1). Popovers/dropdowns are a different surface type than modals in DESIGN.md's model — modals get no shadow at all (they're already visually separated by the backdrop overlay), so the fix for modals is to remove the shadow entirely, not to swap in the popover's value.

Hardcoded color palette:

  • version-conflict-modal.svelte uses an entirely unrelated Material-Design-style palette hardcoded inline: #d32f2f, #4caf50, #1976d2, #e8f5e9, #f5f5f5, #ddd, #666 — none of these map to any token in app.css and several duplicate the intent of existing tokens (e.g. #d32f2f/destructive red, #4caf50/success green, #1976d2/primary-ish blue) under completely different hues than the app's actual palette.

Proposed Solution

  • Remove the box-shadow declarations from all listed modal panels — per DESIGN.md, the backdrop overlay alone provides the visual separation; add no replacement shadow
  • For update-banner.svelte and conflict-toast.svelte (non-modal floating surfaces), check DESIGN.md's rules for toast/banner-class components specifically — if they fall under the same "backdrop-separated, no shadow" rule use the same fix; if DESIGN.md has separate guidance for toasts/banners, follow that guidance's specified shadow value instead of the modal panel rule
  • Replace every hardcoded literal in version-conflict-modal.svelte with the corresponding token from app.css (e.g. #d32f2f → var(--destructive), #4caf50 → var(--success), #1976d2 → var(--primary) or var(--info-light) as appropriate to context, #e8f5e9/#f5f5f5/#ddd → the corresponding --muted/--border/--secondary tokens, #666 → --muted-foreground) — check each usage's actual semantic intent (error, success, informational, structural) rather than picking the nearest hex match

Acceptance Criteria

  • No box-shadow declaration remains on the modal panel itself in delete-confirmation-modal.svelte, subtree-access-denied-modal.svelte, version-conflict-modal.svelte, first-pro-consent-modal.svelte, first-pro-consent-slot.svelte, pro-relogin-modal.svelte
  • update-banner.svelte and conflict-toast.svelte shadows are resolved consistent with whatever DESIGN.md specifies for their component class (documented in the PR which rule was applied and why)
  • version-conflict-modal.svelte contains zero hardcoded hex/rgba color literals — every color reference uses var(--token) from app.css
  • Visual behavior is otherwise unchanged (backdrop opacity, layout, spacing not altered by this issue)
  • No new Stylelint violations for these files once Add Stylelint enforcement for design tokens, shadows, and transitions in Svelte components #2589 lands (or, if this issue lands first, running the new linter against these files afterward shows zero violations)
  • Code passes bun run quality:fix
  • Tests pass (bun run test:all)

Technical Specifications

Reference Files

  • Token source of truth: packages/desktop-app/src/app.css
  • Design spec: ../nodespace-docs/DESIGN.md — modal/backdrop/shadow rules
  • Correct shadow precedent (popover, not modal): packages/desktop-app/src/lib/design/components/base-node.svelte (date-picker popover) — 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)
  • Files to fix: delete-confirmation-modal.svelte, subtree-access-denied-modal.svelte, version-conflict-modal.svelte, first-pro-consent-modal.svelte, first-pro-consent-slot.svelte, pro-relogin-modal.svelte, update-banner.svelte, conflict-toast.svelte (exact paths under packages/desktop-app/src — locate via find packages/desktop-app/src -iname "<filename>")

Dependencies

Related Issues

Activity

  1. malibio commented on Sep 16, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 246 test files passed, 5078 tests passed (0 failures).

  2. self-assigned this
    on Sep 16, 2026
  3. malibio commented on Sep 16, 2026

    @malibio
    CollaboratorAuthor

    Scope note — version-conflict-modal.svelte no longer exists.

    The file named in the Problem Statement as the holder of the hardcoded Material-Design palette (#d32f2f, #4caf50, #1976d2, …) was deleted in #2602 ("Delete 4 orphaned frontend components") as an unused component. Confirmed: none of those hex literals appear anywhere in the codebase today.

    That makes two acceptance criteria moot:

    • version-conflict-modal.svelte shadow removal
    • version-conflict-modal.svelte contains zero hardcoded hex/rgba color literals

    The remaining 7 files are exactly as described, and the Stylelint gate from #2589 independently confirmed all 7 shadows.

    Scope expanded (agreed with maintainer): 4 of the 7 files referenced a --color-* variable vocabulary (--color-surface, --color-text-primary, --color-border, --color-accent, …) that app.css defines nowhere — so every reference silently resolved to its hardcoded fallback, and those fallbacks are dark-only values. These components rendered dark chrome in light mode regardless of theme. Same defect class as #2592, but on a disjoint set of files (no overlap).

    DESIGN.md ruling for the toast/banner question: the Toast section specifies z-index only, and the Do's/Don'ts scope shadows to popovers and dropdowns. So conflict-toast and update-banner get the same no-shadow treatment as the modal panels.

    Deliberately out of scope (remain in the gate baseline):

    • Backdrop rgba(0, 0, 0, 0.5) on 4 modals — consistent app-wide convention; issue scopes backdrop opacity out
    • conflict-toast @keyframes/animation — pre-existing DESIGN.md motion violation, unrelated

    Design-token baseline ratchets 251 → 201.

  4. added a commit that references this issue on Sep 16, 2026
    36c4e8f
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