From 59876f8929fa2c4375148e70c95379a907bed9d8 Mon Sep 17 00:00:00 2001 From: riccardoperra Date: Sat, 21 Nov 2026 14:32:43 +0100 Subject: [PATCH 1/3] feat(app): adopt the Solid 2 CodeUI preview --- .agents/skills/verify-codeimage/SKILL.md | 2 +- .../verify-codeimage/features/export.md | 2 + .../verify-codeimage/features/keyboard.md | 10 +- .../verify-codeimage/features/projects.md | 8 +- .../verify-codeimage/features/signatures.md | 4 +- .../skills/verify-codeimage/features/tabs.md | 2 + .../skills/verify-codeimage/scripts/audit.mjs | 60 +- .../scripts/export-dialog.mjs | 14 + .../scripts/keyboard-scroll.mjs | 51 +- .../scripts/keyboard-scroll.test.mjs | 55 - .../scripts/saved-projects.mjs | 26 +- .../verify-codeimage/scripts/signatures.mjs | 61 + .../verify-codeimage/scripts/tab-reorder.mjs | 31 + apps/codeimage/index.html | 2 + apps/codeimage/package.json | 10 +- apps/codeimage/solid1/package.json | 13 - apps/codeimage/solid1/vite.mjs | 46 - apps/codeimage/src/assets/styles/_reset.scss | 65 +- apps/codeimage/src/assets/styles/app.scss | 2 +- .../components/Animation/AnimationPreview.tsx | 8 +- .../src/components/Animation/easing.css.ts | 2 +- .../components/CustomEditor/CanvasEditor.tsx | 146 +- .../CustomEditor/FormatPasteToast.tsx | 4 +- .../FeatureBadge/FeatureCheckBanner.tsx | 2 +- .../UnsupportedFeatureBanner.css.ts | 2 +- .../src/components/Footer/Footer.css.ts | 2 +- .../src/components/Icons/CodeImageLogoV2.tsx | 3 +- .../Presets/CopyCliConfigMenuItem.test.ts | 22 +- .../Presets/CopyCliConfigMenuItem.tsx | 15 +- .../components/Presets/PresetUpdateDialog.tsx | 6 +- .../SidebarPopover/SidebarPopover.css.ts | 2 +- .../AspectRatioPicker/AspetRatioPicker.css.ts | 2 +- .../ColorPicker/CustomColorPicker.css.ts | 2 +- .../controls/FontPicker/FontPicker.css.ts | 21 +- .../controls/FontPicker/FontPickerListbox.tsx | 23 +- .../controls/ImagePicker/ImagePicker.css.ts | 2 +- .../TerminalGlassReflection.css.ts | 4 +- .../components/Terminal/Tabs/Tab/Tab.css.ts | 8 +- .../Tabs/TabAddButton/TabAddButton.css.ts | 4 +- .../src/components/Terminal/TerminalHost.tsx | 2 +- .../WindowsTerminal/WindowsTerminal.css.ts | 4 +- .../src/components/Terminal/terminal.css.ts | 8 +- .../components/Toolbar/CopyAltTextButton.tsx | 24 +- .../Toolbar/ExportSuccessToast.css.ts | 4 +- .../components/Toolbar/ExportSuccessToast.tsx | 22 +- .../src/components/Toolbar/SettingsDialog.tsx | 4 +- .../src/components/Toolbar/ShareButton.tsx | 6 +- .../components/Toolbar/ToolbarSettings.tsx | 4 +- .../components/Toolbar/ToolbarSnippetName.tsx | 6 +- .../src/components/Watermark/Watermark.tsx | 2 +- .../src/components/WhatsNew/NewDot.tsx | 4 +- .../src/components/WhatsNew/Nudge.tsx | 16 +- .../src/components/WhatsNew/Showcase.tsx | 10 +- .../WhatsNew/ShowcaseAccessories.tsx | 4 +- apps/codeimage/src/core/helpers/create-ref.ts | 40 - .../core/rasterize/notify-font-fallback.ts | 11 +- apps/codeimage/src/i18n/index.ts | 4 + apps/codeimage/src/index.tsx | 30 +- .../CreateNewProjectButton.tsx | 20 +- .../ProjectItem/ProjectActionsMenu.tsx | 4 +- .../components/ProjectItem/ProjectItem.tsx | 43 +- .../ProjectList/ProjectErrorListFallback.tsx | 4 +- .../components/ProjectList/ProjectList.tsx | 2 +- .../ProjectToolbar/ProjectToolbar.tsx | 4 +- .../src/pages/NotFound/NotFoundPage.tsx | 4 +- .../UnifiedEditor/ReadOnlyCloneButton.tsx | 4 +- .../agent-tools/FormatTabButton.tsx | 6 +- .../agent-tools/ToolActivity.tsx | 6 +- .../UnifiedEditor/controls/CanvasToolbar.tsx | 14 +- .../UnifiedEditor/controls/ControlOverlay.tsx | 14 +- .../UnifiedEditor/controls/ControlRow.tsx | 2 +- .../UnifiedEditor/controls/PickerContent.tsx | 2 +- .../controls/SavedSignatures.tsx | 4 +- .../UnifiedEditor/controls/ShortcutHelp.tsx | 8 +- .../controls/SignatureFields.tsx | 6 +- .../pages/UnifiedEditor/controls/fields.tsx | 56 +- .../pages/UnifiedEditor/local-ai/Answer.tsx | 8 +- .../UnifiedEditor/local-ai/AskAiButton.tsx | 6 +- .../pages/UnifiedEditor/local-ai/LocalAi.tsx | 16 +- .../UnifiedEditor/localized/ColorPicker.tsx | 2 +- .../localized/EmptyPresetFallback.tsx | 4 +- .../localized/ExperimentalFeatureTooltip.tsx | 2 +- .../UnifiedEditor/localized/FontPicker.tsx | 2 +- .../localized/FontSystemPicker.tsx | 23 +- .../localized/GitHubLoginButton.tsx | 2 +- .../localized/ImagePickerInput.tsx | 6 +- .../localized/ImagePickerList.tsx | 8 +- .../localized/PresetSwitcher.tsx | 33 +- .../localized/PresetTooltipContent.tsx | 11 +- .../localized/SidebarPopoverTitle.tsx | 4 +- .../UnifiedEditor/shell/ExportControl.tsx | 8 +- .../src/pages/UnifiedEditor/shell/Header.tsx | 33 +- .../shell/SettingsSearchField.tsx | 17 +- .../shell/export-animation-dialog.tsx | 16 +- .../shell/export-styles/panel.tsx | 8 +- .../shell/export-styles/sheet.tsx | 8 +- .../shell/export-styles/video.tsx | 6 +- .../src/pages/UnifiedEditor/shell/export.tsx | 33 +- .../pages/UnifiedEditor/shell/sections.tsx | 24 +- .../theme-styles/ThemePicker.tsx | 25 +- .../UnifiedEditor/theme-styles/picker.css.ts | 15 +- .../variants/dock/BarSettings.tsx | 8 +- .../UnifiedEditor/variants/dock/index.tsx | 12 +- .../UnifiedEditor/variants/dock/panels.tsx | 7 +- .../variants/sidebar/Accordion.tsx | 22 +- .../UnifiedEditor/variants/sidebar/Rail.tsx | 8 +- .../variants/sidebar/accordion.css.ts | 4 +- .../src/pages/UnifiedEditor/verify-i18n.mjs | 4 +- .../src/pages/UnifiedEditor/verify-review.mjs | 2 +- .../src/state/editor/activeEditor.ts | 26 +- .../src/state/editor/createEditorSync.ts | 8 +- apps/codeimage/src/state/presets/presets.ts | 80 +- .../src/state/signatures/signatures.ts | 10 +- apps/codeimage/src/state/ui.ts | 3 - apps/codeimage/src/theme/global.css.ts | 2 +- apps/codeimage/src/ui/Alert/Alert.css.ts | 2 +- .../src/ui/ConfirmDialog/ConfirmDialog.tsx | 8 +- .../ui/ConfirmDialog/RenameContentDialog.tsx | 6 +- apps/codeimage/src/ui/Dialog/focus.ts | 24 +- apps/codeimage/src/ui/DropdownMenu/index.tsx | 10 +- .../ExperimentalChip/ExperimentalChip.css.ts | 2 +- .../ExperimentalFeatureTooltip.tsx | 2 +- .../GitHubLoginButton/GitHubLoginButton.tsx | 2 +- .../src/ui/SegmentedField/SegmentedField.tsx | 128 +- apps/codeimage/src/ui/legacy-controls.ts | 29 - apps/codeimage/src/ui/legacy-listbox.ts | 27 - apps/codeimage/src/ui/notifications.css.ts | 13 + apps/codeimage/src/ui/notifications.ts | 4 + .../src/ui/snackbarHostAppStyle.css.ts | 5 - apps/codeimage/vite.config.ts | 41 +- apps/codeimage/vitest.config.ts | 1 + docs/plans/2026-solid-2-migration.md | 42 +- .../solid-2-dropdown-bridge/README.md | 13 - .../solid-2-dropdown-bridge/app.jsx | 107 -- .../solid-2-dropdown-bridge/build.mjs | 68 - .../solid-2-dropdown-bridge/check.mjs | 113 -- .../solid-2-dropdown-bridge/demo.html | 118 -- .../solid-2-dropdown-bridge/package.json | 14 - lint-baseline.json | 19 +- packages/config/src/lib/icons/txt.svg | 2 +- packages/highlight/package.json | 3 - .../src/lib/primitives/Loader/Loader.css.ts | 4 +- .../lib/primitives/Snackbar/SnackbarHost.tsx | 2 +- packages/ui/src/lib/theme/with-theme-mode.ts | 6 +- .../ui/src/lib/tokens/createCodeImageTheme.ts | 2 +- packages/ui/src/lib/tokens/tokens.tsx | 2 +- packages/vite-plugin-solid1-bridge/README.md | 32 - .../vite-plugin-solid1-bridge/package.json | 36 - .../src/build-legacy.ts | 71 - .../src/contracts.ts | 35 - packages/vite-plugin-solid1-bridge/src/ids.ts | 3 - .../vite-plugin-solid1-bridge/src/imports.ts | 32 - .../vite-plugin-solid1-bridge/src/index.ts | 96 - .../vite-plugin-solid1-bridge/src/mount.ts | 20 - .../vite-plugin-solid1-bridge/src/runtime.ts | 156 -- .../src/transform.ts | 307 ---- .../test/transform.test.mjs | 99 -- .../vite-plugin-solid1-bridge/tsconfig.json | 15 - .../tsconfig.runtime.json | 8 - patches/@codeui__kit.patch | 36 - patches/@kobalte__utils@0.9.1.patch | 42 - patches/@motionone__solid.patch | 12 - patches/solid-headless.patch | 24 - pnpm-lock.yaml | 1541 +++++------------ pnpm-workspace.yaml | 16 +- 165 files changed, 1441 insertions(+), 3627 deletions(-) delete mode 100644 .agents/skills/verify-codeimage/scripts/keyboard-scroll.test.mjs create mode 100644 .agents/skills/verify-codeimage/scripts/signatures.mjs delete mode 100644 apps/codeimage/solid1/package.json delete mode 100644 apps/codeimage/solid1/vite.mjs delete mode 100644 apps/codeimage/src/core/helpers/create-ref.ts delete mode 100644 apps/codeimage/src/ui/legacy-controls.ts delete mode 100644 apps/codeimage/src/ui/legacy-listbox.ts create mode 100644 apps/codeimage/src/ui/notifications.css.ts create mode 100644 apps/codeimage/src/ui/notifications.ts delete mode 100644 apps/codeimage/src/ui/snackbarHostAppStyle.css.ts delete mode 100644 docs/plans/prototypes/solid-2-dropdown-bridge/README.md delete mode 100644 docs/plans/prototypes/solid-2-dropdown-bridge/app.jsx delete mode 100644 docs/plans/prototypes/solid-2-dropdown-bridge/build.mjs delete mode 100644 docs/plans/prototypes/solid-2-dropdown-bridge/check.mjs delete mode 100644 docs/plans/prototypes/solid-2-dropdown-bridge/demo.html delete mode 100644 docs/plans/prototypes/solid-2-dropdown-bridge/package.json delete mode 100644 packages/vite-plugin-solid1-bridge/README.md delete mode 100644 packages/vite-plugin-solid1-bridge/package.json delete mode 100644 packages/vite-plugin-solid1-bridge/src/build-legacy.ts delete mode 100644 packages/vite-plugin-solid1-bridge/src/contracts.ts delete mode 100644 packages/vite-plugin-solid1-bridge/src/ids.ts delete mode 100644 packages/vite-plugin-solid1-bridge/src/imports.ts delete mode 100644 packages/vite-plugin-solid1-bridge/src/index.ts delete mode 100644 packages/vite-plugin-solid1-bridge/src/mount.ts delete mode 100644 packages/vite-plugin-solid1-bridge/src/runtime.ts delete mode 100644 packages/vite-plugin-solid1-bridge/src/transform.ts delete mode 100644 packages/vite-plugin-solid1-bridge/test/transform.test.mjs delete mode 100644 packages/vite-plugin-solid1-bridge/tsconfig.json delete mode 100644 packages/vite-plugin-solid1-bridge/tsconfig.runtime.json delete mode 100644 patches/@codeui__kit.patch delete mode 100644 patches/@kobalte__utils@0.9.1.patch delete mode 100644 patches/@motionone__solid.patch delete mode 100644 patches/solid-headless.patch diff --git a/.agents/skills/verify-codeimage/SKILL.md b/.agents/skills/verify-codeimage/SKILL.md index 247aa8499..a238b82ba 100644 --- a/.agents/skills/verify-codeimage/SKILL.md +++ b/.agents/skills/verify-codeimage/SKILL.md @@ -54,7 +54,7 @@ The helper's `finally` closes its browser/context and terminates only its own Vi ## Helpers -Select `VERIFY_CASES=keyboard-scroll` for keyboard opening of scrollable-panel menus and selects across Inspector, Dock, and Studio at desktop and phone sizes. The Node watchdog interrupts a frozen renderer after five seconds. Read [keyboard coverage](features/keyboard.md) for discovery rules and evidence. Run `fnm exec --using=v24.14.0 node --test .agents/skills/verify-codeimage/scripts/keyboard-scroll.test.mjs` for the dependency traversal regression. +Select `VERIFY_CASES=keyboard-scroll` for keyboard opening of scrollable-panel menus and selects across Inspector, Dock, and Studio at desktop and phone sizes. The Node watchdog interrupts a frozen renderer after five seconds. Read [keyboard coverage](features/keyboard.md) for discovery rules and evidence. `node .agents/skills/verify-codeimage/scripts/verify.mjs` runs the full baseline. It is executable and accepts `VERIFY_PORT` and `ARTIFACT_DIR` environment overrides. To re-run selected journeys, set `VERIFY_CASES=export-options,settings-persistence` together with `VERIFY_AUDIT=1`. Omit `VERIFY_CASES` for the complete pass. Unknown names fail the run. `audit.json` lists only the journeys actually selected and is flushed before recovery after a failure. On a shared machine, use short `VERIFY_CASES` batches, unique server/debugging ports, and retry a killed case at most twice. Never terminate another session’s processes. diff --git a/.agents/skills/verify-codeimage/features/export.md b/.agents/skills/verify-codeimage/features/export.md index dd9223ce0..a33314cb1 100644 --- a/.agents/skills/verify-codeimage/features/export.md +++ b/.agents/skills/verify-codeimage/features/export.md @@ -20,6 +20,8 @@ Run `export-options` for actual 1x and 2x PNG dimensions, JPEG magic bytes and a Run `VERIFY_AUDIT=1 VERIFY_CASES=export-dialog node .agents/skills/verify-codeimage/scripts/verify.mjs` for the Dialog export style. The case switches styles in Settings, checks the decoded preview, dismisses with Escape and checks trigger focus. It downloads and parses a one-off SVG, then checks that PNG remains the default until saving SVG with Remember as default. Each SVG must contain the editor text and have positive dimensions. +Run `export-notification` to check the notification after a PNG download. The case selects Copy alt text, checks that the success notification closes, and reads the exported code from the clipboard. + Run `export-fractional-geometry,export-padding-geometry` for fractional frame measurement and padding-only signature changes. The cases edit short, sample and long code through CodeMirror, fit the long document on desktop and phone, change padding and switch Card to Minimal through the signature controls. They compare live and export border boxes and decode real 1x/2x PNG downloads. At zoom 1, fractional geometry must match within 0.02 CSS pixels; fitted text allows one screen pixel of layout snapping. The signature case tolerates integer rounding but rejects stale reserved padding independently of fractional precision. Each case saves its geometry JSON, screenshots, traces, downloaded PNGs and persisted document snapshots. To compare those actual downloads with the CLI, run `scripts/parity/cli-vs-web/index.ts` with the corresponding `-1x.json` / `-2x.json` inputs and `P10_WEB_EXPORTS=`. `P10_WEB_OUT` selects the comparison directory. The runner records both sizes and pixelmatch percentages in `results.json`; a size mismatch fails without hiding later documents. Omit `P10_WEB_EXPORTS` for the existing static preview fixture comparison. diff --git a/.agents/skills/verify-codeimage/features/keyboard.md b/.agents/skills/verify-codeimage/features/keyboard.md index 50106556a..32c0d8bab 100644 --- a/.agents/skills/verify-codeimage/features/keyboard.md +++ b/.agents/skills/verify-codeimage/features/keyboard.md @@ -2,9 +2,9 @@ `keyboard-scroll` opens menu and select triggers with Enter, Space, and ArrowDown. The matrix uses fresh contexts at 1440×900 and 390×844 for Inspector, Dock, and Studio. Each context sets `codeimage:editor-settings` before loading the editor. The legacy `inspector` and `studio` values exercise their migration to the accordion and rail sidebar preferences. -The journey creates a preset through the UI, visits the sidebar sections, and opens the Signature overlay. Dock visits each More group and the Font and phone Language panels. Dock has no Presets panel. Discovery includes enabled menu, listbox, and combobox triggers inside the active control panel or overlay with a CSS `auto` or `scroll` ancestor. Closed accordion sections and controls behind an overlay are excluded. A CSS scroll container matters even when its contents currently fit, because Kobalte checks overflow styles rather than scroll dimensions. +The journey creates a preset through the UI, visits the sidebar sections, and opens the Signature overlay. Dock visits each More group and the Font and phone Language panels. Dock has no Presets panel. Discovery includes enabled menu, listbox, and combobox triggers inside the active control panel or overlay with a CSS `auto` or `scroll` ancestor. Closed accordion sections and controls behind an overlay are excluded. -Discovery waits for finite panel transitions and reads the candidate list in one browser evaluation. Every discovered trigger receives focus before each key. The journey asserts that its popup appears, `aria-expanded` becomes true, the renderer completes another animation frame, and Escape closes the popup and restores focus. An explicit control list for each layout prevents missing controls from silently passing. +Discovery waits for finite panel transitions and reads the candidate list in one browser evaluation. Every discovered trigger receives focus before each key. The journey asserts that its popup appears, `aria-expanded` becomes true, the renderer completes another animation frame, and Escape closes the popup and restores focus. After the Signature sweep, another Escape closes Signature and returns focus to its opener. An explicit control list for each layout prevents missing controls from silently passing. Sidebar coverage includes Preset menu, Padding, Saved signatures, Avatar source, Border, Shadow, Language, Theme, Font, and Font weight. Dock coverage includes Saved signatures, Avatar source, Border, Shadow, Syntax theme, and Font weight. The Signature fixture selects Card and Profile to reveal Avatar source. This produces 156 key openings across the six layout and viewport combinations. Native segmented controls, standalone listboxes, disabled controls, and triggers outside scrollable control panels are outside this case. @@ -20,8 +20,4 @@ VERIFY_AUDIT=1 VERIFY_CASES=keyboard-scroll VERIFY_BROWSER_CHANNEL=chrome VERIFY `rail-interrupted-close` closes Themes and immediately opens Frame on a 390 px Sidebar Rail. Frame must stay open after the Themes exit would have finished. The case repeats with reduced motion and verifies that closing Frame returns focus to its rail button. -The dependency patch is `patches/@kobalte__utils@0.9.1.patch`. Both ESM and CommonJS bundles start each `scrollIntoViewport` lookup at the target's parent. Each iteration therefore reaches a strict ancestor and eventually the document root. The exported `getScrollParent` behavior remains unchanged. The editor's root overflow and the Animate trigger placement workaround remain unchanged. - -`scripts/keyboard-scroll.test.mjs` runs the installed ESM utility against a hidden document root and nested CSS scroll containers. A visit limit fails the original loop without hanging the test process. The test also checks that `getScrollParent` keeps its exported behavior and that scrollable targets and detached elements terminate. `VERIFY_KOBALTE_UTILS` can point to the original package's `dist/index.cjs` to repeat the negative control; the test imports its adjacent ESM bundle. - -Installed Kobalte versions are core 0.13.11 and utils 0.9.1. The app, UI package, and kit share that utils resolution. On November 16, 2026, published utils 0.9.2 still contains the loop; core 0.13.14 depends on utils ^0.9.2. Their changelogs contain no fix for this loop. [Upstream PR 750](https://github.com/kobaltedev/kobalte/pull/750) proposes the same parent traversal and remains open. Recheck published source before removing the patch or updating Kobalte. +`signatures` verifies nested dismissal. The first Escape closes Saved signatures and returns focus to its trigger. The second closes Signature and returns focus to its opener. diff --git a/.agents/skills/verify-codeimage/features/projects.md b/.agents/skills/verify-codeimage/features/projects.md index 175c7ddbd..2c6d5948c 100644 --- a/.agents/skills/verify-codeimage/features/projects.md +++ b/.agents/skills/verify-codeimage/features/projects.md @@ -47,16 +47,16 @@ Ownership and failed-load fixtures use the existing MSW boundary. Navigation use To isolate a snippet matrix lane, set `VERIFY_SNIPPET_LAYOUT=inspector`, `dock`, or `studio`, and `VERIFY_SNIPPET_WIDTH=1440` or `390`. The default remains all six combinations. Each run writes the lanes actually exercised to `-matrix.json`; a selected lane does not establish full matrix coverage. All scenario assertions remain active. These selectors allow fresh Chrome processes when a long-lived local browser exits during repeated context changes. -## Bridged project actions +## Project actions from the dashboard -Run the dashboard case on Node 24 to exercise the Solid 2 project menu and its bridged Solid 1 CodeUI trigger. +Run the dashboard case on Node 24 to exercise the CodeUI project menu. ```sh -VERIFY_AUDIT=1 VERIFY_CASES=solid1-bridge-project-menu \ +VERIFY_AUDIT=1 VERIFY_CASES=project-menu \ VERIFY_BROWSER_CHANNEL=chrome node .agents/skills/verify-codeimage/scripts/verify.mjs ``` -The case creates a disposable MSW project, opens the menu by keyboard, checks Escape and focus, renames the project through the app dialog, clones it and follows the new URL, then deletes the original through the app dialog. It checks the mutation responses and verifies that the rename dialog blocks background clicks only while open. +The case creates a disposable project in MSW. It opens the menu with ArrowDown and checks that Escape returns focus to its trigger. It opens Rename with Enter and checks the rename response. Then it clones the project, follows the new URL, and deletes the original. It checks both mutation responses and confirms that the rename dialog blocks background clicks while open. ## Read-only notice diff --git a/.agents/skills/verify-codeimage/features/signatures.md b/.agents/skills/verify-codeimage/features/signatures.md index cf0f8feaa..a7d9bcbff 100644 --- a/.agents/skills/verify-codeimage/features/signatures.md +++ b/.agents/skills/verify-codeimage/features/signatures.md @@ -12,7 +12,9 @@ Open Frame then Signature (`#signature-options`); after creation the canvas sign ## Driving it with Playwright -The `signatures` case clicks `#signature-options` (the open overlay is `[data-control-overlay="signature"]`), fills @handle or profile link, chooses Saved signatures → Save as new → group Signature name → its textbox → Save. Assert `[data-frame-signature]` contains the handle; export PNG. Reload same context, open Saved signatures and apply named menuitem to prove persistence. Card exposes display name/avatar. Choose Initials for local proof. +The `signatures` case opens Signature with Enter and fills the handle. It opens Saved signatures with ArrowDown. Escape first dismisses the menu and returns focus to Saved signatures. A second Escape dismisses Signature and returns focus to its opener. + +The case reopens Signature, saves a new signature, checks the canvas handle, and decodes the downloaded PNG. It reloads the same context and selects the saved signature to check persistence. Card exposes the display name and avatar. Choose Initials for a local check. Source: `pages/UnifiedEditor/controls/SignatureFields.tsx`, `controls/SavedSignatures.tsx`, `state/signatures/bridge.ts`. diff --git a/.agents/skills/verify-codeimage/features/tabs.md b/.agents/skills/verify-codeimage/features/tabs.md index af3bf6fa8..21d06aa19 100644 --- a/.agents/skills/verify-codeimage/features/tabs.md +++ b/.agents/skills/verify-codeimage/features/tabs.md @@ -16,6 +16,8 @@ Run `VERIFY_AUDIT=1 VERIFY_CASES=tabs fnm exec --using=v24.14.0 node .agents/ski The `tabs` case uses the Editor window style. The `tabs-classic` case runs the same journey in macOS chrome. Each enters distinct code in two tabs, selects their extensions with keyboard and pointer, and switches between them. It focuses a tab, uses Enter to activate it, then uses Space and ArrowRight to pick up and move it. Escape preserves order and focus. Space commits the next move. A pointer drag verifies that order stays stable until drop. The dragged tab follows the pointer inside the frame and keeps its background and shadow. The other tab stays in place. The audit renames a tab, checks the reordered names and decodes the image entries in the downloaded ZIP, then closes the active tab and checks the remaining document. The trace and drag screenshot capture the interaction. +The `plain-text-tab-icon` case renames a tab through filename completion, switches from a dark frame to XCode Light, and checks the icon's computed fill in both modes. + Source: `components/Terminal/Tabs/TerminalWindowTabList.tsx`, `Tab/WindowTab.tsx`, `Tab/DraggableWindowTab.tsx` (Close tab and dragging), `TabAddButton/TabAddButton.tsx` (Add tab), `TabName/TabName.tsx`, `hooks/export-tabs.ts`, `hooks/export-tab-name.ts`. ## Gotchas diff --git a/.agents/skills/verify-codeimage/scripts/audit.mjs b/.agents/skills/verify-codeimage/scripts/audit.mjs index e5dda498e..661554fe6 100755 --- a/.agents/skills/verify-codeimage/scripts/audit.mjs +++ b/.agents/skills/verify-codeimage/scripts/audit.mjs @@ -5,13 +5,17 @@ import assert from 'node:assert/strict'; import {auditPresetCases, auditPresetPersistence} from './presets.mjs'; import {auditLineMarks} from './audit-line-marks.mjs'; import * as newsAudits from './audit-line-marks-news.mjs'; -import {verifyExportDialog} from './export-dialog.mjs'; +import { + verifyExportDialog, + verifyExportNotification, +} from './export-dialog.mjs'; import {auditEditor} from './editor-responsiveness.mjs'; import {auditKeyboard} from './shortcut-help.mjs'; import {createMockContext} from './mock-context.mjs'; import {animationMp4Cases} from './animation-mp4.mjs'; import {auditSavedProjects, verifyProjectSearch} from './saved-projects.mjs'; import {auditSettingsSearch, closeSettingsDialog} from './settings-search.mjs'; +import {auditSignatures} from './signatures.mjs'; import {auditTabLayouts} from './tab-reorder.mjs'; import {writeFile, readFile} from 'node:fs/promises'; import {resolve} from 'node:path'; @@ -323,48 +327,9 @@ export async function audit({page, context, base, out, server}) { download, shot, }); - await feature('signatures', async () => { - await section('frame'); - await page.locator('#signature-options').click(); - await writeFile( - resolve(out, 'signature-open.aria.txt'), - await page.locator('body').ariaSnapshot(), - ); - await page - .getByPlaceholder('@handle or profile link', {exact: true}) - .fill('@verification'); - await page - .getByRole('button', {name: 'Saved signatures', exact: true}) - .click(); - await page - .getByRole('menuitem', {name: 'Save as new', exact: true}) - .click(); - await page - .getByRole('group', {name: 'Signature name', exact: true}) - .getByRole('textbox') - .fill('Verification signature'); - await page.getByRole('button', {name: 'Save', exact: true}).click(); - await page.keyboard.press('Escape'); - assert.match( - await page.locator('[data-frame-signature]').first().innerText(), - /@verification/, - ); - PNG.sync.read(await download('signature.png')); - await page.reload(); - await editor().waitFor(); - await section('frame'); - await page.locator('#signature-options').click(); - await page - .getByRole('button', {name: 'Saved signatures', exact: true}) - .click(); - await page.getByRole('menuitem', {name: /Verification signature/}).click(); - assert.equal( - await page - .getByPlaceholder('@handle or profile link', {exact: true}) - .inputValue(), - '@verification', - ); - }); + await feature('signatures', () => + auditSignatures({page, editor, section, download, out}), + ); await feature('whats-new', async () => { await settings('whats-new'); assert.ok((await page.locator('[data-setting^="news-"]').count()) > 0); @@ -542,6 +507,9 @@ export async function audit({page, context, base, out, server}) { verifyExportDialog(fixture, out), ), ); + await feature('export-notification', () => + verifyExportNotification({page, editor, download}), + ); await feature('export-options', async () => { try { await editor().fill('const exportOptions = true;'); @@ -694,8 +662,7 @@ export async function audit({page, context, base, out, server}) { .getByRole('menuitem', {name: 'Save as new', exact: true}) .click(); await page - .getByRole('group', {name: 'Signature name', exact: true}) - .getByRole('textbox') + .getByRole('textbox', {name: 'Signature name', exact: true}) .fill('Management signature'); await page.getByRole('button', {name: 'Save', exact: true}).click(); @@ -704,8 +671,7 @@ export async function audit({page, context, base, out, server}) { .click(); await page.getByRole('menuitem', {name: 'Rename', exact: true}).click(); await page - .getByRole('group', {name: 'Signature name', exact: true}) - .getByRole('textbox') + .getByRole('textbox', {name: 'Signature name', exact: true}) .fill('Renamed signature'); await page.getByRole('button', {name: 'Save', exact: true}).click(); await page diff --git a/.agents/skills/verify-codeimage/scripts/export-dialog.mjs b/.agents/skills/verify-codeimage/scripts/export-dialog.mjs index 9cc45f2d4..90b772b9d 100644 --- a/.agents/skills/verify-codeimage/scripts/export-dialog.mjs +++ b/.agents/skills/verify-codeimage/scripts/export-dialog.mjs @@ -2,6 +2,20 @@ import assert from 'node:assert/strict'; import {resolve} from 'node:path'; import {readFile} from 'node:fs/promises'; +export async function verifyExportNotification({page, editor, download}) { + await editor().fill('const exportNotification = true;'); + await download('notification.png'); + const toast = page.getByRole('status').filter({hasText: 'Image exported'}); + await toast.getByRole('button', {name: 'Close notification'}).waitFor(); + await toast.getByRole('button', {name: 'Copy alt text', exact: true}).click(); + await toast.waitFor({state: 'hidden'}); + await page.getByRole('status').filter({hasText: 'Alt text copied'}).waitFor(); + assert.match( + await page.evaluate(() => navigator.clipboard.readText()), + /exportNotification/, + ); +} + export async function verifyExportDialog( {page, doctor, editor, settings, closeSettings}, out, diff --git a/.agents/skills/verify-codeimage/scripts/keyboard-scroll.mjs b/.agents/skills/verify-codeimage/scripts/keyboard-scroll.mjs index 213c778bf..9cd892eb1 100644 --- a/.agents/skills/verify-codeimage/scripts/keyboard-scroll.mjs +++ b/.agents/skills/verify-codeimage/scripts/keyboard-scroll.mjs @@ -169,18 +169,21 @@ export async function verifyKeyboardScroll({fresh, out}) { `${description.label}: trigger receives focus`, ); await page.keyboard.press(key); - await page - .getByRole( - ['true', 'menu'].includes(description.popup) - ? 'menu' - : 'listbox', - ) - .last() - .waitFor({state: 'visible'}); - assert.equal( - await trigger.getAttribute('aria-expanded'), - 'true', + await trigger + .and(page.locator('[aria-expanded="true"]')) + .waitFor({timeout: 3000}); + const popupId = await trigger.getAttribute('aria-controls'); + assert.ok( + popupId, + `${description.label}: controls a popup`, ); + const role = ['true', 'menu'].includes(description.popup) + ? 'menu' + : 'listbox'; + const popup = page + .getByRole(role) + .and(page.locator(`[id=${JSON.stringify(popupId)}]`)); + await popup.waitFor(); // A frame and an evaluation after keydown prove the renderer responds. await page.evaluate( () => @@ -189,6 +192,7 @@ export async function verifyKeyboardScroll({fresh, out}) { ), ); await page.keyboard.press('Escape'); + await popup.waitFor({state: 'hidden'}); assert.equal( await trigger.getAttribute('aria-expanded'), 'false', @@ -263,34 +267,15 @@ export async function verifyKeyboardScroll({fresh, out}) { await page.locator('#signature-options').click(); await signature(); await sweep('Signature'); + await page.keyboard.press('Escape'); await page - .getByRole('dialog', {name: 'Signature', exact: true}) - .getByRole('button', {name: 'Close', exact: true}) - .click(); + .locator('#signature-options:focus[aria-expanded="false"]') + .waitFor(); await open('window', 'Window'); await sweep('Window'); await open('code', 'Code'); await sweep('Code'); - assert.ok( - records.some( - record => - record.layout === layout && - record.viewport.width === viewport.width && - record.label === 'Preset menu', - ), - `${name}: preset regression exercised`, - ); } - for (const label of ['Saved signatures', 'Avatar source']) - assert.ok( - records.some( - record => - record.layout === layout && - record.viewport.width === viewport.width && - record.label === label, - ), - `${name}: ${label} exercised`, - ); const expected = layout === 'dock' ? [ diff --git a/.agents/skills/verify-codeimage/scripts/keyboard-scroll.test.mjs b/.agents/skills/verify-codeimage/scripts/keyboard-scroll.test.mjs deleted file mode 100644 index 36c59a8e5..000000000 --- a/.agents/skills/verify-codeimage/scripts/keyboard-scroll.test.mjs +++ /dev/null @@ -1,55 +0,0 @@ -import assert from 'node:assert/strict'; -import {createRequire} from 'node:module'; -import {pathToFileURL} from 'node:url'; -import {test} from 'node:test'; - -const require = createRequire( - new URL('../../../../apps/codeimage/package.json', import.meta.url), -); -const {Window} = require('happy-dom'); -const commonjs = - process.env.VERIFY_KOBALTE_UTILS ?? require.resolve('@kobalte/utils'); - -test('hidden-root traversal terminates through nested scroll parents', async () => { - const window = new Window(); - const previous = {window: globalThis.window, document: globalThis.document}; - globalThis.window = window; - globalThis.document = window.document; - try { - const utils = await import(new URL('index.js', pathToFileURL(commonjs))); - document.documentElement.style.overflow = 'hidden'; - document.body.innerHTML = - '
'; - const outer = document.body.firstElementChild; - const inner = outer.firstElementChild; - const trigger = inner.firstElementChild; - const computedStyle = window.getComputedStyle.bind(window); - const visited = []; - window.getComputedStyle = element => { - visited.push(element); - assert.ok( - visited.length < 32, - 'scrollIntoViewport must progress rather than revisit the same scroll parent forever', - ); - return computedStyle(element); - }; - utils.scrollIntoViewport(trigger); - assert.ok(visited.includes(inner)); - assert.ok( - visited.includes(outer), - 'nested traversal reaches the outer scroll container', - ); - assert.equal(document.documentElement.scrollTop, 0); - assert.equal( - utils.getScrollParent(inner), - inner, - 'exported getScrollParent still includes its starting element', - ); - utils.scrollIntoViewport(inner); - const detached = document.createElement('button'); - utils.scrollIntoViewport(detached); - } finally { - Object.assign(globalThis, previous); - await window.happyDOM.close(); - } -}); diff --git a/.agents/skills/verify-codeimage/scripts/saved-projects.mjs b/.agents/skills/verify-codeimage/scripts/saved-projects.mjs index 4021ebfb8..af0d5a970 100644 --- a/.agents/skills/verify-codeimage/scripts/saved-projects.mjs +++ b/.agents/skills/verify-codeimage/scripts/saved-projects.mjs @@ -16,7 +16,7 @@ export async function verifyProjectSearch(page, row) { await name.waitFor(); } -async function auditProjectMenuBridge({page}) { +async function auditProjectMenu({page}) { const errors = []; const captureError = error => errors.push(error.message); page.on('pageerror', captureError); @@ -40,10 +40,15 @@ async function auditProjectMenuBridge({page}) { .getByRole('listitem') .filter({has: page.locator(`a[href="/${project.id}"]`)}); const trigger = row.getByRole('button', {name: 'Menu', exact: true}); - const menu = page.locator( - '[role="menu"][data-cui="dropdown-menu-content"]', - ); + const menu = page.getByRole('menu', {includeHidden: true}).filter({ + has: page.getByRole('menuitem', { + name: 'Rename', + exact: true, + includeHidden: true, + }), + }); const rename = menu.getByRole('menuitem', {name: 'Rename', exact: true}); + const projectName = 'Renamed verification project'; const focused = page.locator(':focus'); await trigger.press('ArrowDown'); await rename.and(focused).waitFor(); @@ -52,10 +57,11 @@ async function auditProjectMenuBridge({page}) { await menu.waitFor({state: 'detached'}); await trigger.and(focused).waitFor(); - await trigger.click(); - await rename.click(); + await trigger.press('ArrowDown'); + await rename.and(focused).waitFor(); + await page.keyboard.press('Enter'); const dialog = page.getByRole('alertdialog', {name: 'Rename project'}); - await dialog.getByRole('textbox').fill('Renamed through the bridge'); + await dialog.getByRole('textbox').fill(projectName); await menu.waitFor({state: 'detached'}); const body = page.locator('body'); assert.equal( @@ -75,7 +81,7 @@ async function auditProjectMenuBridge({page}) { await body.evaluate(element => element.style.pointerEvents), 'none', ); - await row.getByText('Renamed through the bridge', {exact: true}).waitFor(); + await row.getByText(projectName, {exact: true}).waitFor(); await trigger.click(); const cloned = page.waitForResponse( @@ -93,7 +99,7 @@ async function auditProjectMenuBridge({page}) { await page.locator('.cm-content[contenteditable="true"]').first().waitFor(); await menu.waitFor({state: 'detached'}); await dashboard.click(); - await row.getByText('Renamed through the bridge', {exact: true}).waitFor(); + await row.getByText(projectName, {exact: true}).waitFor(); await trigger.click(); await menu.getByRole('menuitem', {name: 'Delete', exact: true}).click(); const confirm = page.getByRole('alertdialog', {name: 'Delete project'}); @@ -119,7 +125,7 @@ export async function auditSavedProjects(options) { ); for (const [name, audit] of [ ['read-only-notice', auditReadOnlyNotice], - ['solid1-bridge-project-menu', auditProjectMenuBridge], + ['project-menu', auditProjectMenu], ]) { if (!requested?.includes(name)) continue; await options.feature(name, () => diff --git a/.agents/skills/verify-codeimage/scripts/signatures.mjs b/.agents/skills/verify-codeimage/scripts/signatures.mjs new file mode 100644 index 000000000..e1127c72a --- /dev/null +++ b/.agents/skills/verify-codeimage/scripts/signatures.mjs @@ -0,0 +1,61 @@ +import assert from 'node:assert/strict'; +import {writeFile} from 'node:fs/promises'; +import {resolve} from 'node:path'; +import {PNG} from 'pngjs'; + +export async function auditSignatures({page, editor, section, download, out}) { + await section('frame'); + const opener = page.locator('#signature-options'); + const panel = page.getByRole('dialog', {name: 'Signature', exact: true}); + const saved = panel.getByRole('button', { + name: 'Saved signatures', + exact: true, + }); + const saveAsNew = page.getByRole('menuitem', { + name: 'Save as new', + exact: true, + }); + const focused = page.locator(':focus'); + await opener.press('Enter'); + await writeFile( + resolve(out, 'signature-open.aria.txt'), + await page.locator('body').ariaSnapshot(), + ); + await page + .getByPlaceholder('@handle or profile link', {exact: true}) + .fill('@verification'); + await saved.press('ArrowDown'); + await saveAsNew.and(focused).waitFor(); + await page.keyboard.press('Escape'); + await saveAsNew.waitFor({state: 'hidden'}); + await saved.and(focused).waitFor(); + await page.keyboard.press('Escape'); + await panel.waitFor({state: 'hidden'}); + await opener.and(focused).waitFor(); + + await opener.press('Enter'); + await saved.click(); + await saveAsNew.click(); + await page + .getByRole('textbox', {name: 'Signature name', exact: true}) + .fill('Verification signature'); + await page.getByRole('button', {name: 'Save', exact: true}).click(); + await page.keyboard.press('Escape'); + assert.match( + await page.locator('[data-frame-signature]').first().innerText(), + /@verification/, + ); + PNG.sync.read(await download('signature.png')); + await page.reload(); + await editor().waitFor(); + await section('frame'); + await opener.click(); + await saved.click(); + await page.getByRole('menuitem', {name: /Verification signature/}).click(); + assert.equal( + await page + .getByPlaceholder('@handle or profile link', {exact: true}) + .inputValue(), + '@verification', + ); +} diff --git a/.agents/skills/verify-codeimage/scripts/tab-reorder.mjs b/.agents/skills/verify-codeimage/scripts/tab-reorder.mjs index 04f27f5c0..686c81a54 100644 --- a/.agents/skills/verify-codeimage/scripts/tab-reorder.mjs +++ b/.agents/skills/verify-codeimage/scripts/tab-reorder.mjs @@ -146,6 +146,37 @@ export async function auditTabLayouts({feature, fresh, ...options}) { ), ); } + await feature('plain-text-tab-icon', () => + fresh( + {name: 'plain-text-tab-icon', layout: 'inspector'}, + async ({doctor, page}) => { + await doctor(); + await completeTabExtension( + page, + page.getByRole('combobox', {name: 'Tab name', exact: true}), + {prefix: 'plain.tx', extension: '.txt', method: 'keyboard'}, + ); + const icon = page.locator('main [data-active=true] svg path.path'); + await icon.waitFor(); + assert.equal( + await icon.evaluate(path => getComputedStyle(path).fill), + 'rgb(255, 255, 255)', + ); + await page + .getByRole('textbox', {name: 'Search themes'}) + .fill('XCode Light'); + await page.getByRole('option', {name: /XCode Light/i}).click(); + await page + .locator('main [data-codeimage-frame-mode=light]') + .filter({has: page.locator('[data-active=true] svg path.path')}) + .waitFor(); + assert.equal( + await icon.evaluate(path => getComputedStyle(path).fill), + 'rgb(60, 60, 60)', + ); + }, + ), + ); } async function auditTabs( diff --git a/apps/codeimage/index.html b/apps/codeimage/index.html index c69fe4730..34917f9c7 100644 --- a/apps/codeimage/index.html +++ b/apps/codeimage/index.html @@ -91,6 +91,8 @@ ({ click: async () => {}, - success: vi.fn(), - error: vi.fn(), + show: vi.fn(), })); vi.mock('@codeimage/locale', () => ({ useI18n: () => [(key: string) => key], })); -vi.mock('@codeimage/ui', () => ({ - toast: {success: menu.success, error: menu.error}, +vi.mock('@ui/notifications', () => ({ + editorNotifications: {show: menu.show}, })); vi.mock('@ui/DropdownMenu', () => ({ DropdownMenuItem: (props: { @@ -74,10 +73,12 @@ it('copies exactly toCliConfig output from the menu action shared by both editor expect(html).toContain('cliConfig.copy'); await menu.click(); expect(writeText).toHaveBeenCalledExactlyOnceWith(toCliConfig(data)); - expect(menu.success).toHaveBeenCalledExactlyOnceWith('cliConfig.copied', { - position: 'bottom-center', + expect(menu.show).toHaveBeenCalledExactlyOnceWith({ + description: 'cliConfig.copied', + tone: 'success', + duration: 2000, + theme: 'page', }); - expect(menu.error).not.toHaveBeenCalled(); }); it('reports a clipboard failure without success feedback', async () => { @@ -86,8 +87,9 @@ it('reports a clipboard failure without success feedback', async () => { }); renderToString(() => createComponent(CopyCliConfigMenuItem, {data})); await menu.click(); - expect(menu.error).toHaveBeenCalledExactlyOnceWith('cliConfig.copyError', { - position: 'bottom-center', + expect(menu.show).toHaveBeenCalledExactlyOnceWith({ + description: 'cliConfig.copyError', + tone: 'danger', + theme: 'page', }); - expect(menu.success).not.toHaveBeenCalled(); }); diff --git a/apps/codeimage/src/components/Presets/CopyCliConfigMenuItem.tsx b/apps/codeimage/src/components/Presets/CopyCliConfigMenuItem.tsx index 9e2823fa2..2be5b8c30 100644 --- a/apps/codeimage/src/components/Presets/CopyCliConfigMenuItem.tsx +++ b/apps/codeimage/src/components/Presets/CopyCliConfigMenuItem.tsx @@ -1,6 +1,6 @@ import {useI18n} from '@codeimage/locale'; import type {PresetData} from '@codeimage/store/presets/types'; -import {toast} from '@codeimage/ui'; +import {editorNotifications} from '@ui/notifications'; import {DropdownMenuItem} from '@ui/DropdownMenu'; import type {AppLocaleEntries} from '../../i18n'; import {toCliConfig} from './cliConfig'; @@ -12,10 +12,19 @@ export function CopyCliConfigMenuItem(props: {data: PresetData}) { try { await navigator.clipboard.writeText(toCliConfig(props.data)); } catch { - toast.error(t('cliConfig.copyError'), {position: 'bottom-center'}); + editorNotifications.show({ + tone: 'danger', + description: t('cliConfig.copyError'), + theme: 'page', + }); return; } - toast.success(t('cliConfig.copied'), {position: 'bottom-center'}); + editorNotifications.show({ + tone: 'success', + description: t('cliConfig.copied'), + theme: 'page', + duration: 2000, + }); } return ( diff --git a/apps/codeimage/src/components/Presets/PresetUpdateDialog.tsx b/apps/codeimage/src/components/Presets/PresetUpdateDialog.tsx index 32b825c39..dea6977b0 100644 --- a/apps/codeimage/src/components/Presets/PresetUpdateDialog.tsx +++ b/apps/codeimage/src/components/Presets/PresetUpdateDialog.tsx @@ -1,7 +1,7 @@ import {useI18n} from '@codeimage/locale'; import type {Preset} from '@codeimage/store/presets/types'; import {Box, HStack, SvgIcon, Text} from '@codeimage/ui'; -import {Button} from '@ui/legacy-controls'; +import {Button} from '@codeui/kit'; import {Dialog, DialogPanelContent, DialogPanelFooter} from '@ui/Dialog'; import type {ControlledDialogProps} from '@core/hooks/createControlledDialog'; import type {Element as JSXElement, VoidProps} from 'solid-js'; @@ -75,7 +75,7 @@ export function PresetUpdateDialog( block size={'sm'} type="button" - theme={'secondary'} + variant={'secondary'} onClick={() => propsWithDefault.onOpenChange(false)} > {t('common.close')} @@ -85,7 +85,7 @@ export function PresetUpdateDialog( block size={'sm'} type="submit" - theme={propsWithDefault.actionType} + variant={propsWithDefault.actionType} onClick={() => { propsWithDefault.onConfirm(); propsWithDefault.onOpenChange(false); diff --git a/apps/codeimage/src/components/PropertyEditor/SidebarPopover/SidebarPopover.css.ts b/apps/codeimage/src/components/PropertyEditor/SidebarPopover/SidebarPopover.css.ts index 3a9f31b67..9483a7350 100644 --- a/apps/codeimage/src/components/PropertyEditor/SidebarPopover/SidebarPopover.css.ts +++ b/apps/codeimage/src/components/PropertyEditor/SidebarPopover/SidebarPopover.css.ts @@ -1,5 +1,5 @@ import {themeVars} from '@codeimage/ui'; -import {responsiveStyle, themeTokens} from '@codeui/kit/foundation'; +import {responsiveStyle, themeTokens} from '@codeui/kit/tokens'; import {style} from '@vanilla-extract/css'; export const sidebarPopover = style([ diff --git a/apps/codeimage/src/components/PropertyEditor/controls/AspectRatioPicker/AspetRatioPicker.css.ts b/apps/codeimage/src/components/PropertyEditor/controls/AspectRatioPicker/AspetRatioPicker.css.ts index 3fd05dfca..3aa123776 100644 --- a/apps/codeimage/src/components/PropertyEditor/controls/AspectRatioPicker/AspetRatioPicker.css.ts +++ b/apps/codeimage/src/components/PropertyEditor/controls/AspectRatioPicker/AspetRatioPicker.css.ts @@ -1,6 +1,6 @@ import {textFieldStyles, themeVars, withThemeMode} from '@codeimage/ui'; import {darkGrayScale} from '@codeimage/ui/themes/darkTheme'; -import {responsiveStyle} from '@codeui/kit/foundation'; +import {responsiveStyle} from '@codeui/kit/tokens'; import {createVar, style} from '@vanilla-extract/css'; export const input = style([ diff --git a/apps/codeimage/src/components/PropertyEditor/controls/ColorPicker/CustomColorPicker.css.ts b/apps/codeimage/src/components/PropertyEditor/controls/ColorPicker/CustomColorPicker.css.ts index 82d671c75..0908e6135 100644 --- a/apps/codeimage/src/components/PropertyEditor/controls/ColorPicker/CustomColorPicker.css.ts +++ b/apps/codeimage/src/components/PropertyEditor/controls/ColorPicker/CustomColorPicker.css.ts @@ -5,7 +5,7 @@ import { withThemeMode, } from '@codeimage/ui'; import {darkGrayScale} from '@codeimage/ui/themes/darkTheme'; -import {responsiveStyle} from '@codeui/kit/foundation'; +import {responsiveStyle} from '@codeui/kit/tokens'; import {style} from '@vanilla-extract/css'; import type {RecipeVariants} from '@vanilla-extract/recipes'; import {recipe} from '@vanilla-extract/recipes'; diff --git a/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPicker.css.ts b/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPicker.css.ts index 42b4d9c4e..fc2c7da5b 100644 --- a/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPicker.css.ts +++ b/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPicker.css.ts @@ -1,6 +1,6 @@ import {textFieldStyles, themeVars} from '@codeimage/ui'; -import {responsiveStyle, themeTokens} from '@codeui/kit/foundation'; -import {createVar, style} from '@vanilla-extract/css'; +import {responsiveStyle, themeTokens} from '@codeui/kit/tokens'; +import {style} from '@vanilla-extract/css'; export const input = style([ textFieldStyles.baseField, @@ -26,22 +26,17 @@ export const inputIcon = style({ flexShrink: 0, }); -export const fontListboxHeight = createVar(); +const listHeight = '350px'; export const fontOption = style({fontSize: '80%'}); -export const fontPickerPopover = style([ - { - vars: { - [fontListboxHeight]: '350px', - }, - }, +export const fontPickerPopover = style( responsiveStyle({ md: { maxWidth: 'initial', }, }), -]); +); export const experimentalFlag = style({ color: themeVars.dynamicColors.descriptionTextColor, @@ -50,7 +45,7 @@ export const experimentalFlag = style({ export const centeredContent = style({ width: '100%', - height: fontListboxHeight, + height: listHeight, display: 'flex', flexDirection: 'column', gap: '1rem', @@ -60,11 +55,11 @@ export const centeredContent = style({ }); export const virtualizedFontListboxWrapper = style({ - height: fontListboxHeight, + height: listHeight, }); export const virtualizedFontListbox = style({ - maxHeight: fontListboxHeight, + maxHeight: listHeight, overflow: 'auto', height: '100%', }); diff --git a/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPickerListbox.tsx b/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPickerListbox.tsx index 659a7bc90..e03e129eb 100644 --- a/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPickerListbox.tsx +++ b/apps/codeimage/src/components/PropertyEditor/controls/FontPicker/FontPickerListbox.tsx @@ -1,4 +1,4 @@ -import type {ListboxProps} from '@ui/legacy-listbox'; +import type {ListboxProps} from '@codeui/kit'; import {fontOption} from './FontPicker.css'; interface FontPickerListboxProps { @@ -25,15 +25,16 @@ export const createFontPickerListboxProps = (props: FontPickerListboxProps) => { get options() { return props.items; }, - optionValue: item => item.value, - optionTextValue: item => item.label, - itemLabel: item => { - const label = document.createElement('span'); - label.className = fontOption; - label.style.fontFamily = `${item.label}, monospace`; - label.textContent = item.label; - return label; - }, + optionValue: 'value', + optionTextValue: 'label', + itemLabel: item => ( + + {item.label} + + ), get value() { return [props.value]; }, @@ -41,5 +42,5 @@ export const createFontPickerListboxProps = (props: FontPickerListboxProps) => { const option = values.values().next().value; if (option !== undefined) props.onChange(option); }, - } satisfies ListboxProps; + } satisfies ListboxProps; }; diff --git a/apps/codeimage/src/components/PropertyEditor/controls/ImagePicker/ImagePicker.css.ts b/apps/codeimage/src/components/PropertyEditor/controls/ImagePicker/ImagePicker.css.ts index 7a4ce706b..99e2e1c9b 100644 --- a/apps/codeimage/src/components/PropertyEditor/controls/ImagePicker/ImagePicker.css.ts +++ b/apps/codeimage/src/components/PropertyEditor/controls/ImagePicker/ImagePicker.css.ts @@ -1,6 +1,6 @@ import {themeVars, withThemeMode} from '@codeimage/ui'; import {darkGrayScale} from '@codeimage/ui/themes/darkTheme'; -import {responsiveStyle, themeTokens} from '@codeui/kit/foundation'; +import {responsiveStyle, themeTokens} from '@codeui/kit/tokens'; import {createVar, style} from '@vanilla-extract/css'; export const gridSize = createVar(); diff --git a/apps/codeimage/src/components/Terminal/GlassReflection/TerminalGlassReflection.css.ts b/apps/codeimage/src/components/Terminal/GlassReflection/TerminalGlassReflection.css.ts index 9add85781..31d0e6bae 100644 --- a/apps/codeimage/src/components/Terminal/GlassReflection/TerminalGlassReflection.css.ts +++ b/apps/codeimage/src/components/Terminal/GlassReflection/TerminalGlassReflection.css.ts @@ -20,11 +20,11 @@ export const content = style({ zIndex: '100', selectors: { - '[data-theme-mode=light] &': { + '[data-codeimage-frame-mode=light] &': { background: 'linear-gradient(rgba(100,100,100, .035) 35%, rgba(0,0,0,0%) 100%)', }, - '[data-theme-mode=dark] &': { + '[data-codeimage-frame-mode=dark] &': { background: 'linear-gradient(rgba(255,255,255, .035) 35%, rgba(255,255,255,0%) 100%)', }, diff --git a/apps/codeimage/src/components/Terminal/Tabs/Tab/Tab.css.ts b/apps/codeimage/src/components/Terminal/Tabs/Tab/Tab.css.ts index 2c2e1cff7..e940e7aad 100644 --- a/apps/codeimage/src/components/Terminal/Tabs/Tab/Tab.css.ts +++ b/apps/codeimage/src/components/Terminal/Tabs/Tab/Tab.css.ts @@ -86,12 +86,12 @@ export const tab = recipe({ backdropFilter: 'blur(20px) saturate(180%)', ['webkitBackdropFilter' as string]: 'blur(20px) saturate(180%)', }, - '[data-theme-mode=dark] &': { + '[data-codeimage-frame-mode=dark] &': { vars: { [tabVars.tabSecondaryHoverBg]: '255, 255, 255', }, }, - '[data-theme-mode=light] &': { + '[data-codeimage-frame-mode=light] &': { vars: { [tabVars.tabSecondaryHoverBg]: '0, 0, 0', }, @@ -244,10 +244,10 @@ export const tabCloseIcon = style({ width: '14px', minWidth: '14px', selectors: { - '[data-theme-mode=dark] &': { + '[data-codeimage-frame-mode=dark] &': { color: themeVars.backgroundColor.white, }, - '[data-theme-mode=light] &': { + '[data-codeimage-frame-mode=light] &': { color: themeVars.backgroundColor.black, }, }, diff --git a/apps/codeimage/src/components/Terminal/Tabs/TabAddButton/TabAddButton.css.ts b/apps/codeimage/src/components/Terminal/Tabs/TabAddButton/TabAddButton.css.ts index 839019186..01a7433e0 100644 --- a/apps/codeimage/src/components/Terminal/Tabs/TabAddButton/TabAddButton.css.ts +++ b/apps/codeimage/src/components/Terminal/Tabs/TabAddButton/TabAddButton.css.ts @@ -24,13 +24,13 @@ export const button = style({ backgroundColor: `rgba(${tabVars.tabSecondaryHoverBg}, .05)`, }, selectors: { - '[data-theme-mode=dark] &': { + '[data-codeimage-frame-mode=dark] &': { color: themeVars.backgroundColor.white, vars: { [tabVars.tabSecondaryHoverBg]: '255, 255, 255', }, }, - '[data-theme-mode=light] &': { + '[data-codeimage-frame-mode=light] &': { color: themeVars.backgroundColor.black, vars: { [tabVars.tabSecondaryHoverBg]: '0, 0, 0', diff --git a/apps/codeimage/src/components/Terminal/TerminalHost.tsx b/apps/codeimage/src/components/Terminal/TerminalHost.tsx index 867dd6cb0..1118031dc 100644 --- a/apps/codeimage/src/components/Terminal/TerminalHost.tsx +++ b/apps/codeimage/src/components/Terminal/TerminalHost.tsx @@ -89,7 +89,7 @@ export const TerminalHost: FlowComponent = props => { class={clsx(styles.wrapper, props.themeClass)} data-lite={props.lite === undefined ? undefined : String(props.lite)} data-preview={props.preview ? 'true' : ''} - data-theme-mode={darkMode() ? 'dark' : 'light'} + data-codeimage-frame-mode={darkMode() ? 'dark' : 'light'} data-header-visible={String(props.showHeader)} data-accent-header={String( props.accentVisible && !props.alternativeTheme, diff --git a/apps/codeimage/src/components/Terminal/WindowsTerminal/WindowsTerminal.css.ts b/apps/codeimage/src/components/Terminal/WindowsTerminal/WindowsTerminal.css.ts index d12f418d1..7859a7093 100644 --- a/apps/codeimage/src/components/Terminal/WindowsTerminal/WindowsTerminal.css.ts +++ b/apps/codeimage/src/components/Terminal/WindowsTerminal/WindowsTerminal.css.ts @@ -22,12 +22,12 @@ export const headerIconRow = style({ columnGap: themeVars.spacing['3'], }, - [`[data-theme-mode=light] &`]: { + [`[data-codeimage-frame-mode=light] &`]: { vars: { [vars.iconFill]: themeVars.backgroundColor.black, }, }, - [`[data-theme-mode=dark] &`]: { + [`[data-codeimage-frame-mode=dark] &`]: { vars: { [vars.iconFill]: themeVars.backgroundColor.white, }, diff --git a/apps/codeimage/src/components/Terminal/terminal.css.ts b/apps/codeimage/src/components/Terminal/terminal.css.ts index 09adaea47..b46a2378c 100644 --- a/apps/codeimage/src/components/Terminal/terminal.css.ts +++ b/apps/codeimage/src/components/Terminal/terminal.css.ts @@ -40,13 +40,13 @@ export const wrapper = style([ [terminalVars.headerHeight]: terminalVars.headerHeightLite, }, }, - '&[data-theme-mode=light]': { + '&[data-codeimage-frame-mode=light]': { vars: { [terminalVars.headerColor]: `255, 255, 255`, [glassBorderVar]: glassBorderLight, }, }, - '&[data-theme-mode=dark]': { + '&[data-codeimage-frame-mode=dark]': { vars: { [glassBorderVar]: glassBorderDark, [terminalVars.headerColor]: `0, 0, 0`, @@ -107,13 +107,13 @@ export const header = style({ transition: 'background-color .2s ease-in-out', selectors: { - '[data-theme-mode=light] &[data-accent-visible=true]': { + '[data-codeimage-frame-mode=light] &[data-accent-visible=true]': { backgroundColor: fallbackVar( terminalVars.headerBackgroundColor, `rgba(0, 0, 0, .06)`, ), }, - '[data-theme-mode=dark] &[data-accent-visible=true]': { + '[data-codeimage-frame-mode=dark] &[data-accent-visible=true]': { backgroundColor: fallbackVar( terminalVars.headerBackgroundColor, `rgba(255, 255, 255, .06)`, diff --git a/apps/codeimage/src/components/Toolbar/CopyAltTextButton.tsx b/apps/codeimage/src/components/Toolbar/CopyAltTextButton.tsx index d0e5f631a..57538c706 100644 --- a/apps/codeimage/src/components/Toolbar/CopyAltTextButton.tsx +++ b/apps/codeimage/src/components/Toolbar/CopyAltTextButton.tsx @@ -1,7 +1,7 @@ import {useI18n} from '@codeimage/locale'; import {getActiveEditorStore} from '@codeimage/store/editor/activeEditor'; -import {toast} from '@codeimage/ui'; -import {Button, Tooltip} from '@ui/legacy-controls'; +import {notifications} from '@ui/notifications'; +import {Button, Tooltip} from '@codeui/kit'; import {altText} from '@core/altText'; import type {AppLocaleEntries} from '../../i18n'; import {getWhatsNew} from '../../state/whats-new'; @@ -26,18 +26,28 @@ export function CopyAltTextButton(props: { () => { getWhatsNew().seen('alt'); onCopy?.(); - toast.success(() => t('altText.copied')); + notifications.show({ + tone: 'success', + description: () => t('altText.copied'), + theme: 'page', + duration: 2000, + }); }, - () => toast.error(() => t('altText.copyError')), + () => + notifications.show({ + tone: 'danger', + description: () => t('altText.copyError'), + theme: 'page', + }), ); } return ( - + close(fromKeyboard(event))} > @@ -213,7 +213,7 @@ export function Nudge(props: {