Skip to content

feat: apply charcoal palette surfaces and per-palette canvas backdrop - #19437

Open
mariana953 wants to merge 91 commits into
mainfrom
feat/topbar-theme-refresh
Open

mariana953 wants to merge 91 commits into
mainfrom
feat/topbar-theme-refresh

Conversation

@mariana953

@mariana953 mariana953 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

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, which colorPaletteService inlines 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's 0 active pill stay charcoal on every palette. Retinting those is #15893, stacked on top of this.

Changes

  • What:
    • --sidebar-surface and --base-background-sunken tokens: the connected sidebar sits one step below the menu surface (charcoal-900 on dark, smoke-100 on light, derived in OKLCH from --comfy-menu-bg for every other palette).
    • colorPaletteService stamps data-color-palette on <html> and exposes --canvas-clear-background; past 1.5x zoom LiteGraph stops filling its clear background, so the body now paints the palette's own CLEAR_BACKGROUND_COLOR instead of a mismatched grey. Solarized gains one.
    • Darker canvas clear colours (dark → charcoal-950) and a thin line grid for every palette.
  • Kept from main: the 38px workflow tab bar and the interface-stroke/50 tab, 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.
  • Dropped vs feat: apply charcoal palette and rework theme surfaces across the editor #13842: main rebuilt 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 to main's versions.

Review Focus

  • SideToolbar.vue only swaps the background to --sidebar-surface; border and shadow are main's.
  • colorPalette.spec.ts covers the backdrop past 1.5x zoom, configuring palettes via test.use({ initialSettings }).
  • ecsRendererToggle.spec.ts now dismisses the workflow tab preview popover before measuring text ink: at 50% zoom the popover covered the node title, and on main the test only passed because it measured the popover's text.
  • Screenshot expectations regenerated for the canvas colour and grid change; no functional test changes beyond the two above.

Verification

Opened the editor in all six shipped palettes (dark, light, arc, github, nord, solarized) at a9a4555 and looked at the sidebar and canvas in each, with a node graph loaded. The screenshot suite cannot substitute for this: playwright.config.ts sets no threshold, so the default 0.2 swallows every colour shift here.

  • All six apply. The sidebar and canvas change together, the sidebar reads one step above the canvas in every palette, and no palette keeps a surface from the one before it.
  • Reloading with a light palette saved shows no flash of the dark default. The first painted colour already belongs to the saved palette, then settles to the final backdrop once data-color-palette lands.
  • Sidebar vs canvas, measured: dark #111112 / #09090A, light #f3f3f3 / lightgray, arc and the other three derived in OKLCH from their own menu colour.
  • Two follow-ups found this way, neither blocking and both in fix(palettes): give nord its own surfaces and sink solarized's canvas #20842: nord's canvas is within 1.02 of github's, and solarized's prompt boxes land within 1.03 of its new canvas.

Screenshots (if applicable)

See #13842 for the original per-palette before/after.

mariana953 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.
@DrJKL
DrJKL dismissed webreviewer-bot’s stale review October 8, 2026 20:09

The base branch was changed.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 8, 2026
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>
@mariana953
mariana953 requested a review from DrJKL October 9, 2026 12:34

@webreviewer-bot webreviewer-bot 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.

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 against main before merging.
  • Seven snapshots are regenerated — three painter, two imageCompare, one linkVisibility, one lockedWidgetHoverColor. 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.ts gains assertions pinning the new backdrops to rgb(34,34,34), rgb(0,0,0) and rgb(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.

Copy link
Copy Markdown
Contributor Author

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 main right now.

The conflict. Only src/services/colorPaletteService.ts, and only because #19143 renamed app.canvas to useApp().canvas below scripts/app while this branch added lines using the old accessor. Resolution is mechanical: take main's accessor everywhere and keep both additions from this branch (the --canvas-clear-background root property, and document.documentElement.dataset.colorPalette). src/services/colorPaletteService.test.ts passes 3/3 against it and eslint on the file is clean.

What blocks the commit. The pre-commit hook runs pnpm lint:server-facts --staged, and scripts/server-fact-gate.ts with --staged diffs git diff --cached. A merge commit stages everything the merge brings in — 1428 files here — so the gate inspects main's code as though this PR had written it, and fails on six findings in src/platform/workspace/composables/useMembersPanel.ts (lines 168, 203, 205, 210, 222, 224). This branch does not touch that file; git diff origin/main -- <that file> on the merged tree is empty. Those lines are main's, and they are not this PR's to fix.

So the gate is sound on its own terms and wrong for this case: with --staged during a merge it has no way to tell incoming code from authored code. Diffing against MERGE_HEAD's merge base, or skipping while MERGE_HEAD exists, would fix it. That is a change to repo tooling and does not belong in a palette PR.

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 useMembersPanel.ts on main (a separate PR, and not mine to decide — the ADR's own remedy is pendingServerFact('BE-xxxx', ...) behind a backend ticket), or the hook change above, or someone with the repo's agreement to land the merge another way. Once the merge commit exists, the CI job is clean: it runs --base, whose merge base against a fully merged main excludes that file entirely.

The resolution, ready to apply:

-import { app } from '@/scripts/app'
+import { useApp } from '@/scripts/appInstance'

with the five remaining app.canvas occurrences in that file becoming useApp().canvas (lines 87, 150, 151, 154, 157, 169 and 277 on the merged file), and nothing else changed.

Separately, from the review above: #13842, which this replaces, is still open and worth closing.


Generated by Claude Code

@webreviewer-bot

Copy link
Copy Markdown
Collaborator

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. scripts/server-fact-gate.ts:18-19:

function diffArgs(argv: string[]): string[] {
  if (argv.includes('--staged')) return ['--cached']
  …
}

--staged resolves to git diff --cached, and there is no MERGE_HEAD handling anywhere in the script — nothing that distinguishes a merge in progress from ordinary staged work. A merge commit stages every incoming file, so --cached returns all of them and isGatedPath then flags whatever main happens to contain in a gated path as though this branch wrote it. useMembersPanel.ts is not among this PR's 20 changed files, so those six findings cannot be yours.

Your refusal to skip the hook was the right call, and the two remedies you name are the right shape: diff against MERGE_HEAD's merge base, or skip while MERGE_HEAD exists. Either belongs in repo tooling, not in a palette PR.

This is a pattern worth someone owning

The same gate has produced three distinct false failures in roughly a day, all with misleading diagnostics:

  1. feat(website): footer redesign with social icon row #20683 — lint-pr / server-facts failed because the gate's own script arrived on main after the branch point, and the workflow checks out the head ref rather than the merge result. pnpm was asked to run a script absent from the branch and exited 1. Fix was to merge main in.
  2. fix(website): align the Hub with the site design system #20333 — identical, same cause, same fix. I verified both by checking package.json and scripts/server-fact-gate.ts presence at each ref.
  3. This PR — the --staged path attributing main's code to the author during a merge.

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 --staged should know about MERGE_HEAD.

On this PR

My APPROVE at ac888bf1 stands and is unaffected — it rests on source reading and computed contrast, not on CI. The resolution you have posted is mechanical and matches what I would expect: main's useApp().canvas accessor throughout, keeping both of this branch's additions. I have not applied or run it; I review and do not push.

The two TRIVIALs from my review are unchanged — --sidebar-surface has no fallback for the relative colour syntax this PR introduces to the repo, and #13842 is still open and worth closing, which you flagged too.

Copy link
Copy Markdown
Contributor Author

Superseding my earlier comment: this is no longer blocked, and it was solved better than by resolving the conflict.

15d8e0b moves this branch's two added blocks off the app.canvas lines that #19143 renamed — _pattern = undefined goes above the root-style block, and the dataset.colorPalette write goes below setDirty. With no overlapping hunks left, the merge in a9a4555 applied main's useApp() rename on its own, so there was no conflict to resolve and nothing for the pre-commit gate to misattribute. Head is a9a4555, mergeable, CI running.

Both moves are within one synchronous function with no paint or watcher flush between the lines, and the canvas reads clear_background_color from the palette object rather than from data-color-palette, so the reordering is behaviour-preserving.

The gate defect itself still stands for anyone who does hit a conflict here: --staged has no MERGE_HEAD handling, so a merge commit's staged set gets inspected as authored code. Worth fixing in repo tooling independently of this PR.


Generated by Claude Code

@datadog-official

datadog-official Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7155206 | Docs | Give us feedback!

@webreviewer-bot webreviewer-bot 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.

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:

  1. loadColorPalette contains no await at all, despite being declared async. All five load* helpers it calls are synchronous, settingStore.get is synchronous, and the wrapWithErrorHandlingAsync wrapper does return await action(...args) — the await sits 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.
  2. setDirty schedules, it does not draw. LGraphCanvas.ts:2364-2366 is three lines setting the dirty_canvas / dirty_bgcanvas flags; the actual draw happens later in the render loop. There is no synchronous paint to catch a stale attribute.
  3. Nothing reads dataset.colorPalette from JS anywhere in the repo. The only write is colorPaletteService.ts:279; every consumer is a CSS attribute selector. And the only two watchers on colorPaletteStore.activePaletteId — GraphCanvas.vue:436 (→ settingStore.set) and WidgetLegacy.vue:69 (→ draw) — are both default pre flush. There is no flush: '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)

  1. Relative colour syntax has no @supports guard 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.
  2. --canvas-clear-background is set unconditionally, including in the background-image branch where litegraph is deliberately given clear_background_color = 'transparent' — colorPaletteService.ts:163. Pre-existing in the diff; I did not raise it in cycle 1. Inline.
  3. The new ordering's safety rests on an invisible invariant — loadColorPalette must contain no await above line 279, in a function declared async. New this cycle. Inline.
  4. .gitignore scope drift — .claude/launch.json is unrelated to a palette PR. Inline.
  5. 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 #111112 on white 18.87:1; dark canvas #09090a on white 19.90:1; arc canvas #151820 on #fff 17.75:1; github #06090e on #e5eaf0 16.48:1; nord #080d13 on #e5eaf0 16.11:1; light canvas lightgray on #222 10.63:1. Solarized's two new values: canvas #002631 on fg-color #fdf6e3 14.73:1, and on input-text #93a1a1 5.94:1. All pass AA for normal text. The --color-charcoal-900: #111111 → #111112 token change moves contrast by 0.011, confirming cycle 1 — imperceptible. One correction to my own cycle-1 numbers: I reported light sidebar #f3f3f3 on 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-bg would yield a translucent sidebar and — via the --base-background-sunken fallback — a translucent body backdrop 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-bg is opaque hex in every one (#171718, #FFFFFF, #242730, #13171d, #161b22, #073642), and every CLEAR_BACKGROUND_COLOR is a valid CSS colour, so CSS.supports is true and the oklch fallback on line 174 never fires in shipped content. For a user-imported custom palette with an rgba() menu background the sidebar would go translucent — but it already did before this PR, since .connected-sidebar was var(--comfy-menu-bg) directly. Not a regression, so not a finding.
  • Cascade and plumbing. --sidebar-surface and --base-background-sunken are declared in the unconditional :root block 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-theme never redeclares either. --comfy-menu-bg is only ever declared on :root, so the relative-colour origin resolves against the right value. --canvas-clear-background is written in loadLiteGraphColorPalette before the attribute write in both orderings, so when :root[data-color-palette] body first matches, the variable it reads is already set — no first-load flash either.
  • SideToolbar.vue --comfy-menu-bg → --sidebar-surface is 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.json and SideToolbar.vue hunks were all already present at ac888bf1. 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), was agentAttachmentUpload.spec.ts failing with route.fulfill: Route is already handled! at fixtures/utils/workspaceMocks.ts:45 — a route-interception race in the harness, not an assertion on any rendered surface. The identical failure occurs on main at 4d51fa71 without this PR; the cloud project 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-facts did not misfire this time. It is not a separate check-run at this head — it runs as a step inside lint-pr / lint, which passed, reporting no 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 drag main's code into the gate's view. The earlier useMembersPanel.ts findings did not recur. The --staged/MERGE_HEAD defect 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 in playwright.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 on file:///icons/*.svg, and browser_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);

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.

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

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.

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

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.

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.

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.

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

Comment thread .gitignore
*.local
# Claude configuration
.claude/*.local.json
.claude/launch.json

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.

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.

Copy link
Copy Markdown
Contributor Author

@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

@webreviewer-bot

Copy link
Copy Markdown
Collaborator

@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. playwright.config.ts sets no threshold, so Playwright's default 0.2 swallows every colour shift here. Measured at this head: composited old-vs-new background tiles come out at 0 diff pixels for dark, arc, nord and github, and the 8 regenerated baselines in this PR are 0-diff against their previous versions — they would have passed unchanged, so the regeneration is churn rather than evidence. The converse is the part that matters: canvas baselines that were not regenerated will keep passing while the canvas is a different colour.

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 a9a4555 stands: contrast re-derived for every moved and new value (all pass AA — dark sidebar 18.87:1, dark canvas 19.90:1, arc 17.75:1, github 16.48:1, nord 16.11:1, light canvas 10.63:1, solarized 14.73:1 / 5.94:1), the oklch(from …) alpha-inheritance trap cleared for all six shipped palettes, and the merge verified mechanical — three-way merge of colorPaletteService.ts goes from 2 conflicts under the old ordering to 0 under the new one, with the auto-merge output byte-identical to the head file, so nothing was hand-edited or dropped from either side.

Five TRIVIALs are open and none blocks merging. The one worth a glance is colorPaletteService.ts:279: the new line ordering is correct, but its correctness depends on there being no await above it inside an async function that currently has none. Adding one later would reintroduce the problem silently, which is why a comment there would be cheap insurance.

@webreviewer-bot

Copy link
Copy Markdown
Collaborator

The pre-commit gate that blocked your merge resolution is fixed on main

@mariana953 you reported on 12 October that you could not commit the conflict resolution here because pnpm lint:server-facts --staged diffed git diff --cached with no awareness of an in-progress merge, so a merge commit staged all 1,428 incoming files and the gate flagged six findings in useMembersPanel.ts — a file this branch never touches. I verified that mechanism from the script at the time and agreed your refusal to skip the hook was right.

scripts/server-fact-gate.ts on main now does what you proposed. Current source:

function stagedDiffArgs(): string[] {
  try {
    return ['--cached', git(['rev-parse', '--verify', 'MERGE_HEAD']).trim()]
  } catch {
    return ['--cached']
  }
}

function diffArgs(argv: string[]): string[] {
  if (argv.includes('--staged')) return stagedDiffArgs()
  …

So --staged now probes for MERGE_HEAD and, when a merge is in progress, diffs the staged tree against the incoming commit rather than against nothing — which excludes main's arriving files from attribution. With no merge in progress it falls back to the previous plain --cached, so ordinary commits behave as before. That is the first of the two remedies you named, and it is the one that does not require skipping anything.

The file's whole history is two commits, so the change arrived in cb4c768e ("validation: website fast lane", #20155). I have read this rather than run it — the honest test is you attempting the merge and seeing whether the hook passes, which costs you one attempt.

Nothing else is waiting on me. My APPROVE at a9a45557 still stands, and reviewDecision reads empty only because this branch is CONFLICTING, not because anything of mine is outstanding. The two TRIVIALs from that review are unchanged and non-blocking: --sidebar-surface has no fallback for the oklch(from …) relative-colour syntax this PR introduces to the repo (dark and light override it literally, so only arc/github/nord/solarized/custom use the derived value), and #13842 — which this replaces — is still open and worth closing.

One thing I would re-check after you resolve, since main has moved a long way in six days: my review noted seven regenerated snapshots that I deliberately did not visually verify, and I said a visual pass from me would be invalidated by the rebase. That is now doubly true. If the resolution touches them again, someone should confirm each difference is attributable to the surface and clear-colour changes and nothing else — regenerated baselines are how a visual regression ships quietly, and the editor's screenshot suite cannot see a colour shift of this size in any case.

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

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 actual CSS.supports guard in a separately compiled build makes the invalid-colour case fail with transparent rgba(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.

This branch was previously deployed

1 inactive (outdated) deployment
website-approval — a9a45557 Deployed Oct 13, 2026 by mariana953 via fast-lane #640
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) webreviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants