From 8359a23e9d3e4c47078218f7458ff83d1f7b30d0 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Thu, 19 Nov 2026 12:19:06 -0800 Subject: [PATCH 1/9] Vue kit: the chat panel's and voice control's buttons and glyphs are kit controls Every hand-written button in the AI chat panel (Settings, the quick prompts, an attachment's remove, Attach layer, Attach a file, Expand conversation, the command suggestions, Expand chat, Add attachment and Send / Stop reply) and in the voice control (Open AI chat, Back to chat, Back to voice, the Preview and Settings tabs and the error tray's DISMISS) is a ghost UiButton keeping its id, classes, aria and data attributes, title and listeners. The Settings and tab Material glyphs are UiIcons with :size="null", so voice-cost.css and voice-card.css still size them. The tabs keep role="tab" and aria-selected; DISMISS is a text button, so it stays a UiButton rather than a UiCloseButton. The inline SVG glyphs, the message box, the file picker and the minutes field stay as they are. src/ui/kit/chatVoiceControls.test.mjs pins it: no hand-written button or Material span in the chat, voice, voice card, panel layout and visualizer templates, kit counts per file, the pressed toggles through :pressed, the icons' :size="null", the native fields left, and no button built in script by the voice modules. docs/VUE-MIGRATION.md describes the surface. Co-authored-by: Manjunath Paparaju --- docs/VUE-MIGRATION.md | 17 +++ scripts/format-scope.json | 1 + src/ui/kit/chatVoiceControls.test.mjs | 150 ++++++++++++++++++++++++++ src/ui/views/panels/ChatPanel.vue | 22 ++-- src/ui/views/panels/VoiceControl.vue | 13 +-- 5 files changed, 187 insertions(+), 16 deletions(-) create mode 100644 src/ui/kit/chatVoiceControls.test.mjs diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md index d82f798808..9a54cd9452 100644 --- a/docs/VUE-MIGRATION.md +++ b/docs/VUE-MIGRATION.md @@ -158,6 +158,23 @@ while a query is typed. The Filter button opens a disclosure and carries a `UiIcon` with `:size="null"`, so `layer-finder.css` still sizes them (`src/ui/kit/layerFinderControls.test.mjs` pins it); the search field's magnifier is `UiSearchField`'s own span. +The AI chat panel's and the voice control's buttons are ghost +`UiButton`s: the chat's Settings, quick prompts, attachment removes, +Attach layer, Attach a file, Expand conversation, command suggestions, +Expand chat, Add attachment and Send (a submit button that turns into +Stop reply), and the voice control's Open AI chat, Back to chat, Back to +voice, its Preview and Settings tabs and the error tray's DISMISS, beside +the tier button, the mic and the dock and minimize buttons, which already +were. The tier button and dock are pressed toggles; the mic is one only +while its owner has a state for it; the tabs keep `role="tab"` and +`aria-selected`. DISMISS is a text button, not a cross, so it is not a +`UiCloseButton`. The Settings and tab glyphs are `UiIcon`s with +`:size="null"`, so voice-cost.css and voice-card.css still size them +(`src/ui/kit/chatVoiceControls.test.mjs` pins it). The chat bubble, +globe, attach, send and stop, expand and Back glyphs stay inline SVG, +since no Material symbol the page loads draws them the same, and the +message box, file picker and inactivity minutes stay native fields, which +the kit has none of. The voice modules build no controls in script. `UiSelect` renders the bare native select (Core's labels sit outside it or come as an `aria-label`) with `v-model`, `options` and `disabled`; options that carry their own attributes come through the slot, a caller's diff --git a/scripts/format-scope.json b/scripts/format-scope.json index ebfa59916f..4f918bae17 100644 --- a/scripts/format-scope.json +++ b/scripts/format-scope.json @@ -1350,6 +1350,7 @@ "src/ui/kit/welcomeControls.test.mjs", "src/ui/kit/omnibarControls.test.mjs", "src/ui/kit/storiesControls.test.mjs", + "src/ui/kit/chatVoiceControls.test.mjs", "src/ui/styles/chip.css", "src/ui/styles/empty-state.css", "src/ui/rail/RailChips.vue", diff --git a/src/ui/kit/chatVoiceControls.test.mjs b/src/ui/kit/chatVoiceControls.test.mjs new file mode 100644 index 0000000000..b1716157ca --- /dev/null +++ b/src/ui/kit/chatVoiceControls.test.mjs @@ -0,0 +1,150 @@ +// The AI chat panel's and the voice control's buttons and Material glyphs +// are the kit's: neither their templates nor the voice card and panel +// layout buttons they render hand-write a + @@ -76,7 +78,7 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];

{{ t('Explore with a question') }}

{{ t('Find a place, explore live data, or change your view.') }}

- + {{ prompt }}
{{ message.role === 'user' ? t('YOU') : ASSISTANT_NAME }}{{ message.text }} @@ -86,7 +88,7 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')];

{{ props.view.chat.authNote }}

- + {{ item.name }} ×
@@ -95,27 +97,27 @@ const quickPrompts = () => [t('Fly to Tokyo'), t('Show live flights')]; - + {{ t('Attach layer') }}
- + {{ t('Attach a file') }}

{{ t('TXT, Markdown, CSV, JSON or GeoJSON · up to 10 KB in total. Attachments are sent to your AI provider with your message.') }}

{{ group.label }} - + {{ command }}
- - + + - +
diff --git a/src/ui/views/panels/VoiceControl.vue b/src/ui/views/panels/VoiceControl.vue index bcbce56b87..ba7c04907f 100644 --- a/src/ui/views/panels/VoiceControl.vue +++ b/src/ui/views/panels/VoiceControl.vue @@ -11,6 +11,7 @@ import PanelLayoutButtons from './PanelLayoutButtons.vue'; import UiButton from '../../kit/UiButton.vue'; import UiCheckbox from '../../kit/UiCheckbox.vue'; import UiCloseButton from '../../kit/UiCloseButton.vue'; +import UiIcon from '../../kit/UiIcon.vue'; import UiSelect from '../../kit/UiSelect.js'; // The voice control in the command dock, as its presenter @@ -79,7 +80,7 @@ const frameStyle = (panel) => ({ {{ view.mic.text }} - + {{ t('CHAT') }} @@ -94,12 +95,12 @@ const frameStyle = (panel) => ({
- - + {{ t('Back to chat') }} + {{ t('Back to voice') }} {{ t('VOICE') }}
- - + +
@@ -158,7 +159,7 @@ const frameStyle = (panel) => ({