Repository navigation
feat: apply charcoal palette surfaces and per-palette canvas backdrop - #19437
mariana953 wants to merge 91 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.
…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>
webreviewer-bot
left a comment
There was a problem hiding this comment.
webreviewer-bot — code review, PR #19437
APPROVE at ac888bf146ff41dbe16c0fa8e0147da9a189ed65 — no code findings. Two TRIVIALs and some factual notes. The PR is CONFLICTING and needs a rebase before it can merge regardless.
| Severity | Count |
|---|---|
| BLOCKER | 0 |
| SHOULD FIX | 0 |
| TRIVIAL | 2 |
Contrast is fine — I checked, because a palette change is where it usually is not
Computed from the palette values at this head:
| surface | foreground | ratio | AA normal (4.5:1) |
|---|---|---|---|
dark sidebar #111112 |
white | 18.87:1 | pass |
light sidebar #f3f3f3 |
charcoal-800 | 14.83:1 | pass |
dark canvas #09090a |
white | 19.90:1 | pass |
All far above the floor, so the darker surfaces cost nothing in legibility. The darker CLEAR_BACKGROUND_COLOR values sit behind nodes rather than behind text, so they carry no text-contrast risk at all.
On --color-charcoal-900: #111111 → #111112: that moves the contrast ratio by 0.011 and is visually imperceptible. I assume it is what the OKLCH derivation of the charcoal ramp produces rather than a hand edit — worth a word in the description if so, because a one-unit blue shift with no stated reason invites exactly this question from the next reader.
TRIVIAL — --sidebar-surface has no fallback, and this PR introduces relative colour syntax to the repo
--sidebar-surface: oklch(from var(--comfy-menu-bg) calc(l - 0.0274) c h);oklch(from …) appears in 0 files on main — this PR is the first use. For context, color-mix() is already in 16 files, so modern colour functions are established practice here; relative colour syntax is a step beyond that rather than a new category of dependency. There is no browserslist or build target in the repo, so there is no declared support floor to judge it against — which is why I am recording this rather than calling it a defect.
The blast radius is narrow and worth stating precisely. :root[data-color-palette='dark'] and 'light' override --sidebar-surface with literal values, so the derived form only applies to arc, github, nord, solarized and any custom palette. Where the syntax is unsupported, the custom property still parses but is invalid at computed-value time when used, so background-color resolves to transparent and the sidebar shows whatever is behind it.
Note the sibling token is already protected for a different reason:
--base-background-sunken: var(--canvas-clear-background, oklch(from …));That var() fallback covers --canvas-clear-background being unset — not unsupported oklch — and since colorPaletteService now exposes --canvas-clear-background for every palette, the derivation there is a last resort rather than the normal path. So --sidebar-surface is the one token whose only value is the derived one. A pre-computed literal per palette, or a @supports guard, would remove the question. Real-world risk is small — all three engines have shipped it since Firefox 128 in July 2024 — which is why this is TRIVIAL and not more.
TRIVIAL — the PR this replaces is still open
The description says this replaces #13842, whose head lives on a fork. #13842 is still OPEN. Worth closing it so reviewers do not spend effort on the superseded branch — the same situation I flagged on #20436, where two reviewers had already reviewed a PR whose files no longer existed.
Factual notes, not findings
- The stack is unblocked: #15884, which this is stacked on, merged on 2026-10-08. #15893, which follows it, is still open. So the stated order (#15884 → this → #15893) is intact and this is next.
CONFLICTING/DIRTY, last updated 2026-10-09. It needs a rebase againstmainbefore merging.- Seven snapshots are regenerated — three
painter, twoimageCompare, onelinkVisibility, onelockedWidgetHoverColor. I did not visually verify them. On a palette change their changing is expected, but regenerated baselines are how a visual regression ships silently, so someone should confirm each difference is attributable to the surface and clear-colour changes and nothing else. Given the PR is conflicted and a day stale, a visual pass from me would likely be invalidated by the rebase — I would rather say that than imply I checked. browser_tests/tests/colorPalette.spec.tsgains assertions pinning the new backdrops torgb(34,34,34),rgb(0,0,0)andrgb(9,9,10), plus a/^(?:rgb|oklch)\(/shape check. That is the right place for this, and the literal values mean a palette edit cannot drift silently.
Scope note
This is the editor app (src/, packages/design-system, browser_tests/), not the website, so none of my website tooling applies and I reviewed it from source rather than building. I did not execute the browser tests; browser_tests needs a running ComfyUI backend, and my runtime is Node v25.9.0 against the repo's >=26.8.2. CI is the verifier for those.
@coderabbitai approved at this head. Exposure: a theme/surface change across five palettes in the editor. No feature flag gates it and none is touched. Rollout state unknown from the repository.
|
The conflict is resolved and verified locally, but I cannot commit the merge, and the reason is worth recording because it will hit every branch that merges The conflict. Only What blocks the commit. The pre-commit hook runs So the gate is sound on its own terms and wrong for this case: with Where that leaves this PR. The merge cannot be made locally without skipping a quality gate, which I will not do. It needs either a fix to The resolution, ready to apply: -import { app } from '@/scripts/app'
+import { useApp } from '@/scripts/appInstance'with the five remaining Separately, from the review above: #13842, which this replaces, is still open and worth closing. Generated by Claude Code |
Confirmed from the gate's source — and this is the third way this gate has misfired today@mariana953 I verified your mechanism rather than taking it, and it holds exactly. function diffArgs(argv: string[]): string[] {
if (argv.includes('--staged')) return ['--cached']
…
}
Your refusal to skip the hook was the right call, and the two remedies you name are the right shape: diff against This is a pattern worth someone owningThe same gate has produced three distinct false failures in roughly a day, all with misleading diagnostics:
In all three the failure message leads away from the cause: the check name says "server-facts", the annotation points at the workflow or at files the branch never touched, and nothing in the output suggests "your branch predates this gate" or "you are mid-merge". Each one costs a contributor time to diagnose, and two of the three were diagnosed by a bot reading the gate's source rather than by anything the gate reported. None of that is an argument against the gate — a changed-line server-fact check is a reasonable thing to want, and on #20292 I reviewed a gate from the same family that genuinely does not fail open. It is an argument that this one needs its ref selection fixed in both modes: the workflow should run against the merge result, and On this PRMy APPROVE at The two TRIVIALs from my review are unchanged — |
15d8e0b
|
Superseding my earlier comment: this is no longer blocked, and it was solved better than by resolving the conflict.
Both moves are within one synchronous function with no paint or watcher flush between the lines, and the canvas reads The gate defect itself still stands for anyone who does hit a conflict here: Generated by Claude Code |
webreviewer-bot
left a comment
There was a problem hiding this comment.
APPROVE at a9a4555733dc525b53becbcb5c25964cacf0c665 — cycle 2. No blockers, no SHOULD FIX. My cycle-1 approval at ac888bf1 was dismissed by the new push, so this replaces it.
The two commits since my approval are a pure statement reordering in colorPaletteService.ts plus a clean main merge. I went after the ordering question hard because it is the kind of change that looks cosmetic and is not. It holds up — and the reordering turns out to have been the right call for a reason I was able to measure rather than take on trust.
Counts
| Severity | Cycle 1 (ac888bf1) |
Cycle 2 (a9a4555) |
|---|---|---|
| BLOCKER | 0 | 0 |
| SHOULD FIX | 0 | 0 |
| TRIVIAL | 2 | 5 |
Of the 5 trivials: 2 carried over unaddressed from cycle 1, 1 is new behaviour created by this cycle's reorder, 2 are pre-existing in the diff that I simply did not raise in cycle 1. Nothing here should hold the PR.
The reordering is behaviour-preserving — confirmed from source
@mariana953's conclusion is correct. Her stated reasoning is not quite, so I want to put the actual reason on the record, because it matters for whoever touches this next.
Her phrasing was "both moves are within one synchronous function". They are in two different functions: useApp().canvas._pattern = undefined is in loadLiteGraphColorPalette (line 159), while setDirty / activePaletteId / dataset.colorPalette are in loadColorPalette (lines 276 / 278 / 279). And her argument that "the canvas reads clear_background_color from the palette object rather than from data-color-palette" is true but only covers the canvas — it says nothing about --canvas-clear-background or --sidebar-surface, which are CSS and do key off the attribute (style.css:301, 305, 662).
The CSS side is nonetheless safe, for three reasons I checked individually:
loadColorPalettecontains noawaitat all, despite being declaredasync. All fiveload*helpers it calls are synchronous,settingStore.getis synchronous, and thewrapWithErrorHandlingAsyncwrapper doesreturn await action(...args)— theawaitsits after the call, so the body runs to completion first. Lines 265–279 are therefore one uninterrupted synchronous block. No paint, no microtask, and no style recalc can land in the middle of it, so no ordering of those three statements is observable.setDirtyschedules, it does not draw.LGraphCanvas.ts:2364-2366is three lines setting thedirty_canvas/dirty_bgcanvasflags; the actual draw happens later in the render loop. There is no synchronous paint to catch a stale attribute.- Nothing reads
dataset.colorPalettefrom JS anywhere in the repo. The only write iscolorPaletteService.ts:279; every consumer is a CSS attribute selector. And the only two watchers oncolorPaletteStore.activePaletteId—GraphCanvas.vue:436(→settingStore.set) andWidgetLegacy.vue:69(→draw) — are both default pre flush. There is noflush: 'sync'watcher on that ref, which is the one thing that would have fired between lines 278 and 279 and seen the old attribute.
So: no one-frame flash of the previous palette's sidebar is possible, and the question is closed for the CSS surfaces as well as the canvas. For the _pattern move there is not even a question — _pattern is a litegraph pattern cache and the block it swapped with writes only document.documentElement.style; the two touch nothing in common.
The conflict-avoidance claim checks out, and it was the better call
This is worth crediting explicitly, because I verified it rather than assuming it. I ran the three-way merge of colorPaletteService.ts against main both ways (base 481b5a60, theirs 46e5ce1e):
- old ordering (
ac888bf1): 2 conflicts - new ordering (
15d8e0bd): 0 conflicts, and the auto-merge output is byte-identical to the file at the head SHA.
That second half is the useful part: it proves the merge at a9a45557 was purely mechanical. Nothing was hand-edited, nothing from this branch was dropped, and nothing of main's was overwritten. The mechanism is also exactly as described — the added rootStyle block had been inserted between lines of main's contiguous app.canvas.* run (note _pattern = undefined is main's own line, not an addition of this branch), which split the rename hunk from #19143 in two. Moving the block below that run restored contiguity and the rename applied cleanly. Deliberately reshaping a diff to avoid a conflict instead of resolving one is the preferable outcome here, and it kept the --staged/MERGE_HEAD defect in #20795 out of the picture entirely.
useApp() now appearing ~5 times in a row in loadLiteGraphColorPalette matches main — loadLinkColorPalette already does useApp().canvas.default_connection_color_byType on main. The merge introduced no inconsistency, so I am not flagging it.
Findings (all TRIVIAL)
- Relative colour syntax has no
@supportsguard or literal fallback —style.css:173-177. Carried from cycle 1, unaddressed. Inline. Includes a measurement that clears the alpha concern I went looking for. --canvas-clear-backgroundis set unconditionally, including in the background-image branch where litegraph is deliberately givenclear_background_color = 'transparent'—colorPaletteService.ts:163. Pre-existing in the diff; I did not raise it in cycle 1. Inline.- The new ordering's safety rests on an invisible invariant —
loadColorPalettemust contain noawaitabove line 279, in a function declaredasync. New this cycle. Inline. .gitignorescope drift —.claude/launch.jsonis unrelated to a palette PR. Inline.- PR #13842, which this replaces, is still open. Confirmed still
open. Housekeeping only — close it when this merges.
Checked and cleared
- Contrast, re-derived from the tokens at this SHA (sRGB relative luminance, WCAG 2.x). Dark sidebar
#111112on white 18.87:1; dark canvas#09090aon white 19.90:1; arc canvas#151820on#fff17.75:1; github#06090eon#e5eaf016.48:1; nord#080d13on#e5eaf016.11:1; light canvaslightgrayon#22210.63:1. Solarized's two new values: canvas#002631onfg-color#fdf6e314.73:1, and oninput-text#93a1a15.94:1. All pass AA for normal text. The--color-charcoal-900: #111111 → #111112token change moves contrast by 0.011, confirming cycle 1 — imperceptible. One correction to my own cycle-1 numbers: I reported light sidebar#f3f3f3on charcoal-800 as 14.83:1; it re-derives as 16.15:1. Both pass comfortably, so no verdict changes, but my earlier figure was wrong. - The alpha trap in relative colour syntax does not bite any shipped palette.
oklch(from <c> L C H)inherits the origin's alpha when alpha is unspecified, so a translucent--comfy-menu-bgwould yield a translucent sidebar and — via the--base-background-sunkenfallback — a translucentbodybackdrop that composites over browser white past 1.5x zoom, i.e. the exact defect this PR exists to fix. I checked all six shipped palettes:comfy-menu-bgis opaque hex in every one (#171718,#FFFFFF,#242730,#13171d,#161b22,#073642), and everyCLEAR_BACKGROUND_COLORis a valid CSS colour, soCSS.supportsis true and theoklchfallback on line 174 never fires in shipped content. For a user-imported custom palette with anrgba()menu background the sidebar would go translucent — but it already did before this PR, since.connected-sidebarwasvar(--comfy-menu-bg)directly. Not a regression, so not a finding. - Cascade and plumbing.
--sidebar-surfaceand--base-background-sunkenare declared in the unconditional:rootblock so every palette gets a value; the:root[data-color-palette='dark'|'light']overrides (0-2-0) correctly outrank it, which is why only arc/github/nord/solarized/custom use the derived value..dark-themenever redeclares either.--comfy-menu-bgis only ever declared on:root, so the relative-colour origin resolves against the right value.--canvas-clear-backgroundis written inloadLiteGraphColorPalettebefore the attribute write in both orderings, so when:root[data-color-palette] bodyfirst matches, the variable it reads is already set — no first-load flash either. SideToolbar.vue--comfy-menu-bg→--sidebar-surfaceis the one rendered consumer of the new token; confirmed it is the real sidebar surface and not dead code.- Merge completeness, as above — byte-identical to a mechanical auto-merge.
- The net file set is identical to cycle 1 — same 20 files. Nothing new appeared in the diff; the
.gitignore,ecsRendererToggle.spec.ts,solarized.jsonandSideToolbar.vuehunks were all already present atac888bf1.dismissWorkflowPopover()exists (browser_tests/fixtures/components/Topbar.ts:190) and is already used by other helpers. - CI: 132 check-runs enumerated via the check-runs API (not
gh pr checks). All unit shards and all 16 chromium Playwright shards green. One failure,playwright-tests-cloud-sharded (1, 4), wasagentAttachmentUpload.spec.tsfailing withroute.fulfill: Route is already handled!atfixtures/utils/workspaceMocks.ts:45— a route-interception race in the harness, not an assertion on any rendered surface. The identical failure occurs onmainat4d51fa71without this PR; thecloudproject greps/@cloud/and none of this PR's new tests carry that tag; and the shard re-ran green on attempt 2. Not attributable to this diff. server-factsdid not misfire this time. It is not a separate check-run at this head — it runs as a step insidelint-pr / lint, which passed, reportingno findings on changed lines in 2 file(s). The #20795 misattribution path is not reachable here because the PR workflow invokes--base <pull_request.base.sha>, not--staged, so the merge commit at the head does not dragmain's code into the gate's view. The earlieruseMembersPanel.tsfindings did not recur. The--staged/MERGE_HEADdefect still exists for anyone who does hit it, but it is tracked in #20795 and is not this PR's to fix.
Not verified
- I did not visually verify the rendered surfaces, and the screenshot suite is not evidence here. The 8 regenerated baselines are byte-identical to cycle 1 — none were regenerated again this cycle. More importantly, every colour change in this PR measures below Playwright's default
threshold: 0.2(no override inplaywright.config.ts): composited old-vs-new background tiles come out at 0 diff pixels for dark, arc, nord and github, and the regenerated baselines I decoded are 0 diff pixels against their previous versions. So a green screenshot run neither confirms nor refutes this change, and conversely the un-regenerated canvas baselines will keep passing despite the canvas being a different colour. Someone should look at the five palettes with their eyes before this ships. This is the same limitation I declared in cycle 1; it has not improved. - No unit or browser tests run locally. Node here is v25.9.0 against a required
>=26.8.2 <27, so ~32 unit files fail collection onfile:///icons/*.svg, andbrowser_tests/needs a running ComfyUI backend. CI is the verifier for both. - The
oklch(from ...)alpha-inheritance and serialisation behaviour was measured in Chromium only; I did not check other engines.
Exposure
Theme/surface change across five palettes in the editor: catalogue entries (5 palette JSONs) plus cosmetic restyling of existing chrome (sidebar surface, body backdrop). No new app and no new feature surface on an existing page. No feature flag gates this change and none is touched — no flag check, default or targeting appears in the diff. Rollout state is unknown from the repository.
| --interface-menu-stroke: var(--color-smoke-600); | ||
| --interface-panel-surface: var(--color-white); | ||
| --interface-stroke: var(--color-smoke-300); | ||
| --sidebar-surface: oklch(from var(--comfy-menu-bg) calc(l - 0.0274) c h); |
There was a problem hiding this comment.
TRIVIAL (carried from cycle 1, unaddressed) — these two declarations are the repo's first use of CSS relative colour syntax with no @supports guard and no literal fallback. Scope is narrower than it looks: the :root[data-color-palette='dark'|'light'] blocks below override --sidebar-surface with literal tokens, so only arc/github/nord/solarized/custom palettes consume the derived value. color-mix() is already used in 16 files, and oklch(from ...) already appears elsewhere in this file on main, so engine support is not really the worry.
One thing I did chase and can clear for you, since it is the non-obvious hazard with this syntax: oklch(from <c> L C H) inherits the origin colour's alpha when alpha is unspecified. A translucent --comfy-menu-bg would therefore give a translucent sidebar and, through the --base-background-sunken fallback, a translucent body backdrop that composites over browser white past 1.5x zoom — precisely the defect this PR fixes. I checked all six shipped palettes: comfy-menu-bg is opaque hex in every one, and every CLEAR_BACKGROUND_COLOR is a valid CSS colour so CSS.supports is true and the line-174 fallback never fires in shipped content. A user-imported palette with an rgba() menu background would go translucent, but it already did before this PR when .connected-sidebar read var(--comfy-menu-bg) directly — so not a regression. Pinning alpha (... c h / 100%) would make that robust, but it is genuinely optional and your call.
|
|
||
| // Past 1.5x zoom LiteGraph stops filling its clear background. | ||
| const rootStyle = document.documentElement.style | ||
| if (CSS.supports('color', palette.CLEAR_BACKGROUND_COLOR)) { |
There was a problem hiding this comment.
TRIVIAL — --canvas-clear-background is set unconditionally, including on the path eight lines above where Comfy.Canvas.BackgroundImage is set and litegraph is deliberately given clear_background_color = 'transparent'. In that branch the variable names a colour the canvas never clears with, and body's backdrop behind a user's custom canvas image changes from --bg-color to the palette clear colour.
I am not calling this a defect: with an opaque covering image nothing shows, and with a transparent PNG the visible result goes from #202020 to #09090a on dark — both dark greys, arguably an improvement. It is an intent mismatch rather than a visual bug. Moving the setProperty into the else branch would match the surrounding logic if you want it tidy. Pre-existing in the diff; I did not raise it in cycle 1, so it is not a new objection.
| useApp().canvas.setDirty(true, true) | ||
|
|
||
| colorPaletteStore.activePaletteId = colorPaletteId | ||
| document.documentElement.dataset.colorPalette = colorPaletteId |
There was a problem hiding this comment.
TRIVIAL — this ordering is correct, and I verified it rather than reasoning about it: setDirty only sets the dirty_canvas/dirty_bgcanvas flags (LGraphCanvas.ts:2364-2366) so there is no synchronous draw, the only two watchers on activePaletteId are default pre flush (GraphCanvas.vue:436, WidgetLegacy.vue:69) so neither fires between lines 278 and 279, and nothing in the repo reads dataset.colorPalette from JS at all — every consumer is a CSS attribute selector. No stale-attribute paint is possible.
The reason it is safe, though, is that loadColorPalette contains no await anywhere above this line, so lines 265-279 are one uninterrupted synchronous block. That invariant is invisible and the function is declared async, which advertises the opposite. If anyone later adds an await above this write — a settings read, a dynamic import, an analytics call — a paint can land between the store write and the attribute write and flash the previous palette's sidebar for a frame. A one-line comment here saying the attribute write must stay in the same synchronous block as the CSS variable writes would protect it cheaply. Not worth blocking on.
There was a problem hiding this comment.
Taking the correction: my earlier comment said "within one synchronous function", and the two moves are in two different functions, loadLiteGraphColorPalette and loadColorPalette. My reason for the CSS surfaces was also incomplete — I argued the canvas reads clear_background_color from the palette object, which is true and says nothing about --canvas-clear-background or --sidebar-surface, both of which do key off data-color-palette.
The invariant you landed on is the real one and is worth more than what I wrote: loadColorPalette has no await above line 279 despite being async, so 265-279 is one uninterrupted block, and that is what makes the three statements unorderable. Checking the watchers on activePaletteId for a flush: 'sync' is the step I skipped, and it is the one that could have falsified it.
Agreed too that the invariant is invisible and the async signature advertises the opposite, so a comment pinning it is cheap insurance for whoever adds an await there later.
Generated by Claude Code
| *.local | ||
| # Claude configuration | ||
| .claude/*.local.json | ||
| .claude/launch.json |
There was a problem hiding this comment.
TRIVIAL — .claude/launch.json is unrelated to a palette/theme PR. It is correctly placed in the Claude block and genuinely needed if that file exists locally (the adjacent .claude/*.local.json glob does not match it), so it is harmless — just scope drift that makes this diff slightly harder to describe. Fine to leave; worth splitting out next time.
|
@DrJKL could you review this one when you get a chance? CI is green and there are no conflicts; it only needs a human approval. #15893 is stacked on top of it, and #20631 (Run button while payment is pending) is also waiting on your review. Generated by Claude Code |
|
@DrJKL one thing to know before you approve, since the ping above says "CI is green" — that is true, and it does not cover the part of this PR that can regress. The screenshot suite cannot see this change. So green CI here means "nothing broke that the suite can detect", not "the palettes look right". The useful thing a human can add that neither bot nor CI can is opening dark, light, arc, github, nord and solarized and looking at the sidebar and canvas in each. That is the only check standing between this and PROD for the visual side. Everything else is checked and clear, and my APPROVE at Five TRIVIALs are open and none blocks merging. The one worth a glance is |
The pre-commit gate that blocked your merge resolution is fixed on
|
dante01yoon
left a comment
There was a problem hiding this comment.
Reviewed a9a4555733dc525b53becbcb5c25964cacf0c665 as the author's replacement for the assigned fork PR #13842 (continuation comment 5895631208). The earlier scope concern is addressed: the old topbar/tab redesign is absent and the clipboard change is separate. No new blocking code finding on this head.
Own execution in an isolated checkout with its own frozen install:
- PASS 10 palette service/store tests, app and browser types, local production build, touched-file Oxlint/format/ESLint/stylelint, Knip and Fallow.
- PASS both committed backdrop browser cases on the exact-head production build against a real local CPU backend. Removing the new body CSS rule makes the palette case fail (
obsidian: expected 34/34/34, actual 36/36/36); removing the actualCSS.supportsguard in a separately compiled build makes the invalid-colour case fail with transparentrgba(0,0,0,0). The other case survives each mutation. Restoring the head gives 2/2 again. - Opened and visually inspected all six shipped palettes with a node graph loaded, and measured body/sidebar colours in Chromium. Dark, light, arc, github, nord and solarized each apply their own surfaces. This is executed visual evidence, independent of screenshot threshold or other reviewers' calculations.
- Probed the previously discussed translucent custom-clear path as well. In this controlled case the head's empty-canvas pixels were 4/4/4 at 1x and 9/9/9 at 2x; a pre-rule body-colour control gave 16/16/16 and 32/32/32. I did not reproduce the hypothesized white backdrop and am not reopening that accepted tradeoff as a new defect.
Unanchored — approval remains pending the existing rebase work: live GitHub reports CONFLICTING / DIRTY against current main (94c4a9a44e3e681eaa498380a89a674a2b84b717). Required checks are green for this head, but I have not validated a conflict-resolved combination with current main. Please request re-review on the updated head so the palette/CSS changes retained by that resolution can be checked. This is a merge-state limitation, not an inline code defect. I have not changed the shared source or PR branch.
NOT_RUN: combined-main validation, cross-browser runs, performance benchmarking, live Cloud/model execution, and reproduction of all Linux screenshot baselines. Controlled local browser checks above do not establish those results.
a9a4555 to
7155206
Compare
Summary
Replaces #13842, whose head lives on a fork. Same branch, brought up to date with
main; stacked on #15884 (merge order: #15884 → this → #15893).Gives the editor three depth levels per palette instead of one flat surface, and fixes the canvas backdrop past 1.5x zoom.
What this PR does and does not retint. The tab bar is the reference level and is unchanged here: it already paints the palette's own
--comfy-menu-bg, whichcolorPaletteServiceinlines on<html>. What this PR adds is the two levels below it, the connected sidebar one step down and the canvas two steps down. Nothing else in the editor chrome moves: the buttons, the workflow tabs, the account avatar, the batch counter and the queue group's0 activepill stay charcoal on every palette. Retinting those is #15893, stacked on top of this.Changes
--sidebar-surfaceand--base-background-sunkentokens: the connected sidebar sits one step below the menu surface (charcoal-900 on dark, smoke-100 on light, derived in OKLCH from--comfy-menu-bgfor every other palette).colorPaletteServicestampsdata-color-paletteon<html>and exposes--canvas-clear-background; past 1.5x zoom LiteGraph stops filling its clear background, so the body now paints the palette's ownCLEAR_BACKGROUND_COLORinstead of a mismatched grey. Solarized gains one.main: the 38px workflow tab bar and theinterface-stroke/50tab, sidebar and splitter dividers from feat: float workflow tabs and soften canvas dividers #18236. An earlier revision of this PR shrank the bar to 34px and added its own--region-stroke; both are gone so this lands on top of that design instead of competing with it.mainrebuilt the workflow tabs, topbar and canvas toolbar (feat: float workflow tabs and soften canvas dividers #18236, refactor: replace WorkflowTabs SelectButton with Tabs #18658), so the filled selected tab, hover-only close, icon-only Share and topbar padding changes were left tomain's versions.Review Focus
SideToolbar.vueonly swaps the background to--sidebar-surface; border and shadow aremain's.colorPalette.spec.tscovers the backdrop past 1.5x zoom, configuring palettes viatest.use({ initialSettings }).ecsRendererToggle.spec.tsnow dismisses the workflow tab preview popover before measuring text ink: at 50% zoom the popover covered the node title, and onmainthe test only passed because it measured the popover's text.Verification
Opened the editor in all six shipped palettes (dark, light, arc, github, nord, solarized) at
a9a4555and looked at the sidebar and canvas in each, with a node graph loaded. The screenshot suite cannot substitute for this:playwright.config.tssets nothreshold, so the default0.2swallows every colour shift here.data-color-palettelands.#111112/#09090A, light#f3f3f3/lightgray, arc and the other three derived in OKLCH from their own menu colour.Screenshots (if applicable)
See #13842 for the original per-palette before/after.