Skip to content

feat(theme): derive custom dark palette surfaces from their own colour - #15893

Open
mariana953 wants to merge 96 commits into
feat/topbar-theme-refreshfrom
feat/custom-palette-surfaces
Open

mariana953 wants to merge 96 commits into
feat/topbar-theme-refreshfrom
feat/custom-palette-surfaces

Conversation

@mariana953

@mariana953 mariana953 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Stacked on #19437: this PR targets feat/topbar-theme-refresh. The palette block keys off data-color-palette, which #19437 stamps on documentElement. 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-theme routes 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.
  • For any other dark palette, :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-icon and --modal-card-tag-background so muted text stays at or above 4.5:1.
  • The base rung clamps lightness to 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.
  • completePalette now falls back to the default palette's menu colour when comfy-menu-bg is not a valid colour, without rewriting the stored palette.
  • --border-default and --border-subtle move with the rungs. interface-stroke and interface-panel-surface do not: they are optional comfy_base keys, so colorPaletteService inlines 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 #262729 to the palette's tone, #1d4854 on solarized: the active workflow tab, the batch counter, the queue group's 0 active pill, and the account avatar. The top bar behind them is unchanged, because colorPaletteService already 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 Run button stays white on every palette. It uses the inverted variant, 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-100 and charcoal-500 stay fixed. They only drive borders, dividers and accent fills, so a follow-up can move them if design wants them tinted.
  • Nested .dark-theme elements reset to charcoal. The only one inside the editor is AgentConsentCard; it gets its own follow-up PR. The other users are full-page cloud and onboarding views outside the graph palette.
  • The 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-surface and --base-background-sunken still 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) reads rgb(29, 72, 84) on solarized, rgb(40, 40, 40) opaque on obsidian (translucent menu colour), white on light_red and rgb(38, 39, 41) on dark. Passes 3/3 locally.
  • src/stores/workspace/colorPaletteStore.test.ts: an invalid comfy-menu-bg falls back to the default colour (dark and light, with and without a secondary colour), and the stored palette is left as defined.
  • Editor chrome, sampled from full-window captures of the running editor on solarized, this PR against feat: apply charcoal palette surfaces and per-palette canvas backdrop #19437's head. Each element is the dominant colour of its own background region, so text and borders do not skew it:
Element On #19437 With this PR
Active workflow tab rgb(38, 39, 41) rgb(29, 72, 84)
Batch counter rgb(38, 39, 41) rgb(29, 72, 84)
0 active pill rgb(38, 39, 41) rgb(29, 72, 84)
Account avatar rgb(38, 39, 41) rgb(29, 72, 84)
Graph button rgb(38, 39, 41) rgb(29, 72, 84)
Top bar rgb(7, 54, 66) rgb(7, 54, 66)
Run button white white

All five chip surfaces land on one value, so the chrome retints evenly rather than in patches. Confirmed on nord as well.

  • Muted text against the modal surface, WCAG contrast:
Palette main This PR
solarized 4.33 4.81
arc 4.33 4.97
nord 4.33 4.93
github 4.33 4.87

marianamartinho and others added 30 commits July 16, 2026 12:13
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.
@mrseek-reviews
mrseek-reviews Bot requested a review from DrJKL October 8, 2026 01:47

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-secondary now 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-icon follows muted.
  • The rungs derive from the opaque --surface-800; the translucent input still gives opaque surfaces.
  • dark still resolves to charcoal, and the shipped panel values are unchanged (solarized 0.376702, arc 0.341094).
  • oxfmt and stylelint pass on style.css at 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)
  1. 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-theme on 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-theme and 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-theme side is a rename of values it already has.
  2. 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.
  3. 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.
  4. P2. An invalid comfy-menu-bg blanks every overridden token (github-actions finding, confirmed). At this head notacolor still makes the background tokens rgba(0, 0, 0, 0), and --text-secondary and --button-icon are now in that set too. On main they stay charcoal. A CSS.supports('color', ...) check in loadComfyColorPalette, as #19437 does for its clear colour, would cover every consumer.
  5. P3. The dependency lives only in prose. The callout still lists #15884, a paste fix, and GitHub doesn't enforce the order.
  6. 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.
  7. 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.
  8. P3. "The default dark palette resolves to the same values it does today" is not true. dark is 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.
  9. P3. The "Solarized gamut" bullet doesn't hold. Every solarized rung is inside sRGB.
  10. 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.
  11. Nit (P3). "Dividers are untouched" while --border-default and --border-subtle move.
  12. Nit (P3). The "Not covered" bullet's lead and explanation disagree.
  13. Nit (P3). The description doesn't follow the .github template.
  14. github-actions, selector never matches on main: confirmed. Same fix as item 5.
  15. github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
  16. github-actions, chroma not capped: confirmed for user palettes only.
  17. github-actions, partial override set: confirmed in part. The charcoal-100/500 part is question 1.
New this round (1)
  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 a Co-authored-by trailer on main. I missed this last round. Re-authoring them before merge fixes it; the repository's disabling-ai-attribution skill covers the local settings.
Questions (3)
  1. Should the charcoal-100/500 tokens follow a tinted palette? --muted-background, --accent-background, --component-node-widget-background-selected, --node-border and --node-divider stay neutral. ComfyHubThumbnailStep.vue:17 mixes a tinted bg-node-component-surface with a neutral data-[state=on]:bg-muted-background.
  2. 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.
  3. Should nested .dark-theme elements (such as AgentConsentCard.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-l bare channel variable, five repeated expressions: fixed (thread).
  • Nit --palette-* namespace reuse and the base rung name: fixed by the --surface-N rename (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-l naming: 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.

Copy link
Copy Markdown
Contributor Author

Round two from @mrseek-reviews, status at 84ca495:

  • P2 one source for rung assignments: done (see thread).
  • P2 invalid comfy-menu-bg: loadComfyColorPalette now drops a value that fails CSS.supports('color', ...), so the derived tokens fall back to the default instead of going transparent. happy-dom's CSS.supports is a stub, so this belongs in the browser test.
  • P2 stack on feat: apply charcoal palette surfaces and per-palette canvas backdrop #19437 with a browser test, P2 screenshots, the three questions and the commit authorship: waiting on the author.
  • P3 description items: will be folded into the description update once the base is settled.

Generated by Claude Code

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

I reviewed 16a2f0a..84ca495.

  • 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-theme declares, the default dark palette, no attribute, solarized, arc, a translucent colour, #000 and #fff, at the root and inside a nested .dark-theme element. 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 to oklch(0.396467 0 …), derived from the stylesheet default #353535. One inline note on where the fallback should come from.
  • colorPaletteService.test.ts passes at this head. happy-dom's CSS.supports returns true for notacolor, so the guard can only be exercised in the browser.
Still open (13)
  1. 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 show oklch(0.396467 0.0000163737 23.7189) on the settings-dialog nav (Chromium, this head's CSS) instead of rgba(0, 0, 0, 0). That row fails if the guard is removed, and no lower level can see it.
  2. 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.
  3. P3. Commits authored as Claude <noreply@anthropic.com>. 84ca495 is the fifth. A squash merge carries these into main as Co-authored-by trailers, against AGENTS.md.
  4. 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-theme now 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.
  5. github-actions, selector never matches on main: confirmed. Item 1 resolves it.
  6. github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
  7. github-actions, chroma not capped: confirmed for user palettes only.
  8. github-actions, partial override set: confirmed in part. The charcoal-100/500 part is question 1.
  9. github-actions, invalid comfy-menu-bg: addressed for this block by the guard; see the inline note for --comfy-menu-secondary-bg and light palettes.
  10. github-actions, hover/active equal rest: contested (unchanged; mirrors .dark-theme).
  11. Question: charcoal-100/500 tokens. Should they follow a tinted palette? Waiting on you.
  12. Question: clamp policy across #19437. #19437 still derives its sidebar and backdrop from the raw menu colour.
  13. Question: nested .dark-theme elements. They reset to charcoal, now explicitly through the --surface-* redeclaration.
Coverage
  • Delta 16a2f0a..84ca495: style.css +33/-50 and colorPaletteService.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-dom CSS.supports probe.
  • I could not run the custom-node code search for other uses of --surface-800 (the search service failed). PrimeVue uses the p prefix, so its variables don't collide.
  • No owner comments on the PR this round.

Comment thread src/services/colorPaletteService.ts Outdated
Comment on lines +213 to +216
if (key === 'comfy-menu-bg' && !CSS.supports('color', value)) {
rootStyle.removeProperty('--comfy-menu-bg')
continue
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) copies comfy-menu-bg into comfy-menu-secondary-bg before this loop runs, and that key is still written unchecked. Every --comfy-menu-secondary-bg consumer 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.

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.

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

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
  1. P3. completePalette writes the fallback into the stored palette (inline on lines 69-73). I confirmed it with a scratch store test that stubs CSS.supports to false: after reading completedActivePalette once, the object in customPalettes holds #171718 instead of the user's value. That write happens inside a computed, and the Comfy.CustomColorPalettes setting shares the same object (GraphCanvas.vue:580). So exportColorPalette exports the substituted colour, and the next persistCustomColorPalettes saves it.
  2. P3. The fallback can be unit-tested. happy-dom's CSS.supports returns true for everything, but vi.stubGlobal('CSS', { supports: () => false }) works; my probe above used it. colorPaletteStore has 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-bg keeps the bad value), the dark default used for a light palette, and the check removed. Each row asserts the completed comfy-menu-bg and comfy-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)
  1. P2. Stack on #19437 and add the browser test here. The base is still main, so the block stays inert and untested.
  2. 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.
  3. P3. Commits authored as Claude <noreply@anthropic.com>. ce8e416 is the sixth. A squash merge carries them into main as Co-authored-by trailers, against AGENTS.md.
  4. 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 completePalette validates comfy-menu-bg.
  5. github-actions, selector never matches on main: confirmed. Item 1 resolves it.
  6. github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
  7. github-actions, chroma not capped: confirmed for user palettes only.
  8. github-actions, partial override set: confirmed in part. See question 1.
  9. github-actions, hover/active equal rest: contested, unchanged (mirrors .dark-theme).
  10. Question: charcoal-100/500 tokens. Should they follow a tinted palette?
  11. Question: clamp policy across #19437. #19437 still derives its sidebar and backdrop from the raw menu colour.
  12. Question: nested .dark-theme elements. They reset to charcoal.
Addressed this round
  • P3 fallback came from the stylesheet (#353535) and missed comfy-menu-secondary-bg: fixed in ce8e416 (thread).
  • github-actions, invalid comfy-menu-bg blanks the surfaces: fixed at the palette boundary.
Coverage
  • Delta 84ca495..ce8e416 (colorPaletteService.ts -4, colorPaletteStore.ts +10/-4) read in full, with the store's other callers (GraphCanvas.vue:580, colorPaletteService persist and export).
  • vitest run src/services/colorPaletteService passes (3 tests). A scratch store probe with CSS stubbed confirmed both the fallback values and the write to the stored palette; I deleted it afterwards.
  • No owner comments on the PR this round.

Comment on lines +69 to +73
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']
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

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

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

I reviewed ce8e416..e85f0c8.

  • The stored palette is no longer rewritten (thread). completePalette builds the menu colour and secondary colour into the returned comfy_base, and the pre-existing secondary-colour write is gone too. No other code reads comfy-menu-secondary-bg from 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)
  1. 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.
  2. 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.
  3. P3. Commits authored as Claude <noreply@anthropic.com>. e85f0c8 is the seventh. A squash merge carries them into main as Co-authored-by trailers, against AGENTS.md.
  4. P3. Description items from rounds 2 to 4. You're deferring these until the base is settled. The description should now also say that completePalette validates comfy-menu-bg and no longer writes into stored palettes, since that is a behaviour change outside the theme CSS.
  5. github-actions, selector never matches on main: confirmed. Item 1 resolves it.
  6. github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
  7. github-actions, chroma not capped: confirmed for user palettes only.
  8. github-actions, partial override set: confirmed in part. See question 1.
  9. github-actions, hover/active equal rest: contested, unchanged (mirrors .dark-theme).
  10. Question: charcoal-100/500 tokens. Should they follow a tinted palette?
  11. Question: clamp policy across #19437. #19437 still derives its sidebar and backdrop from the raw menu colour.
  12. Question: nested .dark-theme elements. They reset to charcoal.
Addressed this round
  • P3 completePalette wrote the fallback into the stored palette inside a computed: fixed in e85f0c8 (thread).
  • P3 fallback had no unit test: fixed by colorPaletteStore.test.ts (four rows plus the stored-palette test).
Coverage
  • Delta ce8e416..e85f0c8 (colorPaletteStore.ts +12/-15, new colorPaletteStore.test.ts +94) read in full, with a search for other readers of comfy-menu-secondary-bg.
  • vitest run src/stores/workspace/colorPaletteStore src/services/colorPaletteService passes (8 tests); eslint passes on both store files. Falsifier runs: the new tests against ce8e416's store and against main'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.

Comment on lines +1 to +23
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit (P3): two simplifications in the setup.

  • vite.config.mts sets unstubGlobals: true, so Vitest already restores CSS after each test. The onTestFinished(() => vi.unstubAllGlobals()) repeats it, and docs/guidance/vitest.md asks not to repeat that cleanup.
  • customPalette reads its base from the store and then needs assert.exists because palettesLookup is Partial. DEFAULT_DARK_COLOR_PALETTE and DEFAULT_LIGHT_COLOR_PALETTE are typed CompletedPalette, 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.

Suggested change
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

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.

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',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
'completes $baseId menu colour $menuBg to $expectedMenuBg',
'completes $baseId menu colour $menuBg (secondary $secondaryBg) to $expectedMenuBg',

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.

Agreed; this rides the next code push on this PR (pending the author's call on the base).


Generated by Claude Code

@mariana953
mariana953 changed the base branch from main to feat/topbar-theme-refresh October 8, 2026 14:36
@mariana953
mariana953 force-pushed the feat/custom-palette-surfaces branch from e85f0c8 to 1b6082e Compare October 8, 2026 14:37

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)
  1. 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-theme scope (light_red). But they would pass if a consumer token stayed on a literal in .dark-theme, or if colorPaletteService started inlining one, because neither changes --surface-*.
  2. Nit (P3). Four page loads where one would do (line 248). The "Canvas backdrop" test above already switches palettes with setSetting inside one test.
Still open (11)
  1. 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.
  2. 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-800 does now.
    • "The default dark palette resolves to the same values it does today": dark is 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-theme routes 23 tokens through the rungs. The description doesn't mention that .dark-theme itself changed (pixel-identical) or that completePalette now validates comfy-menu-bg.
    • "Dividers are untouched" while --border-default and --border-subtle move.
    • 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 .github template sections.
  3. github-actions, panel family uses the raw menu colour: confirmed, also below the 0.2 floor.
  4. github-actions, chroma not capped: confirmed for user palettes only.
  5. github-actions, partial override set: confirmed in part. See question 1.
  6. github-actions, hover/active equal rest: contested, unchanged (mirrors .dark-theme).
  7. Question: charcoal-100/500 tokens. Should they follow a tinted palette?
  8. Question: clamp policy across the stack. Now that this PR sits on #19437, the merged result has #19437's --sidebar-surface and --base-background-sunken derived 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.
  9. Question: nested .dark-theme elements. They reset to charcoal.
  10. github-actions, selector never matches on main: resolved by the stack. The base now stamps data-color-palette, and the spec checks the result.
  11. 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 unstubAllGlobals and the assert.exists premise 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/colorPaletteService passes (8 tests); playwright test --list browser_tests/tests/colorPalette.spec.ts lists 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 = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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.

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

Copy link
Copy Markdown
Contributor Author

Answers to the three open design questions, now recorded in the description:

  1. charcoal-100/charcoal-500 stay fixed in this PR (borders, dividers and accent fills only); tinting them is a follow-up if design wants it.
  2. Nested .dark-theme: AgentConsentCard is the only in-editor case and gets its own follow-up PR.
  3. The clamp(0.2, l, 0.35) range is a design-system rule for design to own; aligning feat: apply charcoal palette surfaces and per-palette canvas backdrop #19437's sidebar and sunken surfaces with it only affects user palettes outside that range.

Generated by Claude Code

@mrseek-reviews mrseek-reviews Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

I reviewed 1b6082e..aa19ebb.

  • 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-background on a charcoal literal in .dark-theme would 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. The style.css, colorPaletteStore.ts and 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)
  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 (/ 1 claim, "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-theme elements: answered; AgentConsentCard gets 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).
Coverage
  • Delta 1b6082e..aa19ebb: colorPalette.spec.ts +20/-59 and a base merge, both read in full; product files compared line for line against the base.
  • CI check runs at aa19ebb: 121 success, 11 skipped, 0 failed.
  • No owner comments on the PR this round.

AkiEvansDev pushed a commit to AkiEvansDev/ComfyUI-Frontend that referenced this pull request Oct 8, 2026
…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 dante01yoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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. */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@mariana953
mariana953 force-pushed the feat/topbar-theme-refresh branch from a9a4555 to 7155206 Compare November 12, 2026 16:47

This branch was previously deployed

1 inactive deployment
website-approval — 4f484769 Deployed Oct 13, 2026 by mariana953 via fast-lane #641
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor-review Trigger multi-model Cursor agent review on this PR risk:high PR risk grade (advisory shadow check; grader-owned) size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants