From 14a4fdb9ab2d28f643039b890d7aa842b76e157a Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Fri, 30 Oct 2026 03:49:24 -0700 Subject: [PATCH 001/132] refactor(theme): bind Tailwind colors to the active desktop theme (#1811) --- .../src/assets/design-system-theme.css | 34 ++++++++++++ src/renderer/src/assets/main.css | 54 ++++--------------- .../src/views/comfyUISettings/SnapshotRow.vue | 4 +- .../views/comfyUISettings/SnapshotsView.vue | 8 +-- 4 files changed, 51 insertions(+), 49 deletions(-) diff --git a/src/renderer/src/assets/design-system-theme.css b/src/renderer/src/assets/design-system-theme.css index d2181ffc1..49bd65e38 100644 --- a/src/renderer/src/assets/design-system-theme.css +++ b/src/renderer/src/assets/design-system-theme.css @@ -11,6 +11,8 @@ @theme static { --font-inter: 'Inter', system-ui, sans-serif; + --font-sans: 'Inter', system-ui, sans-serif; + --font-display: 'PP Formula', 'Inter', system-ui, sans-serif; --color-background: oklch(0.19 0.003 285); --color-foreground: oklch(0.955 0.002 285); @@ -94,3 +96,35 @@ } } } + +/* Legacy Tailwind color names follow the same runtime variables as the + * remaining component CSS. `inline` resolves them on the styled element, + * including nested dark surfaces and the launcher's forced-dark panel. + * New components can use the design-system roles above directly. */ +@theme inline { + --color-bg: var(--bg); + --color-text: var(--text); + --color-text-muted: var(--text-muted); + --color-accent-hover: var(--accent-hover); + --color-selected: var(--selected); + --color-surface: var(--surface); + --color-border-hover: var(--border-hover); + --color-danger: var(--danger); + --color-danger-hover: var(--danger-hover); + --color-terminal-bg: var(--terminal-bg); + + --color-neutral-50: var(--neutral-50); + --color-neutral-100: var(--neutral-100); + --color-neutral-200: var(--neutral-200); + --color-neutral-300: var(--neutral-300); + --color-neutral-400: var(--neutral-400); + --color-neutral-500: var(--neutral-500); + --color-neutral-600: var(--neutral-600); + --color-neutral-700: var(--neutral-700); + --color-neutral-800: var(--neutral-800); + --color-neutral-900: var(--neutral-900); + --color-neutral-950: var(--neutral-950); + + --color-comfy-yellow: var(--comfy-yellow); + --color-focus-ring: var(--focus-ring); +} diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index 1790b0aab..b0fd13bc2 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -37,46 +37,14 @@ * When the font is absent the --font-display stack falls back to Inter. The * file is fetched at build time from a private bucket (scripts/fetch-font.mjs). */ -/* - * Design tokens from renderer/styles.css — extracted into CSS custom properties - * and Tailwind @theme for the Vue rework. These bridge the old CSS class names - * used by components until full Tailwind utility class migration. - */ - -@theme { - --font-sans: 'Inter', system-ui, sans-serif; - --font-display: 'PP Formula', 'Inter', system-ui, sans-serif; - --color-bg: #202020; - --color-text: #ffffff; - --color-text-muted: #8a8a8a; - --color-accent-hover: #93c5fd; - --color-selected: rgba(255, 255, 255, 0.85); - --color-surface: #262729; - --color-border-hover: #3c3d42; - --color-danger: #e05858; - --color-danger-hover: #ef6b6b; - --color-terminal-bg: #111112; - - /* Comfy brand neutral ramp — single canonical scale. Yellow at 50, - * warm grays through deep ink at 950. Earlier brand-* / gray-* / gv-* - * ramps are retired; reference --color-neutral-* (or the semantic - * aliases below) from here on out. */ - --color-neutral-50: #f2ff59; - --color-neutral-100: #c2bfb9; - --color-neutral-200: #a6a2a1; - --color-neutral-300: #8a8688; - --color-neutral-400: #6f6970; - --color-neutral-500: #534d57; - --color-neutral-600: #37303f; - --color-neutral-700: #2c2533; - --color-neutral-800: #211927; - --color-neutral-900: #19131d; - --color-neutral-950: #100c13; - - /* Semantic aliases — what the role IS, not what the value is. Lets us - * recolor by re-pointing the alias instead of grepping every site. */ - --color-comfy-yellow: var(--color-neutral-50); - --color-focus-ring: var(--color-neutral-100); +/* Exact colors still read directly by legacy components. Keep these separate + * from the Tailwind aliases, which follow the active theme. Remove each one + * when its remaining consumers migrate to the design system. */ +:root { + --legacy-color-bg: #202020; + --legacy-color-text: #ffffff; + --legacy-color-text-muted: #8a8a8a; + --legacy-color-surface: #262729; } /* Theme definitions — matched to ComfyUI frontend design system */ @@ -90,7 +58,7 @@ --selected: rgba(255, 255, 255, 0.85); --surface: #29252c; --titlebar-bg: var(--neutral-800); - --titlebar-icon: var(--color-text-muted); + --titlebar-icon: var(--legacy-color-text-muted); --border: #494a50; --border-hover: #3c3d42; --danger: #e05858; @@ -191,7 +159,7 @@ --selected: rgba(0, 0, 0, 0.7); --surface: #e9e9e9; --titlebar-bg: #171718; - --titlebar-icon: var(--color-text-muted); + --titlebar-icon: var(--legacy-color-text-muted); --border: #b4b4b4; --border-hover: #d9d9d9; --danger: #f75951; @@ -526,7 +494,7 @@ button.looks-disabled { font-size: var(--takeover-fs-title); line-height: 1.15; letter-spacing: 0; - color: var(--color-text); + color: var(--legacy-color-text); opacity: 0.85; text-align: center; } diff --git a/src/renderer/src/views/comfyUISettings/SnapshotRow.vue b/src/renderer/src/views/comfyUISettings/SnapshotRow.vue index 9b82a98bc..f9f5bb341 100644 --- a/src/renderer/src/views/comfyUISettings/SnapshotRow.vue +++ b/src/renderer/src/views/comfyUISettings/SnapshotRow.vue @@ -249,7 +249,7 @@ const hasTitlePill = computed(() => !!titlePillText.value) border-radius: 999px; font-size: 11px; line-height: 16px; - background: var(--color-bg); + background: var(--legacy-color-bg); color: var(--text-muted); white-space: nowrap; } @@ -330,7 +330,7 @@ const hasTitlePill = computed(() => !!titlePillText.value) padding: 1px 6px; font-size: 11px; color: var(--text-muted); - background: var(--color-bg); + background: var(--legacy-color-bg); border-radius: 3px; white-space: nowrap; } diff --git a/src/renderer/src/views/comfyUISettings/SnapshotsView.vue b/src/renderer/src/views/comfyUISettings/SnapshotsView.vue index 0082baf0e..c53c2fa7c 100644 --- a/src/renderer/src/views/comfyUISettings/SnapshotsView.vue +++ b/src/renderer/src/views/comfyUISettings/SnapshotsView.vue @@ -1103,7 +1103,7 @@ async function handleImport(): Promise { .snapshots-rail-dot.is-state { background: var(--warning); border-radius: 7px; - border: 2px solid var(--color-surface); + border: 2px solid var(--legacy-color-surface); } .snapshots-rail-dot.is-muted { @@ -1113,16 +1113,16 @@ async function handleImport(): Promise { /* Restore in-flight — rotating conic ring, matching the picker row's spinner. */ .snapshots-rail-dot.is-spinning { background: conic-gradient(var(--brand-accent, #f5c518) 270deg, transparent 270deg); - border: 2px solid var(--color-surface); + border: 2px solid var(--legacy-color-surface); animation: snapshots-rail-dot-spin 0.8s linear infinite; } .snapshots-rail-dot.is-restored { background: var(--success, #34c759); - border: 2px solid var(--color-surface); + border: 2px solid var(--legacy-color-surface); } .snapshots-rail-dot.is-error { background: var(--danger, #ef4444); - border: 2px solid var(--color-surface); + border: 2px solid var(--legacy-color-surface); } @keyframes snapshots-rail-dot-spin { to { From 3cbd805d1c21540fe078d343d3939bc07cc3fc42 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Fri, 30 Oct 2026 03:49:25 -0700 Subject: [PATCH 002/132] refactor(ui): migrate alert dialogs to Tailwind and shared buttons (#1812) --- src/renderer/src/assets/palette-void.css | 2 +- .../src/components/ui/BaseAlert.test.ts | 14 +- src/renderer/src/components/ui/BaseAlert.vue | 335 +++++------------- 3 files changed, 94 insertions(+), 257 deletions(-) diff --git a/src/renderer/src/assets/palette-void.css b/src/renderer/src/assets/palette-void.css index 821aeb235..6bef8e8b4 100644 --- a/src/renderer/src/assets/palette-void.css +++ b/src/renderer/src/assets/palette-void.css @@ -360,7 +360,7 @@ } /* ── 9. Dialogs: 16px panels ───────────────────────────────────────── */ -:root.palette-void :is(.modal-box, .base-modal-panel, .base-alert-panel, .announce-content) { +:root.palette-void :is(.modal-box, .base-modal-panel, .announce-content) { border-color: var(--color-border); border-radius: var(--radius-panel); } diff --git a/src/renderer/src/components/ui/BaseAlert.test.ts b/src/renderer/src/components/ui/BaseAlert.test.ts index f2b035add..0bede5225 100644 --- a/src/renderer/src/components/ui/BaseAlert.test.ts +++ b/src/renderer/src/components/ui/BaseAlert.test.ts @@ -123,18 +123,16 @@ describe('BaseAlert', () => { expect(wrapper.emitted('close')).toBeUndefined() }) - it('applies primary tone class by default', () => { + it('uses the inverted action variant by default', () => { const wrapper = mountAlert({ showCancel: true }) const action = wrapper.find('[data-testid="base-alert-action"]') - expect(action.classes()).toContain('primary') - expect(action.classes()).not.toContain('danger-solid') + expect(action.attributes('data-variant')).toBe('inverted') }) - it('applies danger tone class when tone="danger"', () => { + it('uses the destructive action variant when tone="danger"', () => { const wrapper = mountAlert({ showCancel: true, tone: 'danger' }) const action = wrapper.find('[data-testid="base-alert-action"]') - expect(action.classes()).toContain('danger-solid') - expect(action.classes()).not.toContain('primary') + expect(action.attributes('data-variant')).toBe('destructive') }) it('renders a secondary button between Cancel and Primary when secondaryLabel is set', () => { @@ -162,14 +160,14 @@ describe('BaseAlert', () => { expect(wrapper.emitted('cancel')).toBeUndefined() }) - it('applies danger tone to the secondary button when secondaryTone="danger"', () => { + it('uses the destructive secondary variant when secondaryTone="danger"', () => { const wrapper = mountAlert({ secondaryLabel: 'Close & Launch', secondaryTone: 'danger', showCancel: false }) const secondary = wrapper.find('[data-testid="base-alert-secondary"]') - expect(secondary.classes()).toContain('danger-solid') + expect(secondary.attributes('data-variant')).toBe('destructive') }) it('renders the header close icon when showCloseIcon is true', () => { diff --git a/src/renderer/src/components/ui/BaseAlert.vue b/src/renderer/src/components/ui/BaseAlert.vue index 42d7b1c2e..74fdd76aa 100644 --- a/src/renderer/src/components/ui/BaseAlert.vue +++ b/src/renderer/src/components/ui/BaseAlert.vue @@ -1,6 +1,7 @@ - - diff --git a/src/renderer/src/components/ui/BaseInput.vue b/src/renderer/src/components/ui/BaseInput.vue index dc9327e79..e550b7d49 100644 --- a/src/renderer/src/components/ui/BaseInput.vue +++ b/src/renderer/src/components/ui/BaseInput.vue @@ -40,6 +40,9 @@ const slots = useSlots() const hasLeading = computed(() => !!slots.leading) const hasTrailing = computed(() => !!slots.trailing) +const slotButtonClass = + '[&_button]:inline-flex [&_button]:size-7 [&_button]:items-center [&_button]:justify-center [&_button]:rounded-md [&_button]:border-none [&_button]:bg-transparent [&_button]:p-0 [&_button]:text-text-muted [&_button]:cursor-pointer [&_button]:transition-[color,background-color] [&_button]:duration-[150ms] [&_button]:ease-[ease] [&_button:hover]:bg-border-hover [&_button:hover]:text-text [&_button:focus-visible]:text-text [&_button:focus-visible]:outline-2 [&_button:focus-visible]:[outline-style:solid] [&_button:focus-visible]:outline-[var(--accent-primary)] [&_button:focus-visible]:outline-offset-[-2px]' + function onInput(event: Event): void { emit('update:modelValue', (event.target as HTMLInputElement).value) } @@ -51,18 +54,35 @@ function onChange(event: Event): void { - - diff --git a/src/renderer/src/components/ui/BaseSelect.vue b/src/renderer/src/components/ui/BaseSelect.vue index ab54960e5..8a33a37b3 100644 --- a/src/renderer/src/components/ui/BaseSelect.vue +++ b/src/renderer/src/components/ui/BaseSelect.vue @@ -234,7 +234,7 @@ onBeforeUnmount(() => { - +
    {
  • { @mousemove="activeIndex = i" @click="selectIndex(i)" > - - {{ opt.label }} - {{ opt.description }} + + {{ opt.label }} + {{ opt.description }} - +
- - - - From 456c235d1f8e9b7bc25b6afa1cfd2545f81d46c8 Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Fri, 30 Oct 2026 03:49:26 -0700 Subject: [PATCH 005/132] refactor(ui): migrate modal and prompt primitives to Tailwind (#1816) --- src/renderer/src/assets/palette-void.css | 2 +- src/renderer/src/components/ui/BaseModal.vue | 151 ++++---------- src/renderer/src/components/ui/BasePrompt.vue | 186 ++++++------------ 3 files changed, 95 insertions(+), 244 deletions(-) diff --git a/src/renderer/src/assets/palette-void.css b/src/renderer/src/assets/palette-void.css index c728d0f9e..c0b095d6f 100644 --- a/src/renderer/src/assets/palette-void.css +++ b/src/renderer/src/assets/palette-void.css @@ -332,7 +332,7 @@ } /* ── 9. Dialogs: 16px panels ───────────────────────────────────────── */ -:root.palette-void :is(.modal-box, .base-modal-panel, .announce-content) { +:root.palette-void :is(.modal-box, .announce-content) { border-color: var(--color-border); border-radius: var(--radius-panel); } diff --git a/src/renderer/src/components/ui/BaseModal.vue b/src/renderer/src/components/ui/BaseModal.vue index a9406f2c3..4ba19b13e 100644 --- a/src/renderer/src/components/ui/BaseModal.vue +++ b/src/renderer/src/components/ui/BaseModal.vue @@ -1,6 +1,7 @@ - - diff --git a/src/renderer/src/components/ui/BasePrompt.vue b/src/renderer/src/components/ui/BasePrompt.vue index dabdb99b0..336aa8460 100644 --- a/src/renderer/src/components/ui/BasePrompt.vue +++ b/src/renderer/src/components/ui/BasePrompt.vue @@ -1,6 +1,7 @@ - - diff --git a/src/renderer/src/components/DetailSection.vue b/src/renderer/src/components/DetailSection.vue index 58cb5fb80..88af175bd 100644 --- a/src/renderer/src/components/DetailSection.vue +++ b/src/renderer/src/components/DetailSection.vue @@ -4,6 +4,7 @@ import { ref, reactive, watch, nextTick } from 'vue' import type { DetailItem, DetailField, DetailFieldOption, ActionDef } from '../types/ipc' import InfoTooltip from './InfoTooltip.vue' +import Button from '@comfyorg/design-system/button/Button' import TooltipWrap from './TooltipWrap.vue' import EnvVarsEditor from './EnvVarsEditor.vue' import { isOpenablePathString } from '../lib/openablePath' @@ -27,6 +28,29 @@ const props = withDefaults(defineProps(), { actions: undefined }) +const actionButtonClass = + '[appearance:button] rounded-lg border border-solid px-4 py-2 font-sans text-[14px] leading-[1.5] font-normal whitespace-normal transition-none disabled:pointer-events-auto disabled:cursor-default disabled:opacity-40 focus-visible:ring-0 focus-visible:outline-1 focus-visible:[outline-style:auto]' +const actionVariants = { + primary: 'inverted', + accent: 'outline', + danger: 'outline', + default: 'secondary' +} as const +const actionClasses = { + default: 'border-[var(--border)] bg-surface text-text hover:bg-[var(--border)]', + primary: + 'border-[var(--accent-primary)] bg-[var(--accent-primary)] text-background font-medium hover:border-[var(--accent-hover)] hover:bg-[var(--accent-hover)] hover:transition-[background,border-color] hover:duration-[120ms] hover:ease-[ease]', + accent: + 'border-[var(--accent)] bg-surface text-[var(--accent)] font-semibold hover:bg-[var(--accent)] hover:text-bg', + danger: 'border-danger bg-surface text-danger hover:bg-danger hover:text-bg' +} as const +const fieldControlClass = + 'w-full rounded-md border border-solid border-[var(--border)] bg-surface text-[14px] text-text outline-none focus:border-[var(--accent)] disabled:opacity-40' +const collapsibleTitleClass = + "inline-block cursor-pointer select-none before:mr-1 before:inline-block before:content-['▸'] before:transition-transform before:duration-150 before:ease-[ease]" +const openPathClass = + 'min-w-0 border-0 bg-transparent p-0 text-left text-[14px] text-text hover:bg-transparent hover:text-[var(--accent)] hover:underline focus-visible:bg-transparent focus-visible:text-[var(--accent)] focus-visible:underline focus-visible:outline-none' + const emit = defineEmits<{ 'run-action': [action: ActionDef, button: HTMLButtonElement | null] refresh: [sectionTitle: string] @@ -125,52 +149,78 @@ function handleOpenPath(value: unknown): void { - - diff --git a/src/renderer/src/views/comfyUISettings/BooleanToggle.vue b/src/renderer/src/views/comfyUISettings/BooleanToggle.vue index 1d5e83a7f..f31a87de5 100644 --- a/src/renderer/src/views/comfyUISettings/BooleanToggle.vue +++ b/src/renderer/src/views/comfyUISettings/BooleanToggle.vue @@ -1,6 +1,7 @@ - - diff --git a/src/renderer/src/views/comfyUISettings/EnvVarsField.vue b/src/renderer/src/views/comfyUISettings/EnvVarsField.vue index dfcea26f3..01f04c1a4 100644 --- a/src/renderer/src/views/comfyUISettings/EnvVarsField.vue +++ b/src/renderer/src/views/comfyUISettings/EnvVarsField.vue @@ -1,6 +1,7 @@ - - diff --git a/src/renderer/src/views/comfyUISettings/PathField.vue b/src/renderer/src/views/comfyUISettings/PathField.vue index db18369ec..92c4e9c64 100644 --- a/src/renderer/src/views/comfyUISettings/PathField.vue +++ b/src/renderer/src/views/comfyUISettings/PathField.vue @@ -1,6 +1,7 @@ - diff --git a/src/renderer/src/views/comfyUISettings/StorageDirRow.vue b/src/renderer/src/views/comfyUISettings/StorageDirRow.vue index fde101517..685f9a6d1 100644 --- a/src/renderer/src/views/comfyUISettings/StorageDirRow.vue +++ b/src/renderer/src/views/comfyUISettings/StorageDirRow.vue @@ -1,5 +1,6 @@ - - diff --git a/src/renderer/src/views/comfyUISettings/StoragePane.vue b/src/renderer/src/views/comfyUISettings/StoragePane.vue index 6a6934900..09bfaf140 100644 --- a/src/renderer/src/views/comfyUISettings/StoragePane.vue +++ b/src/renderer/src/views/comfyUISettings/StoragePane.vue @@ -1,6 +1,7 @@ - diff --git a/src/renderer/src/views/chooser/chooser-tiles.css b/src/renderer/src/views/chooser/chooser-tiles.css deleted file mode 100644 index 4934ef113..000000000 --- a/src/renderer/src/views/chooser/chooser-tiles.css +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Shared chooser-tile styles. - * - * Imported by ChooserView (for the New Install + Cloud tiles) and by - * ChooserInstallTile (for the per-install tiles) so the two surfaces - * render identical-looking tiles without duplicating the rules. - */ - -.chooser-tile { - /* Figma spec: 246 × 156.678 → aspect 246 / 156.678. Combined with - * the fixed-track grid in ChooserView, every tile renders at this - * exact size. */ - aspect-ratio: 246 / 156.678; - display: flex; - flex-direction: column; - align-items: flex-start; - justify-content: flex-end; - gap: 6px; - padding: 16px 18px; - border-radius: 12px; - border: 1px solid var(--chooser-surface-border); - background: var(--chooser-surface-bg); - cursor: pointer; - text-align: left; - font: inherit; - color: inherit; - position: relative; - transition: - background-color 120ms ease, - border-color 120ms ease, - transform 120ms ease; -} -.chooser-tile:hover, -.chooser-tile:focus-visible { - background: var(--chooser-surface-bg-hover); - border-color: var(--chooser-surface-border-hover); -} -/* Group-hover / -focus: lift the muted resting `--neutral-100` text / - * icon to full-strength `--text` so the tile reads as actively focused. - * Keyboard users get the same lift as mouse users. */ -.chooser-tile:hover .chooser-tile-icon, -.chooser-tile:focus-visible .chooser-tile-icon, -.chooser-tile:hover .chooser-tile-name, -.chooser-tile:focus-visible .chooser-tile-name, -.chooser-tile:hover .chooser-tile-meta, -.chooser-tile:focus-visible .chooser-tile-meta { - color: var(--text); -} -.chooser-tile:hover .chooser-tile-meta-line, -.chooser-tile:focus-visible .chooser-tile-meta-line, -.chooser-tile:hover .chooser-tile-meta-source, -.chooser-tile:focus-visible .chooser-tile-meta-source, -.chooser-tile:hover .chooser-tile-meta-sep, -.chooser-tile:focus-visible .chooser-tile-meta-sep, -.chooser-tile:hover .chooser-tile-recency-text, -.chooser-tile:focus-visible .chooser-tile-recency-text { - color: var(--text-muted); -} -.chooser-tile:hover .chooser-tile-icon, -.chooser-tile:focus-visible .chooser-tile-icon { - /* Drop the resting opacity so the icon matches the brightened text. */ - opacity: 1; -} -.chooser-tile:focus-visible { - outline: 2px solid var(--accent, #4a90e2); - outline-offset: 2px; -} - -.chooser-tile-icon { - position: absolute; - top: 14px; - left: 16px; - opacity: 0.85; - color: var(--neutral-100); -} - -.chooser-tile--install .chooser-tile-body { - margin-top: auto; - display: flex; - flex-direction: column; - gap: 4px; - width: 100%; - min-width: 0; -} - -.chooser-tile-name { - font-size: 16px; - font-weight: 600; - display: block; - color: var(--neutral-100); - /* Reserve space for the type icon at top-left so name doesn't collide - * (New-Install / Cloud tiles, where the icon is absolute). */ - margin-top: auto; - max-width: 100%; - min-width: 0; -} -.chooser-tile--install .chooser-tile-name { - margin-top: 0; -} - -.chooser-tile-meta-line { - font-size: 12px; - color: var(--text-faint); - display: block; - max-width: 100%; - min-width: 0; -} -.chooser-tile-meta-source { - color: var(--text-faint); -} -.chooser-tile-meta-sep { - margin: 0 5px; - color: var(--text-faint); -} -.chooser-tile-meta-version { - color: var(--text-muted); - font-weight: 500; -} -.chooser-tile:hover .chooser-tile-meta-version, -.chooser-tile:focus-visible .chooser-tile-meta-version { - color: var(--text); -} - -.chooser-tile-footer { - display: flex; - align-items: center; - gap: 8px; - width: 100%; - min-width: 0; -} -.chooser-tile-recency { - min-width: 0; -} -.chooser-tile-recency-text { - display: block; - font-size: 11px; - color: var(--text-faint); - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -/* New-Install / Cloud tiles: simple single-line text meta (no pills). */ -.chooser-tile-meta { - width: 100%; - min-width: 0; - font-size: 12px; - color: var(--neutral-100); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.chooser-tile-pill { - display: inline-flex; - align-items: center; - padding: 2px 8px; - border-radius: 999px; - background: var(--bg-elev-2, rgba(127, 127, 127, 0.14)); - border: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.18)); - font-size: 11px; - opacity: 0.9; - /* Single-line truncation so long source labels don't break tile - * layout. `min-width: 0` overrides the flex-child default that - * would otherwise block shrinkage below content width. */ - max-width: 100%; - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -/* Action pill (update / migrate) — pinned right in the footer row so it - * reads as the affordance, apart from the quiet recency text, and holds its - * width so the interactive label never truncates. */ -.chooser-tile-pill-action { - margin-left: auto; - flex-shrink: 0; -} - -/* Update-available pill — accent-blue tinted, click-target. */ -.chooser-tile-pill-update { - gap: 4px; - flex-shrink: 0; - color: var(--accent, #4a90e2); - background: var(--accent-soft, rgba(74, 144, 226, 0.12)); - border-color: var(--accent, #4a90e2); - opacity: 1; - cursor: pointer; - transition: - background-color 0.12s, - border-color 0.12s, - transform 0.12s; -} -.chooser-tile-pill-update:hover, -.chooser-tile-pill-update:focus-visible { - background: var(--accent-soft-hover, rgba(74, 144, 226, 0.22)); - outline: none; -} -.chooser-tile-pill-update:focus-visible { - outline: 2px solid var(--accent, #4a90e2); - outline-offset: 2px; -} - -/* Migrate-available pill — warning amber so it's distinct from update. */ -.chooser-tile-pill-migrate { - gap: 4px; - flex-shrink: 0; - color: var(--accent-warning, #d97706); - background: var(--accent-warning-soft, rgba(217, 119, 6, 0.12)); - border-color: var(--accent-warning, #d97706); - opacity: 1; - cursor: pointer; - transition: - background-color 0.12s, - border-color 0.12s, - transform 0.12s; -} -.chooser-tile-pill-migrate:hover, -.chooser-tile-pill-migrate:focus-visible { - background: var(--accent-warning-soft-hover, rgba(217, 119, 6, 0.22)); - outline: none; -} -.chooser-tile-pill-migrate:focus-visible { - outline: 2px solid var(--accent-warning, #d97706); - outline-offset: 2px; -} - -/* Disabled (gated) state for action pills — pill stays visible so the - * action is discoverable; click handlers no-op while gated. */ -.chooser-tile-pill-disabled { - opacity: 0.45; - cursor: default; -} -.chooser-tile-pill-disabled:hover, -.chooser-tile-pill-disabled:focus-visible { - background: var(--bg-elev-2, rgba(127, 127, 127, 0.14)); - outline: none; -} -.chooser-tile-pill-update.chooser-tile-pill-disabled:hover, -.chooser-tile-pill-update.chooser-tile-pill-disabled:focus-visible { - background: var(--accent-soft, rgba(74, 144, 226, 0.12)); -} -.chooser-tile-pill-migrate.chooser-tile-pill-disabled:hover, -.chooser-tile-pill-migrate.chooser-tile-pill-disabled:focus-visible { - background: var(--accent-warning-soft, rgba(217, 119, 6, 0.12)); -} - -/* Status treatment — the centered status pill / error badge (below) is - * the source of truth for lifecycle state. The tile chrome only quietly - * reinforces it: a running tile gets a slightly firmer resting border so - * it reads as "active" without the old 2px accent outline that looked - * "selected", and an errored tile gets a red outline. */ -.chooser-tile-running { - border-color: var(--chooser-surface-border-hover); -} -.chooser-tile-stopping { - opacity: 0.7; -} -.chooser-tile-errored { - border-color: var(--accent-danger, #d92d20); - box-shadow: inset 0 0 0 1px var(--accent-danger, #d92d20); -} - -/* Status pill — colored dot + label (e.g. "● Running") in the top-right - * cluster next to the kebab. Click-through so a running-tile body click - * still focuses the existing window. */ -.chooser-tile-status { - gap: 6px; - flex-shrink: 0; - opacity: 1; - pointer-events: none; -} -.chooser-tile-status-dot { - width: 8px; - height: 8px; - border-radius: 999px; - flex-shrink: 0; - background: currentColor; -} -.chooser-tile-status--running { - color: var(--success); -} -.chooser-tile-status--launching, -.chooser-tile-status--stopping { - color: var(--accent-warning, #d97706); -} -.chooser-tile-status--promoting { - color: var(--text-muted); -} -.chooser-tile-status--updating { - color: var(--text-muted); -} -.chooser-tile-updating { - cursor: wait; -} -.chooser-tile-status-spinner { - flex-shrink: 0; - animation: chooser-tile-status-spin 900ms linear infinite; -} -/* Launching pulses so an in-flight start reads as active, not parked. */ -.chooser-tile-status--launching .chooser-tile-status-dot { - animation: chooser-tile-status-pulse 1.2s ease-in-out infinite; -} -@keyframes chooser-tile-status-spin { - to { - transform: rotate(360deg); - } -} -@keyframes chooser-tile-status-pulse { - 0%, - 100% { - opacity: 1; - } - 50% { - opacity: 0.35; - } -} -@media (prefers-reduced-motion: reduce) { - .chooser-tile-status--launching .chooser-tile-status-dot, - .chooser-tile-status-spinner { - animation: none; - } -} - -/* Error badge — red, clickable; opens the error details. Lives in the - * top-right cluster next to the kebab. */ -.chooser-tile-error-badge { - display: inline-flex; - align-items: center; - gap: 4px; - padding: 3px 8px; - border-radius: 999px; - font: inherit; - font-size: 11px; - font-weight: 500; - cursor: pointer; - color: var(--accent-danger, #d92d20); - background: var(--accent-danger-soft, rgba(217, 45, 32, 0.12)); - border: 1px solid var(--accent-danger, #d92d20); - transition: - background-color 0.12s, - transform 0.12s; -} -.chooser-tile-error-badge:hover, -.chooser-tile-error-badge:focus-visible { - background: var(--accent-danger-soft-hover, rgba(217, 45, 32, 0.22)); - transform: scale(1.03); - outline: none; -} -.chooser-tile-error-badge:focus-visible { - outline: 2px solid var(--accent-danger, #d92d20); - outline-offset: 2px; -} - -/* Danger status tag — red, clickable pill for backend-flagged problem states - * (failed install / interrupted delete / missing folder). Same red treatment - * as the crash error badge; clicking opens the full explanation. */ -.chooser-tile-danger-tag { - display: inline-flex; - align-items: center; - gap: 4px; - flex-shrink: 0; - padding: 3px 8px; - border-radius: 999px; - font: inherit; - font-size: 11px; - font-weight: 500; - cursor: pointer; - color: var(--accent-danger, #d92d20); - background: var(--accent-danger-soft, rgba(217, 45, 32, 0.12)); - border: 1px solid var(--accent-danger, #d92d20); - max-width: 100%; - min-width: 0; - overflow: hidden; - white-space: nowrap; - transition: - background-color 0.12s, - transform 0.12s; -} -.chooser-tile-danger-tag:hover, -.chooser-tile-danger-tag:focus-visible { - background: var(--accent-danger-soft-hover, rgba(217, 45, 32, 0.22)); - transform: scale(1.03); - outline: none; -} -.chooser-tile-danger-tag:focus-visible { - outline: 2px solid var(--accent-danger, #d92d20); - outline-offset: 2px; -} - -/* Top-right cluster — lifecycle indicator (status pill / error badge) + - * kebab (⋮) action button. */ -.chooser-tile-actions { - position: absolute; - top: 8px; - right: 8px; - display: flex; - align-items: center; - gap: 4px; - z-index: 1; -} -.chooser-tile-kebab { - background: transparent; - border: 1px solid transparent; - border-radius: 6px; - padding: 4px; - color: inherit; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - opacity: 0.65; - transition: - background-color 100ms ease, - opacity 100ms ease, - border-color 100ms ease; -} -.chooser-tile-kebab:hover, -.chooser-tile-kebab:focus-visible { - background: var(--bg-elev-2, rgba(127, 127, 127, 0.18)); - border-color: var(--border-strong, rgba(127, 127, 127, 0.4)); - opacity: 1; - outline: none; -} diff --git a/src/renderer/src/views/chooser/chooserTileClasses.ts b/src/renderer/src/views/chooser/chooserTileClasses.ts new file mode 100644 index 000000000..fb8529c25 --- /dev/null +++ b/src/renderer/src/views/chooser/chooserTileClasses.ts @@ -0,0 +1,15 @@ +/** Shared geometry for the New Instance and installed-instance tiles. */ +export const chooserTileClass = + 'group/tile relative [&.tile-leave-active]:absolute [&.tile-leave-to]:opacity-0 [&.tile-enter-from]:opacity-0 flex aspect-[246/156.678] flex-col items-start justify-end gap-1.5 rounded-xl border border-solid border-[var(--tile-border,var(--chooser-surface-border))] bg-[var(--chooser-surface-bg)] px-[18px] py-4 text-left [font:inherit] text-inherit cursor-pointer transition-[background-color,border-color,transform] duration-[120ms] ease-[ease] hover:border-[var(--chooser-surface-border-hover)] hover:bg-[var(--chooser-surface-bg-hover)] focus-visible:border-[var(--chooser-surface-border-hover)] focus-visible:bg-[var(--chooser-surface-bg-hover)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)] focus-visible:[outline-style:solid]' + +export const chooserTileIconClass = + 'absolute top-3.5 left-4 text-neutral-100 opacity-[0.85] group-hover/tile:text-text group-hover/tile:opacity-100 group-focus-visible/tile:text-text group-focus-visible/tile:opacity-100' + +export const chooserTileNameClass = + 'block min-w-0 max-w-full text-[16px] font-semibold text-neutral-100 group-hover/tile:text-text group-focus-visible/tile:text-text' + +export const chooserTilePillClass = + 'inline-flex min-w-0 max-w-full items-center overflow-hidden rounded-[999px] border border-solid px-2 py-0.5 text-[11px] text-ellipsis whitespace-nowrap' + +export const chooserTileDangerClass = + 'inline-flex items-center gap-1 rounded-[999px] border border-solid border-[var(--accent-danger,#d92d20)] bg-[var(--accent-danger-soft,rgba(217,45,32,0.12))] px-2 py-[3px] text-[11px] font-medium text-[var(--accent-danger,#d92d20)] cursor-pointer transition-[background-color,transform] duration-[120ms] ease-[ease] hover:bg-[var(--accent-danger-soft-hover,rgba(217,45,32,0.22))] hover:[transform:scale(1.03)] hover:outline-none focus-visible:bg-[var(--accent-danger-soft-hover,rgba(217,45,32,0.22))] focus-visible:[transform:scale(1.03)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent-danger,#d92d20)] focus-visible:[outline-style:solid]' From 1b15e0b6c48ca5b00d2e526455dd8b33bc57f73b Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Fri, 30 Oct 2026 03:49:31 -0700 Subject: [PATCH 018/132] Migrate first-use takeover styles to Tailwind (#1829) --- src/renderer/src/views/FirstUseTakeover.vue | 801 ++++++-------------- 1 file changed, 237 insertions(+), 564 deletions(-) diff --git a/src/renderer/src/views/FirstUseTakeover.vue b/src/renderer/src/views/FirstUseTakeover.vue index e1f06ea84..288c161fb 100644 --- a/src/renderer/src/views/FirstUseTakeover.vue +++ b/src/renderer/src/views/FirstUseTakeover.vue @@ -48,6 +48,7 @@ */ import { ref, computed, nextTick, onMounted, onUnmounted, useId, watch } from 'vue' import { Check, Copy, FolderInput, Info, Loader2 } from 'lucide-vue-next' +import Button from '@comfyorg/design-system/button/Button' import TakeoverHeader from '../components/TakeoverHeader.vue' import ModalShell from '../components/ModalShell.vue' import ChoiceCard from '../components/ChoiceCard.vue' @@ -60,6 +61,19 @@ import { emitTelemetryAction } from '../lib/telemetry' import type { GpuTier } from '../../../shared/gpuTier' import type { CloudUserTier, SystemInfo } from '../../../types/ipc' +// These native-control adapters retain the existing onboarding dimensions, +// wrapping and focus outlines while using the shared button component. +const buttonClass = + 'touch-auto appearance-auto [&]:[appearance:button] whitespace-normal focus-visible:ring-0 focus-visible:outline-2 focus-visible:[outline-style:solid] focus-visible:outline-[var(--focus-ring)] focus-visible:outline-offset-2 disabled:pointer-events-auto' +const legalLinkClass = `${buttonClass} static inline border-0 rounded-[2px] bg-transparent p-0 [font:inherit] text-neutral-100 underline transition-none hover:bg-transparent hover:text-comfy-yellow` +const checkboxClass = + "relative size-3.5 flex-none appearance-none cursor-pointer rounded border border-solid border-[var(--color-border)] bg-[var(--brand-surface-bg)] bg-size-[14px_14px] bg-center bg-no-repeat transition-[background-color,border-color] duration-180 ease-[cubic-bezier(0.22,1,0.36,1)] checked:border-[var(--color-border)] checked:bg-[var(--accent)] checked:bg-[url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNiAxNicgZmlsbD0nbm9uZScgc3Ryb2tlPSd3aGl0ZScgc3Ryb2tlLXdpZHRoPScyLjUnIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCc+PHBvbHlsaW5lIHBvaW50cz0nMyw5IDcsMTIgMTMsNScvPjwvc3ZnPg==)] after:hidden after:content-[''] focus-visible:outline-2 focus-visible:[outline-style:solid] focus-visible:outline-[var(--focus-ring)] focus-visible:outline-offset-2" +const modifierClass = + 'inline-flex cursor-pointer items-start gap-2 text-[13px] text-neutral-300 transition-[opacity,transform] duration-180 ease-out motion-reduce:transition-none' +const consentClass = + 'flex cursor-pointer items-center gap-2.5 text-[13px] leading-[1.5] text-neutral-200' +const branchCardClass = `${buttonClass} static flex w-full items-center justify-normal gap-3 rounded-md border border-solid border-transparent bg-[rgba(138,134,136,0.05)] p-4 [font:inherit] text-left text-neutral-200 backdrop-blur-[75px] transition-[background,border-color,color] duration-120 ease-[ease] hover:border-[rgba(194,191,185,0.09)] hover:bg-[rgba(138,134,136,0.1)] hover:text-neutral-100` + type Step = 'start' | 'mirrors' | 'localBranch' const emit = defineEmits<{ @@ -903,12 +917,25 @@ defineExpose({ open, resetContinue }) radio cards in the middle, Express-Install opt-out modifier, then the legal/telemetry checkboxes and the Continue / Cancel action row. T&C must be accepted before Continue activates. --> -
-
-

{{ $t('firstUse.pickTitle') }}

-

{{ $t('firstUse.pickLead') }}

+
+
+

+ {{ $t('firstUse.pickTitle') }} +

+

+ {{ $t('firstUse.pickLead') }} +

@@ -985,7 +1023,7 @@ defineExpose({ open, resetContinue }) {{ $t('firstUse.cloudRecommendedForHardwareTooltip') }} @@ -995,57 +1033,77 @@ defineExpose({ open, resetContinue }) wrapper, each label was an `inline-flex` that centered independently, so a longer description text would push one row off-axis from the other. --> -
+
-
-