Repository navigation
feat(theme): derive custom dark palette surfaces from their own colour - #15893
mariana953 wants to merge 96 commits into
Conversation
Extend the charcoal scale with two darker steps (charcoal-900 #111111, charcoal-950 #09090a) for deeper dark-theme surfaces.
Add semantic tokens for the tab treatment and region strokes, defined per theme (:root derives from each palette's comfy_base vars; .dark-theme uses the tuned charcoal values): - --workflow-tab-divider / -selected-surface / -hover-surface - --region-stroke, --sidebar-surface, --base-background-sunken Restyle the workflow tabs to use them: filled selected tab (not an underline), hover state, right-edge dividers only, close button shown on hover only, and no stray border on the first tab. Unsaved-dot loses its mismatched background.
Drop the borders and shadows on the manage-extensions pill, run actionbar, sidebar and topbar so they read as flat surfaces divided by strokes; match their height and padding to the workflow tabs; make the Share button icon-only; and tighten the bottom canvas toolbar padding. Sidebar right and topbar bottom borders use the theme-aware --region-stroke token; the connected sidebar uses --sidebar-surface.
Give every built-in palette the same subtle dot-grid canvas background: a white dot for the dark palettes (dark/arc/nord/github) and a black dot for light, at low opacity, so the canvas texture is aligned across themes while adapting to each background. The dark palette's canvas also moves to charcoal-950 (#09090A).
The .dark-theme class is applied to every dark palette (solarized, arc, nord, github), so hardcoding charcoal there leaked the default dark colors into all of them. Tag the root with data-color-palette and move the tuned charcoal (sidebar/selected/hover surfaces, sunken) under :root[data-color-palette='dark'] only; other palettes fall back to deriving from their own comfy_base vars (--bg-color/--content-hover-bg), so the sidebar and selected tab share the canvas base level per theme.
Scope the light palette (data-color-palette='light') to the DS light values instead of derived guesses: sidebar and selected tab = smoke-200 (base/background), tab hover = smoke-400 (workflow tab background-hovered), divider = smoke-400, region stroke = smoke-300.
- Remove the now-unused actionbar.share i18n key (Share button is icon-only; the tooltip key stays) - Consume charcoal-950 via the --base-background-sunken token: the app body backdrop uses it in the default dark palette, matching the sunken canvas (no more dead token) - Add a behavioral test that the active tab still closes (its close button is now hover-revealed instead of shown while selected)
The DS light sidebar value (smoke-200) read too grey in-app; nudge the sidebar surface one step lighter to near-white while keeping the selected tab at smoke-200 so it stays distinct from the white tab bar.
Replace the dot-grid BACKGROUND_IMAGE with a thin line grid (white on dark palettes, black on light) while keeping the current canvas colors (charcoal-950 on dark).
Reduce --workflow-tabs-height from 38px to 34px so the workflow tab bar and the topbar action pills hug their 32px controls (Run button, icon buttons) instead of leaving ~3px of vertical slack. Tabs and the run block now read at the same visual height.
Raise the line-grid stroke-opacity baked into each palette's BACKGROUND_IMAGE (dark/arc/nord/github 0.07 -> 0.10, light 0.08 -> 0.12). Only lifts the base pattern opacity; litegraph's zoom_modify_alpha ramp is untouched, so the grid stays subtle at default zoom and gets more visible as you zoom in.
Halve the rendered opacity of the sidebar/topbar region strokes and the workflow tab dividers: the derived tokens drop from 50% to 25% of each palette's --border-color, and the light palette's smoke values gain a 50% mix. Each theme keeps its own colour logic, only the weight changes.
Revert the padding tweaks on the top menu section: root pt-2 back to pt-1, and the extensions pill and actionbar container back to px-2. The bar keeps its aligned height, borderless chrome and icon-only share button; only the spacing returns to what main had.
litegraph only repaints its clear colour below 1.5x zoom; above that the canvas is left transparent and the body shows through. The backdrop was reading --base-background-sunken, which only the default dark palette defines, so light and the custom palettes fell back to transparent and rendered black once zoomed in. Fall back to each palette's own --bg-color so every theme keeps its canvas colour at any zoom level.
The run actionbar and the extensions pill were pinned to a fixed --workflow-tabs-height with no vertical padding, so their 32px controls sat flush against the pill edges. Drop the fixed height and give both py-1, matching the graph mode pill which wraps its own 32px button in p-1. All three now render as 40px pills with 4px of breathing room.
The subgraph breadcrumb wraps the graph mode pill in -mt-3 + pt-4, a net 4px offset that left the actions column sitting 4px higher than it. Pad the actions column by the same amount so the graph pill, the extensions pill and the run actionbar share one baseline: all three now render at the same top, bottom and height.
Arc's canvas was lighter than its own menu surface, inverting the depth the dark palette establishes and leaving nodes flat against the background. Drop it to the same lightness offset dark uses between menu and canvas, measured in OKLCH so arc keeps its own hue and chroma. bg-color moves with it: litegraph stops repainting its clear colour above 1.5x zoom and the body backdrop falls back to --bg-color, so the two have to agree or the background jumps when zoomed in.
Dark stacks three levels: canvas (charcoal-950) below sidebar and selected tab (charcoal-900) below the menu and tab bar (charcoal-800). Custom palettes only aliased the sidebar to --bg-color, which is their canvas colour, so the sidebar dissolved into the canvas and the depth disappeared. Express each level as a lightness offset from the palette's own menu colour and replay it in OKLCH, which keeps the offsets perceptually even while preserving each palette's hue and chroma. --base-background-sunken is derived the same way, so the body backdrop tracks the canvas in every theme rather than falling back to --bg-color. Canvas colours in arc/nord/github are retuned to that offset, and solarized gains the CLEAR_BACKGROUND_COLOR it never had (it was inheriting whatever the previous palette left on the canvas). arc's bg-color returns to its original value, no longer needing to track the canvas for the backdrop.
Per review: fully desaturated #111111 looked out of place next to the rest of the scale. Bumps to #111112 so it carries the faint cool cast the other charcoal steps share, with no perceptible change in value.
Per review: the 24px grid tile no longer lined up with shift-snapping. Nodes snap to CANVAS_GRID_SIZE (10), so a 24px tile drifts off the snap lattice. Back to a 10px tile — every snap point lands on a grid line again, matching the original grid's spacing while keeping the flat line style over the themed canvas.
Per review: the rationale comments on the palette-derived surfaces read as noise in the stylesheet. The reasoning lives in the PR description instead. No behavioural change.
The topbar buttons, node bodies, panels and other surfaces built with the new design-system tokens were still charcoal in solarized/arc/nord/github, reading as neutral grey over a themed canvas. .dark-theme applies to every non-light palette, so those hardcoded charcoal values leaked in. Derive them from each palette's own menu colour with the same OKLCH lightness offsets already used for the sidebar and tabs, scoped away from dark/light so both keep their exact values. Custom themes now render their chrome in their own hue instead of grey.
The merge from main set the run actionbar wrapper to py-1.75, leaving it 6px taller than the extensions pill and the graph mode pill. Back to py-1 so all three topbar pills share the same 40px height again.
Fixes the indentation of the custom-palette selector so oxfmt --check passes; the earlier commits landed without the formatter run.
The imagePastePriority e2e only passed on main because the 38px workflow tab bar swallowed the fixture's title clicks at y=35, so the test never selected or copied anything. The compact 34px tab bar in this branch lets those clicks through, and the test then exposes a real gap in usePaste: with a media node selected and no media in the clipboard, the handler fell through to canvas.pasteFromClipboard() and pasted the previously copied node. Guard that fallback behind the media-node check, matching the behavior the e2e specifies, and update the unit test that had codified the old fallthrough.
The previous guard skipped litegraph's default paste whenever a media node was selected, which broke duplicating a just-copied media node (errorsTabModeAware e2e). Narrow it: compare the clipboard's node metadata against litegraph's internal clipboard. Stale metadata (no match) pastes nothing while a media node is targeted; a fresh in-app copy still pastes. Covers both the imagePastePriority and errorsTabModeAware expectations, with unit tests for each case.
There was a problem hiding this comment.
Verdict: the P1 contrast blocker is fixed at 16a2f0a; four P2 items remain (stack on #19437 with a browser test, refresh the screenshots, one source for the rung assignments, invalid menu colour).
I reviewed the delta from 90e9011 to 16a2f0a. Seven of my eight inline findings from the previous review are addressed, and you answered each thread. I checked the new block in Chromium for solarized, arc, rgb(7 54 66 / 0.5), #000, #fff, the default dark palette and an invalid value:
--text-secondarynow sits above muted text on every palette (solarized L 0.810 against 0.769, arc 0.774 against 0.734), so both the contrast drop and the hierarchy inversion are gone.--button-iconfollows muted.- The rungs derive from the opaque
--surface-800; the translucent input still gives opaque surfaces. darkstill resolves to charcoal, and the shipped panel values are unchanged (solarized 0.376702, arc 0.341094).- oxfmt and stylelint pass on
style.cssat this head.
My earlier review is still recorded as "changes requested". Its blocker is fixed; the items below are P2 and P3.
Still open from the previous round (17)
- P2. One source for the rung assignments (thread). I agree the charcoal-100/500 tokens are a design call; I've split that out as question 1 below. The structural half isn't one. This block still restates 24 of
.dark-theme's "token X on charcoal N" assignments by hand, so any token later added to.dark-themeon a rung stays charcoal under custom palettes unless someone remembers this list. Declaring--surface-800/600/400/300/200: var(--color-charcoal-N)in.dark-themeand pointing those tokens at them leaves default dark pixel-identical (I compared that shape in Chromium last round, 0 differences), and this block shrinks to the five rungs plus the three foreground tokens and--modal-card-tag-background. Now that the rungs are named--surface-N, the.dark-themeside is a rename of values it already has. - P2. Stack on #19437 and add the browser test here. The base is still
main, so the block stays inert and untested. The test and reasoning from the previous review still apply; with this head the solarized and arc literals are unchanged. - P2. The screenshots predate the visible token changes. They still show the settings dialog from 2026-08-25, before 7a9ee71, 9e67c5d and now 16a2f0a (secondary text and button icons). Please recapture at this head and add the dropdown menu, a selected Vue node with its tooltip, the template cards, and the keybinding panel.
- P2. An invalid
comfy-menu-bgblanks every overridden token (github-actions finding, confirmed). At this headnotacolorstill makes the background tokensrgba(0, 0, 0, 0), and--text-secondaryand--button-iconare now in that set too. Onmainthey stay charcoal. ACSS.supports('color', ...)check inloadComfyColorPalette, as #19437 does for its clear colour, would cover every consumer. - P3. The dependency lives only in prose. The callout still lists #15884, a paste fix, and GitHub doesn't enforce the order.
- P3. "The resting editor chrome does not change here at all" is not accurate. The queue button group (
ComfyQueueButton.vue:3,bg-secondary-background) is always visible and uses overridden tokens. - P3. The "User-defined palettes" bullet is now further behind. It quotes
--palette-l: min(l, 0.35)and says every derived declaration ends in/ 1. At this head the clamp lives in--surface-800, only the base carries/ 1, and the rungs inherit opacity from it. - P3. "The default dark palette resolves to the same values it does today" is not true.
darkis excluded by the selector. The muted (+0.46) offset is tuned, and--text-secondary(+0.5008) is measured from smoke-700; the description should say which is which. - P3. The "Solarized gamut" bullet doesn't hold. Every solarized rung is inside sRGB.
- Nit (P3). "~25 semantic tokens": the block now sets 27 (24 aliases plus muted text, secondary text and button icons). The Legibility section could mention the two new foreground tokens.
- Nit (P3). "Dividers are untouched" while
--border-defaultand--border-subtlemove. - Nit (P3). The "Not covered" bullet's lead and explanation disagree.
- Nit (P3). The description doesn't follow the
.githubtemplate. - github-actions, selector never matches on
main: confirmed. Same fix as item 5. - github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
- github-actions, chroma not capped: confirmed for user palettes only.
- github-actions, partial override set: confirmed in part. The charcoal-100/500 part is question 1.
New this round (1)
- P3. Four commits are authored as
Claude <noreply@anthropic.com>: 7a9ee71, 9e67c5d, 90e9011 and 16a2f0a. AGENTS.md says never to mention Claude or AI in commits, and a squash merge turns those authors into aCo-authored-bytrailer onmain. I missed this last round. Re-authoring them before merge fixes it; the repository'sdisabling-ai-attributionskill covers the local settings.
Questions (3)
- Should the charcoal-100/500 tokens follow a tinted palette?
--muted-background,--accent-background,--component-node-widget-background-selected,--node-borderand--node-dividerstay neutral.ComfyHubThumbnailStep.vue:17mixes a tintedbg-node-component-surfacewith a neutraldata-[state=on]:bg-muted-background. - Which PR owns the clamp policy? #19437 still derives its sidebar and backdrop from the raw menu colour, with no clamp and no opacity pin.
- Should nested
.dark-themeelements (such asAgentConsentCard.vue:72) follow the palette? They still reset to charcoal.
Addressed this round
- P1 secondary text and button icon contrast: fixed in 16a2f0a (thread). Secondary text on the solarized selected rung is 3.81, against 4.14 on
main, which is close to main's ratio rather than a new regression. - P3
--surface-lbare channel variable, five repeated expressions: fixed (thread). - Nit
--palette-*namespace reuse and thebaserung name: fixed by the--surface-Nrename (thread). - Nit clamp comment: deleted (thread).
- P3 offset provenance: recorded above the rungs (thread).
- P3 two tokens without consumers: dropped (thread).
- Nit group ordering: sorted (thread).
- github-actions muted-text hierarchy and
--palette-lnaming: fixed by the same changes.
Coverage
- Delta 90e9011..16a2f0a (one file, +40/-47) reviewed in full; the open items were rechecked against this head and the unchanged description.
- Chromium check of the new block for seven menu colours, as listed above.
- CI at review time: 84 success, 13 skipped, 28 still running.
- No owner comments on the PR this round.
|
Round two from @mrseek-reviews, status at 84ca495:
Generated by Claude Code |
There was a problem hiding this comment.
Verdict: the rung refactor and the invalid-colour guard check out at 84ca495; two P2 items remain (stack on #19437 with the browser test, refresh the screenshots).
- One source for the rung assignments: addressed (thread). I compared the previous head and this one in Chromium. The check covered every custom property
.dark-themedeclares, the defaultdarkpalette, no attribute, solarized, arc, a translucent colour, #000 and #fff, at the root and inside a nested.dark-themeelement. All 102 existing tokens compute identically in all 14 cases. The only differences are the new--surface-*helpers themselves, which now exist in default dark and reset to charcoal inside nested islands, as intended. - Invalid
comfy-menu-bg: addressed. The block no longer goes transparent: with the value dropped, the modal panel resolves tooklch(0.396467 0 …), derived from the stylesheet default#353535. One inline note on where the fallback should come from. colorPaletteService.test.tspasses at this head. happy-dom'sCSS.supportsreturnstruefornotacolor, so the guard can only be exercised in the browser.
Still open (13)
- P2. Stack on #19437 and add the browser test here. The base is still
main. The test from my first review still applies, and the guard now gives it one more row: a palette spread from obsidian with'comfy-menu-bg': 'notacolor'should showoklch(0.396467 0.0000163737 23.7189)on the settings-dialognav(Chromium, this head's CSS) instead ofrgba(0, 0, 0, 0). That row fails if the guard is removed, and no lower level can see it. - P2. The screenshots predate the visible token changes. They are still the settings dialog from 2026-08-25. Please recapture at the current head and add the dropdown menu, a selected Vue node with its tooltip, the template cards, and the keybinding panel.
- P3. Commits authored as
Claude <noreply@anthropic.com>. 84ca495 is the fifth. A squash merge carries these intomainasCo-authored-bytrailers, against AGENTS.md. - P3. Description items 5 to 13 from my previous review. You said these wait until the base is settled. Two more are now out of date. "Each level is now expressed as a lightness offset" no longer describes where the assignments live:
.dark-themenow owns them through--surface-N, so this PR also edits the default theme block (pixel-identical). And "Every derived declaration also ends in/ 1" now applies to the base only. - github-actions, selector never matches on
main: confirmed. Item 1 resolves it. - github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
- github-actions, chroma not capped: confirmed for user palettes only.
- github-actions, partial override set: confirmed in part. The charcoal-100/500 part is question 1.
- github-actions, invalid
comfy-menu-bg: addressed for this block by the guard; see the inline note for--comfy-menu-secondary-bgand light palettes. - github-actions, hover/active equal rest: contested (unchanged; mirrors
.dark-theme). - Question: charcoal-100/500 tokens. Should they follow a tinted palette? Waiting on you.
- Question: clamp policy across #19437. #19437 still derives its sidebar and backdrop from the raw menu colour.
- Question: nested
.dark-themeelements. They reset to charcoal, now explicitly through the--surface-*redeclaration.
Coverage
- Delta 16a2f0a..84ca495:
style.css+33/-50 andcolorPaletteService.ts+4, read in full. - Chromium token comparison of the previous head against this one (1,498 values, all differences limited to the new helpers); Chromium check of the invalid-colour fallback;
vitest run src/services/colorPaletteService.test.ts(3 passed); a happy-domCSS.supportsprobe. - I could not run the custom-node code search for other uses of
--surface-800(the search service failed). PrimeVue uses thepprefix, so its variables don't collide. - No owner comments on the PR this round.
| if (key === 'comfy-menu-bg' && !CSS.supports('color', value)) { | ||
| rootStyle.removeProperty('--comfy-menu-bg') | ||
| continue | ||
| } |
There was a problem hiding this comment.
P3: The guard fixes the transparent surfaces. The fallback comes from the stylesheet, though, and that misses two cases:
- The default is
#353535, not the default dark palette's#171718. A dark palette with a bad menu colour renders a visibly lighter neutral ladder (base L 0.329) than default dark (0.205). A light palette with a bad value also falls back to#353535. - The secondary menu colour copies the bad value.
completePalette(colorPaletteStore.ts:66-72) copiescomfy-menu-bgintocomfy-menu-secondary-bgbefore this loop runs, and that key is still written unchecked. Every--comfy-menu-secondary-bgconsumer stays transparent. That part predates this PR.
Validating in completePalette instead covers both: replace an unsupported comfy-menu-bg with defaultPalette's value before the secondary-colour copy, and you get the light or dark default for free. Prose rather than a suggestion because the fix moves to colorPaletteStore.ts.
There was a problem hiding this comment.
Moved in ce8e416: completePalette now replaces an unsupported comfy-menu-bg with the matching default palette's value (#171718 dark, #FFFFFF light) before the secondary-colour copy, and the guard in loadComfyColorPalette is gone. Store and service tests pass; the browser test will exercise it once the base question is settled.
Generated by Claude Code
There was a problem hiding this comment.
Verdict: the fallback now uses the matching default palette at ce8e416, but completePalette rewrites the stored custom palette; two P2 items remain (stack on #19437 with the browser test, refresh the screenshots).
I reviewed 84ca495..ce8e416. Moving the check into completePalette fixes both cases from my last inline note (thread): an invalid comfy-menu-bg now becomes #171718 on dark palettes and #FFFFFF on light ones, and comfy-menu-secondary-bg is copied from the corrected value. colorPaletteService.test.ts passes at this head.
New this round (2)
- P3.
completePalettewrites the fallback into the stored palette (inline on lines 69-73). I confirmed it with a scratch store test that stubsCSS.supportstofalse: after readingcompletedActivePaletteonce, the object incustomPalettesholds#171718instead of the user's value. That write happens inside a computed, and theComfy.CustomColorPalettessetting shares the same object (GraphCanvas.vue:580). SoexportColorPaletteexports the substituted colour, and the nextpersistCustomColorPalettessaves it. - P3. The fallback can be unit-tested. happy-dom's
CSS.supportsreturnstruefor everything, butvi.stubGlobal('CSS', { supports: () => false })works; my probe above used it.colorPaletteStorehas no test file today. One table-driven test covers three wrong implementations the browser test would miss or only partly catch: the check placed after the secondary-colour copy (comfy-menu-secondary-bgkeeps the bad value), the dark default used for a light palette, and the check removed. Each row asserts the completedcomfy-menu-bgandcomfy-menu-secondary-bg. A fourth row asserting the stored palette is unchanged covers item 1. This is cheaper than the extra Playwright row I suggested last round, which you can then drop.
Still open (12)
- P2. Stack on #19437 and add the browser test here. The base is still
main, so the block stays inert and untested. - P2. The screenshots predate the visible token changes. Please recapture at the current head and add the dropdown menu, a selected Vue node with its tooltip, the template cards, and the keybinding panel.
- P3. Commits authored as
Claude <noreply@anthropic.com>. ce8e416 is the sixth. A squash merge carries them intomainasCo-authored-bytrailers, against AGENTS.md. - P3. Description items from my second-round review and the two added in the third. You're deferring these until the base is settled. The description should now also mention that
completePalettevalidatescomfy-menu-bg. - github-actions, selector never matches on
main: confirmed. Item 1 resolves it. - github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
- github-actions, chroma not capped: confirmed for user palettes only.
- github-actions, partial override set: confirmed in part. See question 1.
- github-actions, hover/active equal rest: contested, unchanged (mirrors
.dark-theme). - Question: charcoal-100/500 tokens. Should they follow a tinted palette?
- Question: clamp policy across #19437. #19437 still derives its sidebar and backdrop from the raw menu colour.
- Question: nested
.dark-themeelements. They reset to charcoal.
Addressed this round
Coverage
- Delta 84ca495..ce8e416 (
colorPaletteService.ts-4,colorPaletteStore.ts+10/-4) read in full, with the store's other callers (GraphCanvas.vue:580,colorPaletteServicepersist and export). vitest run src/services/colorPaletteServicepasses (3 tests). A scratch store probe withCSSstubbed confirmed both the fallback values and the write to the stored palette; I deleted it afterwards.- No owner comments on the PR this round.
| const menuBg = palette.colors.comfy_base['comfy-menu-bg'] | ||
| if (menuBg && !CSS.supports('color', menuBg)) { | ||
| palette.colors.comfy_base['comfy-menu-bg'] = | ||
| defaultPalette.colors.comfy_base['comfy-menu-bg'] | ||
| } |
There was a problem hiding this comment.
P3: This assigns into palette, which is the stored object from palettesLookup, and completePalette runs inside the completedActivePalette computed. With CSS.supports stubbed to false, reading completedActivePalette once leaves customPalettes.bad.colors.comfy_base['comfy-menu-bg'] set to #171718. customPalettes holds the same object as the Comfy.CustomColorPalettes setting (GraphCanvas.vue:580). So the next persistCustomColorPalettes saves the substituted colour, and exportColorPalette hands the user a file that isn't the one they imported. The existing comfy-menu-secondary-bg copy below has the same problem; this adds a second write.
Keeping it local fixes both. Compute the corrected menu colour and the derived secondary colour as locals, then put both into the comfy_base object you already build in the return value, with no assignments to palette. Prose because the change spans the secondary-colour block and the return object outside this hunk.
There was a problem hiding this comment.
Fixed in e85f0c8: completePalette no longer assigns into palette. The corrected menu colour and the derived secondary colour are locals spread into the completed comfy_base, which also removes the pre-existing secondary-colour write. Added colorPaletteStore.test.ts with CSS stubbed: rows for a valid colour, invalid on dark, invalid on light, invalid with an explicit secondary, plus a test that the stored palette is unchanged after reading completedActivePalette. Against ce8e416 the stored-palette test fails; with the check removed the three invalid rows and the stored-palette test fail.
Generated by Claude Code
There was a problem hiding this comment.
Verdict: completePalette is pure at e85f0c8 and now has store tests; two P2 items remain (stack on #19437 with the browser test, refresh the screenshots).
- The stored palette is no longer rewritten (thread).
completePalettebuilds the menu colour and secondary colour into the returnedcomfy_base, and the pre-existing secondary-colour write is gone too. No other code readscomfy-menu-secondary-bgfrom a stored palette, so dropping that write changes nothing else. - The new store tests catch the defects they claim. With this head's tests and ce8e416's store, only "leaves the stored custom palette as the user defined it" fails. With
main's store, the three invalid rows and that test fail. Both store and service tests pass at this head (8 tests), and eslint is clean on both changed files.
Two nits in the new test file are inline. Both suggestions pass vitest, eslint and oxfmt when applied.
Still open (12)
- P2. Stack on #19437 and add the browser test here. The base is still
main, so the CSS block stays inert and the surfaces untested. The invalid-colour case is now covered by the store test, so drop the extra Playwright row I suggested in round 3. - P2. The screenshots predate the visible token changes. Please recapture at the current head and add the dropdown menu, a selected Vue node with its tooltip, the template cards, and the keybinding panel.
- P3. Commits authored as
Claude <noreply@anthropic.com>. e85f0c8 is the seventh. A squash merge carries them intomainasCo-authored-bytrailers, against AGENTS.md. - P3. Description items from rounds 2 to 4. You're deferring these until the base is settled. The description should now also say that
completePalettevalidatescomfy-menu-bgand no longer writes into stored palettes, since that is a behaviour change outside the theme CSS. - github-actions, selector never matches on
main: confirmed. Item 1 resolves it. - github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
- github-actions, chroma not capped: confirmed for user palettes only.
- github-actions, partial override set: confirmed in part. See question 1.
- github-actions, hover/active equal rest: contested, unchanged (mirrors
.dark-theme). - Question: charcoal-100/500 tokens. Should they follow a tinted palette?
- Question: clamp policy across #19437. #19437 still derives its sidebar and backdrop from the raw menu colour.
- Question: nested
.dark-themeelements. They reset to charcoal.
Addressed this round
Coverage
- Delta ce8e416..e85f0c8 (
colorPaletteStore.ts+12/-15, newcolorPaletteStore.test.ts+94) read in full, with a search for other readers ofcomfy-menu-secondary-bg. vitest run src/stores/workspace/colorPaletteStore src/services/colorPaletteServicepasses (8 tests); eslint passes on both store files. Falsifier runs: the new tests against ce8e416's store and againstmain's store, as described above.- CI at review time: 40 success, 12 skipped, 10 still running (including
lint-pr / typecheck). - No owner comments on the PR this round.
| import { assert, describe, expect, it, onTestFinished, vi } from 'vitest' | ||
|
|
||
| import type { Palette } from '@/schemas/colorPaletteSchema' | ||
| import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore' | ||
|
|
||
| const INVALID_COLOR = 'notacolor' | ||
|
|
||
| function stubColorSupport() { | ||
| vi.stubGlobal('CSS', { | ||
| supports: (_property: string, value: string) => value !== INVALID_COLOR | ||
| }) | ||
| onTestFinished(() => { | ||
| vi.unstubAllGlobals() | ||
| }) | ||
| } | ||
|
|
||
| function customPalette( | ||
| baseId: 'dark' | 'light', | ||
| menuColors: { menuBg: string; secondaryBg?: string } | ||
| ): Palette { | ||
| const base = useColorPaletteStore().palettesLookup[baseId] | ||
| assert.exists(base) | ||
| const { 'comfy-menu-secondary-bg': _, ...comfyBase } = base.colors.comfy_base |
There was a problem hiding this comment.
Nit (P3): two simplifications in the setup.
vite.config.mtssetsunstubGlobals: true, so Vitest already restoresCSSafter each test. TheonTestFinished(() => vi.unstubAllGlobals())repeats it, anddocs/guidance/vitest.mdasks not to repeat that cleanup.customPalettereads its base from the store and then needsassert.existsbecausepalettesLookupisPartial.DEFAULT_DARK_COLOR_PALETTEandDEFAULT_LIGHT_COLOR_PALETTEare typedCompletedPalette, so the runtime premise check goes away and the helper no longer depends on store state.
With this applied, the file passes vitest (5 tests), eslint and oxfmt.
| import { assert, describe, expect, it, onTestFinished, vi } from 'vitest' | |
| import type { Palette } from '@/schemas/colorPaletteSchema' | |
| import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore' | |
| const INVALID_COLOR = 'notacolor' | |
| function stubColorSupport() { | |
| vi.stubGlobal('CSS', { | |
| supports: (_property: string, value: string) => value !== INVALID_COLOR | |
| }) | |
| onTestFinished(() => { | |
| vi.unstubAllGlobals() | |
| }) | |
| } | |
| function customPalette( | |
| baseId: 'dark' | 'light', | |
| menuColors: { menuBg: string; secondaryBg?: string } | |
| ): Palette { | |
| const base = useColorPaletteStore().palettesLookup[baseId] | |
| assert.exists(base) | |
| const { 'comfy-menu-secondary-bg': _, ...comfyBase } = base.colors.comfy_base | |
| import { describe, expect, it, vi } from 'vitest' | |
| import { | |
| DEFAULT_DARK_COLOR_PALETTE, | |
| DEFAULT_LIGHT_COLOR_PALETTE | |
| } from '@/constants/coreColorPalettes' | |
| import type { Palette } from '@/schemas/colorPaletteSchema' | |
| import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore' | |
| const INVALID_COLOR = 'notacolor' | |
| function stubColorSupport() { | |
| vi.stubGlobal('CSS', { | |
| supports: (_property: string, value: string) => value !== INVALID_COLOR | |
| }) | |
| } | |
| function customPalette( | |
| baseId: 'dark' | 'light', | |
| menuColors: { menuBg: string; secondaryBg?: string } | |
| ): Palette { | |
| const base = | |
| baseId === 'dark' ? DEFAULT_DARK_COLOR_PALETTE : DEFAULT_LIGHT_COLOR_PALETTE | |
| const { 'comfy-menu-secondary-bg': _, ...comfyBase } = base.colors.comfy_base |
There was a problem hiding this comment.
Agreed; this rides the next code push on this PR (pending the author's call on the base).
Generated by Claude Code
| expectedSecondaryBg: '#111111' | ||
| } | ||
| ] as const)( | ||
| 'completes $baseId menu colour $menuBg to $expectedMenuBg', |
There was a problem hiding this comment.
Nit (P3): rows 2 and 4 produce the same title, "completes dark menu colour notacolor to #171718". When one of them fails, the report doesn't say which. Adding the secondary colour tells them apart.
| 'completes $baseId menu colour $menuBg to $expectedMenuBg', | |
| 'completes $baseId menu colour $menuBg (secondary $secondaryBg) to $expectedMenuBg', |
There was a problem hiding this comment.
Agreed; this rides the next code push on this PR (pending the author's call on the base).
Generated by Claude Code
e85f0c8 to
1b6082e
Compare
There was a problem hiding this comment.
Verdict: stacked on #19437 with browser and store tests at 1b6082e; one P2 remains (refresh the screenshots), plus two P3 notes on the new spec.
This head moves the PR onto feat/topbar-theme-refresh and squashes it into two commits authored by Mariana. I compared the product changes with the previous head (e85f0c8): style.css and colorPaletteStore.ts add exactly the same lines, and the store test now has both nits from my last review applied. What's new is the "Interface surfaces" block in colorPalette.spec.ts. Store and service tests pass at this head (8 tests), playwright test --list picks up the four new tests, and the Playwright shards were still running when I posted.
New this round (2, inline)
- P3. The surface tests read the helper variables, not a surface anyone sees (line 234). They catch the dead selector, a dropped
/ 1(obsidian) and a dropped.dark-themescope (light_red). But they would pass if a consumer token stayed on a literal in.dark-theme, or ifcolorPaletteServicestarted inlining one, because neither changes--surface-*. - Nit (P3). Four page loads where one would do (line 248). The "Canvas backdrop" test above already switches palettes with
setSettinginside one test.
Still open (11)
- P2. The screenshots predate the visible token changes. The Evidence section still shows the settings dialog from 2026-08-25. Please recapture at this head and add the dropdown menu, a selected Vue node with its tooltip, the template cards, and the keybinding panel.
- P3. Description. The formula and the testing section are updated; these lines are still out of date:
- "Every derived declaration also ends in
/ 1": only--surface-800does now. - "The default dark palette resolves to the same values it does today":
darkis excluded by the selector, and muted text uses a tuned offset. - "~25 semantic tokens": the block now overrides the five rungs plus four tokens, and
.dark-themeroutes 23 tokens through the rungs. The description doesn't mention that.dark-themeitself changed (pixel-identical) or thatcompletePalettenow validatescomfy-menu-bg. - "Dividers are untouched" while
--border-defaultand--border-subtlemove. - The "Solarized gamut" bullet: every solarized rung is inside sRGB.
- The "Not covered" bullet: its lead and explanation disagree.
- "The resting editor chrome does not change": the queue button group uses
bg-secondary-background. - Template: it still has ELI5 and the essay instead of the
.githubtemplate sections.
- "Every derived declaration also ends in
- github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
- github-actions, chroma not capped: confirmed for user palettes only.
- github-actions, partial override set: confirmed in part. See question 1.
- github-actions, hover/active equal rest: contested, unchanged (mirrors
.dark-theme). - Question: charcoal-100/500 tokens. Should they follow a tinted palette?
- Question: clamp policy across the stack. Now that this PR sits on #19437, the merged result has #19437's
--sidebar-surfaceand--base-background-sunkenderived from the raw menu colour (no clamp, no/ 1) next to this clamped, opaque ladder. That matters only for user palettes outside 0.2 to 0.35 or with alpha. - Question: nested
.dark-themeelements. They reset to charcoal. - github-actions, selector never matches on
main: resolved by the stack. The base now stampsdata-color-palette, and the spec checks the result. - CodeRabbit learnings deferring tests to #19437: now moot, since the tests live here.
Addressed this round
- P2 stack on #19437 and add the browser test: done. The base is
feat/topbar-theme-refresh, and "Interface surfaces" covers the selector, opacity and light-palette scope. - P3 commits authored as
Claude <noreply@anthropic.com>: resolved by the squash. Both commits are authored by Mariana Martinho. - Nit: redundant
unstubAllGlobalsand theassert.existspremise in the store test helper: applied. - Nit: duplicate store test titles: applied.
- P3 description, "Depends on #19437" callout and the
--palette-l: min(l, 0.35)formula: updated.
Coverage
- Diff against the new base (b8e7d90, #19437's head): 4 files, +230/-33. Product files compared line for line with the previous head's patch against
main: identical. vitest run src/stores/workspace/colorPaletteStore src/services/colorPaletteServicepasses (8 tests);playwright test --list browser_tests/tests/colorPalette.spec.tslists 15 tests, including the four new ones. I didn't run the spec (no backend here); CI's Playwright shards were still running.- No owner comments on the PR this round.
| } | ||
| }) | ||
|
|
||
| const rungs = [ |
There was a problem hiding this comment.
P3: These tests read --surface-800 through --surface-200 through a probe div, and the light case reads --surface-800 on <html>. Those are internal helper names, not anything the user sees. They catch the dead selector, a dropped / 1 and a dropped .dark-theme scope. They would still pass if a consumer token were left on a charcoal literal in .dark-theme (say --modal-panel-background: var(--color-charcoal-600) again), or if colorPaletteService started inlining one, because neither changes --surface-*. Renaming the helpers would also break them without any visible change.
Asserting one real consumer covers both: the settings dialog nav (BaseModalLayout.vue, bg-modal-panel-background), opened with comfyPage.settingDialog.open(). For solarized it should be oklch(0.376702 0.0517454 219.656), and rgb(38, 39, 41) for dark; I measured both in Chromium in my first review. Your canvas readback works the same on that element if you'd rather compare bytes. Prose because it changes what the tests read.
There was a problem hiding this comment.
Fixed in 9090717 (not yet pushed): the test now opens the settings dialog and reads its nav (bg-modal-panel-background) through the canvas readback: [29, 72, 84, 255] solarized, [40, 40, 40, 255] obsidian, white light_red, [38, 39, 41, 255] dark. The --surface-* probes are gone.
Generated by Claude Code
| { palette: 'obsidian', base: [24, 24, 24] } | ||
| ] | ||
|
|
||
| for (const { palette, base } of cases) { |
There was a problem hiding this comment.
Nit (P3): each generated test plus the light case reloads the page, so that's four page loads. Switching palettes inside one test, as the "Canvas backdrop" test above does with setSetting, covers all four rows with one load. The dark row has little unique signal anyway: the offsets reproduce charcoal, so it would pass whether or not dark is excluded. Prose because it restructures the block.
There was a problem hiding this comment.
Fixed in 9090717 (not yet pushed): one test, one page load, palettes switched with setSetting. dark stays last as the charcoal control.
Generated by Claude Code
|
Answers to the three open design questions, now recorded in the description:
Generated by Claude Code |
There was a problem hiding this comment.
Verdict: code and tests are done at aa19ebb; the only open item is visual evidence. The description says screenshots are "attached below", but it has none.
- The surface test now reads a real consumer (thread). It reads the settings dialog
nav(bg-modal-panel-background) against literal bytes, so leaving--modal-panel-backgroundon a charcoal literal in.dark-themewould now fail the solarized row. The obsidian row (translucent menu colour, expects alpha 255) and the light_red row keep the opacity and scope checks. - One page load (thread): one test switches the four palettes with
setSetting. - The merge of
feat/topbar-theme-refresh(9aa5a5e) only brings in #19437's new canvas grid images. Thestyle.css,colorPaletteStore.tsand store test changes against the base are line-for-line the same as at 1b6082e. - CI at this head: 121 success, 11 skipped, no failures, including the Playwright shards and
e2e-status. - Questions answered: your design decisions answer the three open questions (charcoal-100/500, nested
.dark-theme, the clamp range across #19437), and the rewritten description fixes every out-of-date claim I listed.
Still open (1)
- P2. No visual evidence for a visible change. The Verification section ends with "Screenshots (AS-IS #19437 vs TO-BE, solarized/arc/nord/github): settings dialog, main menu dropdown, selected Vue node with its tooltip, template cards and the keybinding panel, attached below." The body has no images after it, and this edit also removed the August pairs, so the PR now has no before/after evidence at all. Please attach the screenshots that bullet describes, or a short screencast.
Addressed or answered this round
- P3 surface tests read helper variables, not a consumer: fixed in 9090717 (thread).
- Nit four page loads: fixed in 9090717 (thread).
- P3 description items (
/ 1claim, "default dark resolves to the same values", "~25 tokens", dividers, solarized gamut, "Not covered", resting chrome, template shape): fixed by the rewrite. - Question charcoal-100/500 tokens, together with the github-actions partial-override finding: answered; they stay fixed and design can follow up.
- Question nested
.dark-themeelements: answered;AgentConsentCardgets its own follow-up PR. - Question clamp policy across #19437, together with the github-actions raw-panel-colour finding: answered; the range is a design-system rule and only affects user palettes outside 0.2 to 0.35 or with alpha.
- github-actions chroma not capped: answered earlier (you keep palette chroma), and it affects user palettes only.
- github-actions hover/active equal rest: contested since round 1 (mirrors
.dark-theme).
…omfy-Org#15884) > [!NOTE] > Merge order: this, then Comfy-Org#19437 (charcoal surfaces and canvas), which targets this branch, then Comfy-Org#15893 (custom-palette surfaces), which targets `main` and lands after them. This PR can merge on its own. Comfy-Org#19437 still carries an earlier revision of this PR and will pick up the final one when it is updated against this branch. ## Summary With a media node selected, Ctrl+V pastes the copied node only when the OS clipboard proves it still holds the copy in litegraph's clipboard slot. ## Changes - **What**: On `main`, pasting onto a selected media node falls through to `canvas.pasteFromClipboard()`. That call deserializes litegraph's `localStorage` slot, not the OS clipboard, so copying text in another app and pasting onto an image node still dropped the last in-app copy. With this PR, on a media node the default paste runs only when the decoded OS clipboard payload equals the slot's content byte for byte. These cases skip it and show a short info toast ("Nothing to paste into this node"): - another app's text, - an earlier copy, - a menu Copy or Duplicate after the Ctrl+C. - `useCopy` keeps `main`'s HTML wrapper and payload byte for byte. A copy with identical content from an older build or another profile pastes, since the slot holds the same nodes. - The reader also accepts the wrappers Chromium adds on Windows (CF_HTML: `<html>\r\n<body>\r\n<!--StartFragment-->` … `<!--EndFragment-->\r\n</body>\r\n</html>`) and macOS (`<meta charset='utf-8'>`). Since Comfy-Org#19239, the anchored pattern never matched on those platforms, so canvas node paste there always fell back to the slot. - The clipboard keys move to `src/lib/litegraph/src/canvas/clipboardStorage.ts`. The template paths keep `main`'s slot restore, which leaves the slot equal to the clipboard after Save Selected as Template. ## Review Focus - Behavior on Windows and macOS Chromium, verified from Chromium's clipboard source (`clipboard_util_win.cc`, `clipboard_mac.mm`) and unit rows, not on those machines. A canvas Ctrl+V there now deserializes the OS payload instead of the slot, as Linux already did. After Ctrl+C on A and a menu Copy of B, `main` pastes B there and this PR pastes A. - Trade-off: a menu Copy (no Ctrl+C) followed by Ctrl+V onto a selected media node does not paste the node, because nothing proves the OS clipboard matches the slot. The toast says so instead of failing silently. - Comfy-Org#18643 edits the same reader and predates Comfy-Org#19239. Its media-node test expects the slot paste to run, so it conflicts with this rule. ## Testing - `pnpm test:unit src/composables/useCopy.test.ts src/composables/usePaste.test.ts src/extensions/core/nodeTemplates.test.ts`. Most rows copy through the real `useCopy` handler and paste through `usePaste`. Coverage: a canvas paste of a real copy, another app's text, earlier vs. latest copy, a menu copy after Ctrl+C, the Windows and macOS wrappers, and a Comfy fragment inside arbitrary HTML. - `pnpm test:browser:local browser_tests/tests/copyPaste.spec.ts --grep "latest copy"`: passes 3/3 at head. On a `main` build it fails at the replaced-clipboard step, where `main` pastes the stale node. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
dante01yoon
left a comment
There was a problem hiding this comment.
Nice work. The surface ladder in .dark-theme keeps default dark pixel-identical, and moving the menu-colour fallback into completePalette without mutating the stored palette is the right shape. The previous review threads look addressed on this head. The muted vs. secondary text order is restored too: +0.46 sits below +0.5008.
There is one blocking repo-rule point, inline. Otherwise this is ready from my side once its stack (#19437, currently conflicting with main) lands.
Checks: I did not run the Playwright or Vitest files locally.
| :root.dark-theme[data-color-palette]:not([data-color-palette='dark']) { | ||
| --surface-800: oklch(from var(--comfy-menu-bg) clamp(0.2, l, 0.35) c h / 1); | ||
|
|
||
| /* Offsets are L(charcoal-N) - L(charcoal-800) in OKLCH, from _palette.css. */ |
There was a problem hiding this comment.
issue: the repo rule is no new code comments (AGENTS.md / engineering guidance), and that includes CSS. I know an earlier review thread suggested this one-line note, but the rule still applies. Could the provenance move into the commit message or PR description instead? Another option is the design-system docs next to _palette.css. If you want it enforced in code, a unit test that computes L(charcoal-N) - L(charcoal-800) from _palette.css and compares it to these offsets would catch a retune, which a comment cannot.
a9a4555 to
7155206
Compare
Important
Stacked on #19437: this PR targets
feat/topbar-theme-refresh. The palette block keys offdata-color-palette, which #19437 stamps ondocumentElement. Merge order: #15884 → #19437 → this.Summary
With a custom dark palette such as Solarized, buttons, menus, modals, node surfaces and the editor's own chrome stayed the default charcoal. They now derive from the palette's own
--comfy-menu-bg..dark-themeroutes 23 tokens through five surface rungs (--surface-800/600/400/300/200). For the default dark palette the rungs are the charcoal values, so it renders pixel-identical.:root.dark-theme[data-color-palette]:not([data-color-palette='dark'])rebuilds the rungs in OKLCH from the menu colour. Each rung keeps the lightness offset between the charcoal steps, so hue and chroma follow the palette. The block also overrides--muted-foreground,--text-secondary,--button-iconand--modal-card-tag-backgroundso muted text stays at or above 4.5:1.clamp(0.2, l, 0.35)and is forced opaque (/ 1). The other rungs derive from it, so a user palette with a very light, very dark or translucent menu colour still gets a legible, opaque ladder.completePalettenow falls back to the default palette's menu colour whencomfy-menu-bgis not a valid colour, without rewriting the stored palette.--border-defaultand--border-subtlemove with the rungs.interface-strokeandinterface-panel-surfacedo not: they are optionalcomfy_basekeys, socolorPaletteServiceinlines them on<html>, and inline wins over any selector.The resting editor chrome is where this shows first. Four elements a user sees without opening anything move from charcoal
#262729to the palette's tone,#1d4854on solarized: the active workflow tab, the batch counter, the queue group's0 activepill, and the account avatar. The top bar behind them is unchanged, becausecolorPaletteServicealready inlines--comfy-menu-bg, so after this PR the bar and the controls on it finally read as one surface instead of grey chips on a coloured strip. Modals, menus and Vue node surfaces move too.The
Runbutton stays white on every palette. It uses theinvertedvariant, which is meant to oppose the surface and be the highest-contrast element on screen. Tinting it would be a separate design decision, not part of this change.Design decisions:
charcoal-100andcharcoal-500stay fixed. They only drive borders, dividers and accent fills, so a follow-up can move them if design wants them tinted..dark-themeelements reset to charcoal. The only one inside the editor isAgentConsentCard; it gets its own follow-up PR. The other users are full-page cloud and onboarding views outside the graph palette.clamp(0.2, l, 0.35)lightness range is a design-system rule for design to own. feat: apply charcoal palette surfaces and per-palette canvas backdrop #19437's--sidebar-surfaceand--base-background-sunkenstill derive from the raw menu colour, which only matters for user palettes outside that range or with alpha.Verification
browser_tests/tests/colorPalette.spec.ts› Interface surfaces: with the settings dialog open, its panel (bg-modal-panel-background) readsrgb(29, 72, 84)on solarized,rgb(40, 40, 40)opaque on obsidian (translucent menu colour), white on light_red andrgb(38, 39, 41)on dark. Passes 3/3 locally.src/stores/workspace/colorPaletteStore.test.ts: an invalidcomfy-menu-bgfalls back to the default colour (dark and light, with and without a secondary colour), and the stored palette is left as defined.rgb(38, 39, 41)rgb(29, 72, 84)rgb(38, 39, 41)rgb(29, 72, 84)0 activepillrgb(38, 39, 41)rgb(29, 72, 84)rgb(38, 39, 41)rgb(29, 72, 84)Graphbuttonrgb(38, 39, 41)rgb(29, 72, 84)rgb(7, 54, 66)rgb(7, 54, 66)RunbuttonAll five chip surfaces land on one value, so the chrome retints evenly rather than in patches. Confirmed on nord as well.
main