Skip to content

Prune unauthorized CSS transitions/animations back to the two DESIGN.md-approved exceptions - #2719

Merged
mstomar125 merged 1 commit into
mainfrom
issue-2594-css-transition-prune
Sep 17, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-2594-css-transition-prune

Conversation

@mstomar125

@mstomar125 mstomar125 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

../nodespace-docs/DESIGN.md and app.css's global transition: none !important base rule establish exactly two sanctioned motion exceptions: the sidebar-width collapse (0.25s ease-out) and the code-block hover-button opacity fade (0.2s ease). A fresh repo-wide grep at implementation time (transition:/transition-/animation:/animation-/@keyframes across packages/desktop-app/src/**/*.svelte and **/*.css) found 33 files with declarations overriding that base rule — matching the audit's file count from #2594.

What changed

  • Removed ~99 unauthorized transition/animation/@keyframes declarations across 32 files, reviewed per-instance (not blanket deletion).
  • navigation-sidebar.svelte: removed all 8 of its own transitions. None of them was the sidebar-width exception — that lives entirely in app.css; the component even has a comment confirming this (/* Sidebar transition animation configured in app.css */).
  • theme-provider.svelte: removed the runtime-injected <style> block that put a global transition: color/background-color/border-color/box-shadow on * (keyed off a configurable transitionDuration prop, default 300ms), the enableTransitions/transitionDuration props themselves, and the component's own .theme-provider transition. Confirmed this was not implementing either sanctioned exception — it was a page-wide theme-change fade.
  • noderef.css (post-Rework diagnostic-panel dark IDE theme and remaining noderef.css literals onto design tokens #2593, pulled fresh main first): removed @keyframes pulse, @keyframes shimmer, the translateY(-1px) hover-lift (and its now-vestigial :active reset), the deleted-node tooltip fade, the --transition-fast/-medium/-slow tokens (now fully unused — their only other consumer, node-ref-preview.svelte's opacity fade, is also removed), and the resulting dead prefers-reduced-motion block.
  • Several viewers/dropdowns lose loading-spinner (@keyframes spin) and typing-indicator (@keyframes typing-bounce) animations (model-manager.svelte, ai-chat-node-viewer.svelte, ai-chat-pty-session.svelte, node-autocomplete.svelte, slash-command-dropdown.svelte). DESIGN.md names exactly two exceptions and carves out no spinner exception ("everything else has transitions disabled globally"), so these are pruned too.
  • A handful of "reveal-on-hover" buttons across the node components (task-open-button, query-open-button, custom-entity-open-button) had comments claiming they "match the code block pattern" — they use the same visual idiom but are distinct selectors, not the actual code-block buttons, so their transitions are removed too.

A real drift found via live verification (fixed)

Per the issue's instruction to confirm the code-block hover-button fade's actual live behavior rather than assume it from source: I verified it with Playwright + getComputedStyle, moving the mouse away first and sampling mid-transition.

Before this PR, the fade's selector/duration/easing in source matched DESIGN.md exactly (opacity 0.2s ease on .code-language-button/.code-copy-button, in both app.css and code-block-node.svelte's :global() duplicate), but unlike the sidebar's exception, it had no !important. CSS resolves importance before specificity: an !important declaration always beats a non-!important one on the same property, regardless of selector specificity. So the base rule's * { transition: none !important; } was winning outright against the code-block rule's plain (non-!important) transition: opacity 0.2s ease;, the same way it wins against every other non-!important transition removed in this PR. The sidebar's exception survives today only because it was already written with !important. Measuring mid-hover confirmed the code-block button's fade was dead: opacity jumped straight from 0 to 1 with no interpolation (transitionDuration: 0s on both buttons before the fix). The button still showed/hid correctly on hover — a separate, un-transitioned rule sets the opacity value on :hover — only the animation was silently inert.

Added !important to both buttons' transition declaration in both locations, matching the sidebar's existing precedent exactly. Re-verified: opacity is ~0.41 at 50ms into the 0.2s fade — it now genuinely animates.

Deliberately out of scope

Tailwind transition-* utility classes embedded in class="..." attributes (e.g. transition-colors, transition-transform duration-200) across lib/components/ui/* (shadcn/ui vendored primitives: tabs-trigger, accordion-trigger, table-row, dialog-content, switch, sheet-content, breadcrumb-link) and a few schema-form components (add-synced-database-dialog.svelte, person-schema-form.svelte, nested-field-editor.svelte, typed-form-shell.svelte, nested-field-trigger.svelte) are not touched. These are: (a) already neutralized by the same transition: none !important base rule (same mechanism confirmed above for pruned declarations), (b) not part of the audited 33-file list — #2594's own file count only matches a grep for literal CSS property declarations, not Tailwind class-name substrings, and (c) a much larger, separate surface (the shadcn/ui primitive layer) that deserves its own reviewed change rather than folding into this audit.

Flagged, not fixed

header-node.svelte's H1 (2rem)/H2 (1.5rem) font-size setup contradicts DESIGN.md's stated intent ("headings use icon badges, not font-size variation... nothing above 1.5rem in main content"). Per the issue's explicit instruction, this is not touched here — DESIGN.md may be stale/aspirational on this point rather than the code being wrong. Filed #2717 to track the decision (update DESIGN.md vs. change the component).

Verification

  • Fresh repo-wide grep after all changes: only the base rule + the two approved exceptions remain (app.css lines 266-276, 693, 717; code-block-node.svelte lines 503, 570).
  • Live-verified both exceptions with Playwright + getComputedStyle against the real running app (isolated NODESPACE_HOME, not the real database):
    • Sidebar: transition-property: width, transition-duration: 0.25s, ease-out; clicking the hamburger actually changes computed width 240px → 52px → 240px.
    • Code block: transition-property: opacity, transition-duration: 0.2s; opacity measured mid-fade (~0.41 at 50ms) confirms real interpolation, not an instant snap.
    • Spot-checked a pruned declaration (.nav-item) now reads transitionDuration: 0s, transitionProperty: none — confirms the global disable applies cleanly with no stray override.
  • bun run quality:fix clean (eslint, tsc, svelte-check: 0 errors/0 warnings, design-tokens baseline updated — 84 fewer hardcoded-value violations as a side effect of removing the pruned durations/easings, ratchet re-recorded from 134→50), cargo fmt/clippy -D warnings clean.
  • bun run test: 249 files / 5134 tests, unchanged from baseline.
  • Pre-push gate (test:all + Rust integration + e2e): all green.

Follow-up filed

#2717 — H1/H2 font-size vs. DESIGN.md decision (flag only, no code change).

Closes #2594.

🤖 Generated with Claude Code

…d exceptions (closes #2594)

Removes ~99 component-level transition/animation/@Keyframes declarations
across 32 files that silently overrode app.css's global `transition: none
!important` base rule. All were already visually inert in the running app
(the global rule's `!important` wins the cascade regardless), so this is a
dead-code removal with no behavior change for the pruned declarations.

navigation-sidebar.svelte drops all 8 of its own transitions - none of them
was the sidebar-width exception, which lives entirely in app.css. theme-
provider.svelte drops its runtime-injected global transition stylesheet
(color/background/border/box-shadow on `*`, keyed off a configurable
`transitionDuration` prop) and the prop itself, plus its own component-level
transition. noderef.css drops `@keyframes pulse`/`shimmer`, the
translateY(-1px) hover-lift (and its :active reset), the tooltip fade, the
now-unused `--transition-fast/medium/slow` tokens, and the resulting dead
`prefers-reduced-motion` block. Several files also lose loading-spinner
`@keyframes spin` and typing-indicator `@keyframes typing-bounce` -
DESIGN.md names exactly two exceptions and carves out no spinner exception;
these were already frozen by the global `animation-duration: 0s
!important`, so removal doesn't change what users see today.

Fixes a real drift found via live verification: the code-block hover-button
fade (`.code-language-button`/`.code-copy-button`, in both app.css and
code-block-node.svelte's `:global()` duplicate) matched the 0.2s ease spec
in source but had no `!important`, so the same base rule that was supposed
to spare it was silently winning by specificity and the fade was an instant
opacity snap, not an animation. Added `!important` to match the sidebar
exception's existing pattern - confirmed via computed-style checks
mid-transition (opacity ~0.41 at 50ms into the 0.2s fade) that it now
animates for real.

Out of scope, deliberately untouched: Tailwind `transition-*` utility
classes in `class="..."` attributes (shadcn/ui primitives under
lib/components/ui/* and a handful of schema-form components) - these are
already neutralized by the same global override, weren't part of the
audited file list, and pruning them is a much larger, separate surface.
header-node.svelte's H1/H2 font-size (contradicts DESIGN.md's icon-badge
hierarchy) is flagged only, per the issue's explicit instruction not to fix
it here - tracked in #2717.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

@mstomar125 mstomar125 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verdict: APPROVE

Independent re-verification of every claim in the PR description — grep, diff hunks, DESIGN.md wording, an existing independent stylelint gate, and a live Playwright run against the real app (fresh isolated daemon+frontend, not the description's own testing). I found no unauthorized declarations left behind, no legitimate exception incorrectly removed, and the live behavior matches what's claimed. Details below, including one real snag I hit in my own verification process (not a PR bug) and a minor description wording nit.

1. Repo-wide grep (verified myself)

grep -rnE '(transition(-[a-z]+)?|animation(-[a-z]+)?)\s*:' packages/desktop-app/src --include='*.svelte' --include='*.css'
grep -rn '@keyframes' packages/desktop-app/src --include='*.svelte' --include='*.css'

Only 9 matches total, exactly the claimed set, all !important:

  • app.css:266-268 — global base disable (transition: none, animation-duration: 0s, animation-delay: 0s)
  • app.css:275-276 — sidebar exception (width 0.25s ease-out, animation-duration: 0.25s)
  • app.css:693 and app.css:717 — code-block fade exception, both opacity 0.2s ease !important
  • code-block-node.svelte:503 and :570 — same, !important, kept in sync with app.css

Zero @keyframes anywhere. Matches the PR's claim exactly, including line numbers.

2. Independent tool corroboration (stronger than my own grep)

This repo already has a stylelint rule (declaration-property-value-allowed-list/at-rule-disallowed-list in packages/desktop-app/stylelint.config.js) plus a ratchet baseline (design-tokens-baseline.json, scripts/check-design-tokens.ts) that specifically encodes "only these two exceptions are authorized" as a machine-checked rule, independent of this PR's author. I ran it myself read-only:

$ bun run --cwd packages/desktop-app quality:design-tokens
✓ No new design-token violations (50 known, tracked in baseline)

origin/main's baseline had 134 recorded violations; the PR's baseline has 50, and none of the removed 84 are transition/animation/keyframes-related mismatches — I confirmed by diffing the baseline JSON directly, and none of the remaining 50 entries are transition/animation rules. The ratchet mechanism (scripts/check-design-tokens.ts) fails loudly if the baseline contains stale (no-longer-occurring) entries, so a clean pass here is meaningful independent confirmation, not just self-reported.

bunx eslint 'src/**/*.{ts,svelte}' (from packages/desktop-app) — clean, zero warnings.

3. Diff hunk spot-checks (9 files read directly via git diff origin/main...HEAD)

  • navigation-sidebar.svelte — all 8 removed transitions are on nav-item hover states (background-color, color, chevron transform, label opacity); none is the sidebar-width rule, which correctly lives only in app.css. Confirmed the file's own comment (/* Sidebar transition animation configured in app.css */) is preserved.
  • theme-provider.svelte — removed enableTransitions/transitionDuration props, the onMount-injected <style id="nodespace-theme-transitions"> global * transition, its cleanup on destroy, and the component's own .theme-provider transition. Grepped all usages: ThemeProvider has exactly one call site (app-shell.svelte), with no props passed — removing the defaulted-true props is a safe, non-breaking removal.
  • noderef.css — removed @keyframes pulse/shimmer, translateY(-1px) hover-lift + :active reset, tooltip fade, --transition-fast/-medium/-slow tokens, and the now-dead prefers-reduced-motion block. Diff applies cleanly against the post-#2593 base as claimed.
  • code-block-node.svelte — both transition: opacity 0.2s ease; → transition: opacity 0.2s ease !important;, exactly matching the two app.css fixes.
  • model-manager.svelte, node-autocomplete.svelte — @keyframes spin/.spinning and a standalone @keyframes spin block removed. Confirmed via the CSS cascade that these were already dead before removal: the base rule's animation-duration: 0s !important on * always wins over a non-!important animation: spin 1s linear infinite regardless of the component selector's specificity (important beats non-important independent of specificity). So this is inert-code cleanup, not a behavior change — consistent with the "everything else already has transitions disabled globally" framing.
  • task-node.svelte / query-node.svelte — .task-open-button/.query-open-button transitions removed along with their "matches code block pattern" comments. Confirmed these are genuinely distinct selectors from .code-language-button/.code-copy-button, not the sanctioned exception under another name.
  • autocomplete-modal.svelte — caught and removed an inline style="animation: modalSlideIn ..." / overlayFadeIn attribute plus both @keyframes blocks. Worth calling out: this is an inline-style occurrence my own regex-based grep (property-syntax only) wouldn't have caught either — good sign the sweep wasn't purely regex-driven.
  • backlinks-panel.svelte — one transition: opacity 0.2s; line removed, correctly.

No case where I'd argue a removed declaration was actually a legitimate third exception.

4. DESIGN.md cross-check (read myself, ../nodespace-docs/DESIGN.md, fetched fresh origin/main)

Line 370, Do's and Don'ts: "Don't introduce new motion — the only intentional animation is the sidebar width transition and the code block button fade; everything else has transitions disabled globally." This directly confirms no spinner/typing-indicator exception exists — the spinner/indicator removals are correctly in scope.

5. Live verification — Playwright against the real running app

Used the worktree's run-app skill recipe (isolated NODESPACE_HOME under scratch, short socket at /tmp/nsd/d.sock, NODESPACED_HEADLESS=1).

Sidebar — getComputedStyle('.navigation-sidebar.sidebar'): transitionProperty: width, transitionDuration: 0.25s, transitionTimingFunction: ease-out. Clicking .hamburger-button: width 240px → (sampled mid-transition) 148.156px → 52px collapsed → 240px on re-expand. Genuine interpolation confirmed.

Code block — created via ``` + Shift+Enter into an empty node's textarea. Pre-hover: .code-copy-button computed transitionProperty: opacity, transitionDuration: 0.2s (confirms the !important fix is live, unconditionally, not just during :hover). Moved mouse away, then hovered and sampled opacity via requestAnimationFrame at sub-frame resolution: 0 → 0.41 (44ms) → 0.71 (76ms) → 0.80 (104ms) → 0.96 (153ms) → 1.0 (~250ms). That's a genuine, smooth interpolation on an ease curve completing around 190-200ms — not an instant snap. My independently-measured ~0.41 at ~44-50ms matches the PR description's own claimed "~0.41 at 50ms" almost exactly, which is good corroboration this is a real, reproducible measurement and not a cherry-picked one-off.

A snag in my own verification (not a PR defect, flagging for transparency): my first live-verification attempt hit stale CSS with no !important and a still-present theme-provider-injected <style> tag — which initially looked like the fix wasn't real. Root cause: my second bun run dev:browser launch silently failed with EADDRINUSE (ports 3001/5173 were already held by a leftover dev-proxy/Vite/nodespaced trio running against the primary checkout, not this worktree — apparently orphaned from earlier in this same agent session), so I was unknowingly testing an old build. I verified the leftover daemon was still safely scoped to my own isolated NODESPACE_HOME (real ~/.nodespace/database/nodespace.db mtime never changed throughout), killed the stale trio, freed the ports, confirmed a clean bind this time, and re-ran — producing the clean results above. Mentioning this so the numbers above are understood as coming from a verified-fresh server, and because it's a good reminder to check for EADDRINUSE/stale servers before trusting a "started" background command.

Cleanup: killed all daemon/dev-proxy/vite processes I started, removed /tmp/nsd, removed the throwaway verify-2719.mjs/verify-2719b.mjs/debug-initial.png scratch files (git status --short in the worktree is clean), and confirmed ~/.nodespace/database/nodespace.db mtime is untouched by my session (still 15 Sep 08:19, from before this review).

6. Scope / description accuracy

  • git diff --stat origin/main...HEAD -- . ':!packages/desktop-app/src' ':!packages/desktop-app/design-tokens-baseline.json' — empty. Nothing touched outside the audited CSS/Svelte files plus the expected baseline-file shrink.
  • header-node.svelte — confirmed untouched (git diff --stat for that file is empty).
  • Issue #2717 exists, is OPEN, and accurately describes the H1 (2rem)/H2 (1.5rem) vs. DESIGN.md icon-badge/1.5rem-ceiling contradiction, correctly scoped as decision-only with "no code change is implied until the decision is made."
  • "Deliberately out of scope" section (Tailwind transition-* utility classes in shadcn/ui primitives and schema-form components): spot-checked — tabs-trigger.svelte, table-row.svelte, switch.svelte, breadcrumb-link.svelte, dialog-content.svelte, accordion-trigger.svelte, sheet-content.svelte, person-schema-form.svelte, nested-field-editor.svelte, etc. all still carry transition-* Tailwind classes, confirmed genuinely untouched. The claim that these are already neutralized by the base !important rule is correct: a shorthand transition: none !important on * resets all four transition longhands (including transition-property) with !important, which always beats a non-!important Tailwind utility declaration regardless of specificity — same mechanism verified for the .spinning/@keyframes spin cases above.

Minor (Suggestion, non-blocking)

The PR description's mid-explanation of why the code-block fade previously lost the cascade battle is a bit muddled — it says "the wildcard rule... wins by universal application" mid-sentence before self-correcting. The final stated conclusion (a non-!important declaration always loses to an !important one regardless of specificity) is correct and matches what I independently verified via the CSS cascade and live measurement; this is purely a clarity nit in prose, not in the code.

Summary

Grep, an independent pre-existing stylelint gate, direct diff review across 9 files, DESIGN.md's actual wording, and live Playwright measurements against a genuinely fresh build all agree: exactly the two sanctioned exceptions remain, both now correctly !important, both demonstrably live and interpolating in the real running app, nothing out-of-scope was touched, and the two follow-up claims (issue #2717, header-node.svelte untouched) check out. No changes requested.

@mstomar125
mstomar125 merged commit 12dfc2d into main Sep 17, 2026
@mstomar125
mstomar125 deleted the issue-2594-css-transition-prune branch September 17, 2026 10:32
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.

Prune unauthorized CSS transitions and animations back to the two DESIGN.md-approved exceptions

1 participant