From 35fb3684bacffe8c5bed3871b50f33a09c84ec13 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Thu, 19 Nov 2026 12:24:55 -0800 Subject: [PATCH] Vue kit: Draw's and Import's buttons and glyphs are kit controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UTILITIES ▸ Draw and Import no longer hand-write a button or a Material Symbols span. Clear and Import are ghost UiButtons (Draw already was), and the Draw and Import glyphs are UiIcons that keep pp-icon, with :size="null" so controls.css still sizes them. Draw's five colour swatches (in the toolbar and in a drawn shape's row) are ghost UiButtons that keep role="radio", aria-checked and their own active class; they are not pressed toggles. A drawn shape's row (its swatch, show/hide, the application's row actions and fly to) is on the kit too, beside the remove UiCloseButton it already had; its glyphs are UiIcons with :size="null". Show/hide keeps naming itself Show … / Hide … rather than becoming a pressed toggle. Template refs that now hold a component reach the button through $el: the swatches' arrow-key focus and Import's focus fallback when the last imported file goes. The Street Level panel's controls were already kit controls (its ⤢ ⤡ and ⚠ are text characters), so its template is unchanged; the new guard test pins it with Draw and Import. src/ui/kit/drawControls.test.mjs pins it: no hand-written button, select, checkbox, range or Material span in DrawControls, DrawSwatches, DrawMarkList, GeoImport or StreetLevelPanel; the kit counts per file; Draw a pressed toggle with active; the swatches radios rather than pressed; :size="null" on every glyph; and the $el refs. docs/VUE-MIGRATION.md describes the surface. Co-authored-by: Manjunath Paparaju --- docs/VUE-MIGRATION.md | 26 ++++-- scripts/format-scope.json | 1 + src/ui/kit/drawControls.test.mjs | 126 +++++++++++++++++++++++++++ src/ui/views/panels/DrawControls.vue | 5 +- src/ui/views/panels/DrawMarkList.vue | 4 +- src/ui/views/panels/DrawSwatches.vue | 6 +- src/ui/views/panels/GeoImport.vue | 8 +- 7 files changed, 162 insertions(+), 14 deletions(-) create mode 100644 src/ui/kit/drawControls.test.mjs diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md index 254ab1152b..6c660ce142 100644 --- a/docs/VUE-MIGRATION.md +++ b/docs/VUE-MIGRATION.md @@ -93,12 +93,13 @@ button, whose state the event layer writes into the attributes its panel renders, and Explore's story cards, which are `role="button"` elements, not buttons (`src/ui/kit/viewControls.test.mjs` pins it). Where the converted buttons draw Material symbols (the tilt-map button, the Context -header's search and expand, the imported files' row actions and the rail -chips' icons), the glyphs are `UiIcon`s with `:size="null"`, so the site -rules still size them. Core's pressable chips and pills (the rail cards' -chips and action chips, Recent Imagery's day chips, SWAP and ZOOM IN, map -sources, cities and places, and the view context's place and layer chips) -are `UiButton`s too; the key setup chip is still a plain button. `UiChip` +header's search and expand, Draw, Import, the imported files' and drawn +shapes' row actions and the rail chips' icons), the glyphs are `UiIcon`s +with `:size="null"`, so the site rules still size them. Core's pressable +chips and pills (the rail cards' chips and action chips, Recent Imagery's +day chips, SWAP and ZOOM IN, map sources, cities and places, and the view +context's place and layer chips) are `UiButton`s too; the key setup chip +is still a plain button. `UiChip` is a non-interactive label chip, used by the voice card. The welcome card's buttons (SKIP, the three start tiles, BROWSE STORIES, BACK and the main NEXT / ENTER GOD MODE action) are ghost `UiButton`s: @@ -175,6 +176,19 @@ 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. +Utilities' Draw and Import are on the kit. Draw (a pressed toggle with +`active`), Clear and Import are ghost `UiButton`s, their glyphs `UiIcon`s +with `pp-icon` and `:size="null"`. Draw's five colour swatches, in the +toolbar and in a drawn shape's row, are ghost `UiButton`s with +`role="radio"`: they say they are chosen with `aria-checked` and their own +`active` class, never `aria-pressed`. A drawn shape's row (its swatch, +show/hide, the application's row actions and fly to, beside its remove +`UiCloseButton`) is on the kit too, its glyphs `UiIcon`s with +`:size="null"`, so `controls.css` still sizes them; show/hide says what it +does in its name (Show …, Hide …) rather than being pressed. The Street +Level panel's controls already were kit controls; its EXPAND ⤢ ⤡ and its +errors' ⚠ are text characters and stay text +(`src/ui/kit/drawControls.test.mjs` pins it). `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 9cbc1bda9a..f05758f951 100644 --- a/scripts/format-scope.json +++ b/scripts/format-scope.json @@ -1351,6 +1351,7 @@ "src/ui/kit/omnibarControls.test.mjs", "src/ui/kit/storiesControls.test.mjs", "src/ui/kit/commandDockControls.test.mjs", + "src/ui/kit/drawControls.test.mjs", "src/ui/styles/chip.css", "src/ui/styles/empty-state.css", "src/ui/rail/RailChips.vue", diff --git a/src/ui/kit/drawControls.test.mjs b/src/ui/kit/drawControls.test.mjs new file mode 100644 index 0000000000..0a81e91990 --- /dev/null +++ b/src/ui/kit/drawControls.test.mjs @@ -0,0 +1,126 @@ +// UTILITIES ▸ Draw (its toggle, Clear, the colour swatches and the drawn +// shapes' rows), Import and the Street Level panel are on the kit: none of +// them hand-writes a