diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md
index cd8c9078c9..d82f798808 100644
--- a/docs/VUE-MIGRATION.md
+++ b/docs/VUE-MIGRATION.md
@@ -37,9 +37,12 @@ one-panel rule too. Share links continue to record which panels are open.
## Component kit
`src/ui/kit/` holds the generic components: `UiRail`, `UiTooltip`, `UiIcon`,
-`UiButton`, `UiCloseButton`, `UiPanel`, `UiSegmented`, `UiSlider`, `UiChip`,
-`UiSelect`, `UiSearchField`, `UiCheckbox`, `UiDialog`, `UiBadge` and `UiEmpty` so far, with more
-joining as the controls they serve are converted. One component
+`UiButton`, `UiCloseButton`, `UiPanel`, `UiPanelToggle` (a panel's collapse
+button, which `UiPanel` and `PanelCollapseButton` draw), `UiPanelEdge` (a
+panel header's edge switch), `UiSegmented`, `UiSlider`, `UiChip`,
+`UiSelect`, `UiSearchField`, `UiCheckbox`, `UiDialog`, `UiBadge` and
+`UiEmpty` so far, with more joining as the controls they serve are
+converted. One component
serves every use of a control, with props for the differences (`UiPanel`'s
`sideways`, `glow`, `scroll`), rather than a copy per panel. The components
are styled by the existing stylesheet and custom properties, and they contain
@@ -83,14 +86,20 @@ segmented group in Core is a `UiSegmented`; the old `segmentedControl.js`
adapter is gone.
`UiButton` adds `pressedClass`, Core's class on a pressed toggle (most use
`active`); its pressed classes toggle through `classList`, so a class other
-code adds (a voice highlight) survives a press. Not every pressed toggle in
-the views is one yet: the context view and a few panel buttons still
-hand-write theirs, and
-Bhote Koshi's cinematic button and the tilt-map button have owners that
-write their state into the DOM. Core's
-pressable chips and pills (rail card chips, map sources, cities and places)
-are `UiButton`s too; `UiChip` is a non-interactive label chip, used by
-the voice card.
+code adds (a voice highlight) survives a press. Every pressed toggle (a
+control with `aria-pressed`) in the views is a `UiButton` with `pressed`
+except two that keep their own `aria-pressed`: Bhote Koshi's cinematic
+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) are `UiButton`s too; the view context's place
+and layer chips and the key setup chip are still plain buttons. `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:
the start tiles are pressed toggles, and all but SKIP keep `aria-disabled`
@@ -106,11 +115,13 @@ Story screen's Context button and the timeline's Expand map are pressed
toggles, with no pressed class since their skins read `aria-pressed`;
Explore's story cards are `role="button"` elements and keep their own
`aria-pressed`. Their glyphs are inline SVG drawn for Stories, which no
-Material symbol the page loads draws the same, so they stay SVG; the two
-search fields keep their own markup, since `UiSearchField`'s Material
-magnifier would replace their SVG one, and their clear buttons, which draw
-an SVG cross, are ghost `UiButton`s rather than `UiCloseButton`s
-(`src/ui/kit/storiesControls.test.mjs` pins it).
+Material symbol the page loads draws the same, so they stay SVG; the three
+search fields (Explore's two and the Story context sheet's story search, a
+combobox) keep their own markup, since `UiSearchField`'s Material
+magnifier would replace their SVG one, and Explore's two clear buttons,
+which draw an SVG cross, are ghost `UiButton`s rather than
+`UiCloseButton`s (`src/ui/kit/storiesControls.test.mjs` pins it).
+Explore's sort is a `UiSelect`.
The Omnibar's mic (a pressed toggle with `active`) and its suggestion
strip's chips (options, so `aria-current` rather than `pressed`) are
ghost `UiButton`s, and its search, row and chip glyphs are `UiIcon`s with
@@ -153,7 +164,12 @@ options that carry their own attributes come through the slot, a caller's
`@change` still reaches the select, and `hold` works as in `UiSlider`.
Without `hold`, a select takes its model back after its own change renders,
so a pick its owner refuses goes back; an owner that answers later (the SDR
-gain) takes `hold`. Every select in the views is a `UiSelect`.
+gain) takes `hold`. A layer row's range ends are repainted on a later frame
+and may come back reordered (a start picked after the end swaps them), so
+they take a plain `value` instead of a model: a pick stays until the owner
+publishes a different value, which shows at once, focused or not
+(`src/ui/layerPanel/rowRange.test.mjs`). Every select in the views is a
+`UiSelect` (`src/ui/kit/viewControls.test.mjs` pins it).
`UiBadge` takes a `tone` and carries Core's `gev-status-badge`; its
density variants and colours stay caller classes, and it renders the CCTV
source and calibration badges and the rail card badges. `UiEmpty` takes
@@ -165,13 +181,16 @@ empty rows stay a paragraph and table cells.
no tip unless the site passes a `title`; attributes and classes pass through,
so each site keeps its id, feature class and look. Every close, dismiss and
clear button in the views that draws a cross is one
-(`src/ui/kit/closeButtons.test.mjs` pins it) except Story Explore's two
-search clears, whose SVG cross is neither of its glyphs; the Story context
+(`src/ui/kit/closeButtons.test.mjs` and `viewControls.test.mjs` pin it,
+for a bare × or one in a span) except Story Explore's two search clears,
+whose SVG cross is neither of its glyphs, and an imported file's
+Remove, one of the row's icon `UiButton`s (show or hide, fly to, remove)
+that draw the icon the file import names for each. The Story context
sheet's Close is a text button, a plain `UiButton`. Street Level's and the
-space mission's keep `bare`, since their skins set their own padding and
-border, and so does the credits list's. The
-Quebec CCTV overlay's close is one too, and so is the Omnibar guide's,
-which keeps its feature class and tip.
+space mission's (its deselect and the replay's Cancel) keep `bare`, since
+their skins set their own padding and border, and so does the credits
+list's. The Quebec CCTV overlay's close is one too, and so is the Omnibar
+guide's, which keeps its feature class and tip.
`UiSearchField` takes `v-model`, a required `label` (the input's
accessible name), `placeholder` and `tag` (`div`, given `role="search"` by
the site, or `label`); attributes and classes go to the frame, and
@@ -215,7 +234,8 @@ classes, styles and listeners go to the dialog, and `element` is exposed.
The Data Library and the scene sharing dialogs are `UiDialog`s
(`src/ui/kit/dialogs.test.mjs` pins it); the panels drawn as
`role="dialog"` (key setup, the welcome launcher, the CCTV popup, Story
-Explore's filter, the credits) and the render failure's `alertdialog` are
+Explore's filter, the credits, the Omnibar guide's callout) and the render
+failure's `alertdialog` are
other controls. The two dialogs share no declarations, so it has no kit
rules.
`UiSlider` keeps the native range input rather than drawing a
@@ -227,9 +247,12 @@ are, without Core's slider surface). A caller's own input, change and blur
handlers still reach the input, and a null model leaves it as it is. It is
a functional render-function component, so the portable `./ui/input` rows
use it without a component compiler. Every range in the views is a
-`UiSlider` except the radio tuner's: its owner moves the handle back to the
+`UiSlider` except two. The radio tuner's owner moves the handle back to the
selected station on a drag's first input without changing the slot, which
-a functional component would not render again.
+a functional component would not render again. The world timeline's
+scrubber is a bare range inside its own gesture track: its `step="any"`
+bounds follow the zoomed view, and a pinch puts the input back on the
+handle itself.
Controls share one skin, so every panel reads the same. Every scrolling
surface carries the kit's `.ui-scroll`, which draws the thin
@@ -500,14 +523,15 @@ once passes the locale itself as a prop or key, as the credits line does.
records surface by surface; [Building UI](../CONTRIBUTING.md#building-ui)
now requires the pattern for new UI. The page-level markup tests read
`renderApplicationHtml()`, the real views rendered on the server, and new
- tests mount components; two tests still read a `.vue` file's source
- (`panelStorageDocs`, `geoFileImport`). The views translate with `t()`
- while rendering, and vue-i18n holds the locale they read; the attribute
- translation pass is left for static page markup (the loading screen and a
- host's own markup). An explicit API for hosts to register panels and rail items is
- deferred until a host adds one: no host does today (the hosted
- application's account interface is its own markup), and the first such
- panel, the hosted timeline, will shape it.
+ tests mount components. Many tests still read `.vue` sources: the kit's
+ control scans in `src/ui/kit/` (`viewControls`, `closeButtons`,
+ `checkboxes`, `dialogs` and the per-surface ones) and markup checks such
+ as `contextTabKeyboard`, `geoFileImport` and `panelStorageDocs`. The
+ views translate with `t()` while rendering, and vue-i18n holds the
+ locale they read; the attribute translation pass is left for static page
+ markup (the loading screen and a host's own markup). An explicit API for
+ hosts to register panels and rail items is deferred until a host needs
+ one.
## Verification
diff --git a/scripts/format-scope.json b/scripts/format-scope.json
index e86ae6c4ea..ebfa59916f 100644
--- a/scripts/format-scope.json
+++ b/scripts/format-scope.json
@@ -1332,6 +1332,7 @@
"src/ui/kit/UiCloseButton.vue",
"src/ui/kit/UiCloseButton.test.mjs",
"src/ui/kit/closeButtons.test.mjs",
+ "src/ui/kit/viewControls.test.mjs",
"src/ui/styles/close-button.css",
"src/ui/kit/UiSearchField.vue",
"src/ui/kit/UiSearchField.test.mjs",
@@ -1424,6 +1425,7 @@
"src/data/firmsIntensity.test.mjs",
"src/ui/layerPanel/RowSwitch.vue",
"src/ui/layerPanel/RowRange.vue",
+ "src/ui/layerPanel/rowRange.test.mjs",
"src/ui/layerPanel/RowSlider.vue",
"src/sources/phaseTiming.test.mjs",
"scripts/build-census-places.mjs",
diff --git a/src/ui/displayPanel.test.mjs b/src/ui/displayPanel.test.mjs
index 045d8e9504..5e61660434 100644
--- a/src/ui/displayPanel.test.mjs
+++ b/src/ui/displayPanel.test.mjs
@@ -557,7 +557,7 @@ test('the imported files render what the file import publishes and keep focus',
assert.equal(name.textContent, 'a.geojson');
assert.equal(name.children.length, 0, 'the name is text');
assert.match(name.title, /GEOJSON, 2 map objects$/);
- assert.equal(toggle.className, 'geo-import-action');
+ assert.ok(toggle.classList.contains('geo-import-action'));
assert.equal(toggle.getAttribute('type'), 'button');
assert.equal(toggle.getAttribute('aria-pressed'), 'true');
assert.equal(toggle.getAttribute('aria-label'), 'Hide a.geojson');
diff --git a/src/ui/geoFileImport.js b/src/ui/geoFileImport.js
index 3b55f13ede..e65ab0ae3d 100644
--- a/src/ui/geoFileImport.js
+++ b/src/ui/geoFileImport.js
@@ -162,7 +162,7 @@ export function initGeoFileImport({
? t('Hide {name}', { name: item.name })
: t('Show {name}', { name: item.name }),
action: 'toggle',
- pressed: String(item.visible),
+ pressed: Boolean(item.visible),
},
{
icon: 'my_location',
diff --git a/src/ui/geoFileImport.test.mjs b/src/ui/geoFileImport.test.mjs
index 11c3e4dad3..e65fed015f 100644
--- a/src/ui/geoFileImport.test.mjs
+++ b/src/ui/geoFileImport.test.mjs
@@ -220,7 +220,7 @@ test('row buttons hide, show, fly to and remove a file', async () => {
shapes: [],
});
assert.equal(t.tool.list()[0].visible, false);
- assert.equal(action(rows(t)[0], 'toggle').pressed, 'false');
+ assert.equal(action(rows(t)[0], 'toggle').pressed, false);
assert.equal(action(rows(t)[0], 'toggle').icon, 'visibility_off');
assert.equal(action(rows(t)[0], 'toggle').label, 'Show a.gpx');
glyphClick('fly');
diff --git a/src/ui/kit/closeButtons.test.mjs b/src/ui/kit/closeButtons.test.mjs
index 28428bc1bd..dc56589eef 100644
--- a/src/ui/kit/closeButtons.test.mjs
+++ b/src/ui/kit/closeButtons.test.mjs
@@ -1,6 +1,7 @@
// Every close, dismiss and clear button in a Vue view is a UiCloseButton: no
-// SFC template hand-writes a button whose only content is × or the Material
-// `close` symbol. Buttons built in script are not read here.
+// SFC template hand-writes a button whose only content is × (bare or in a
+// span) or the Material `close` symbol. Buttons built in script are not read
+// here.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync, readdirSync } from 'node:fs';
@@ -30,8 +31,10 @@ function template(source) {
// An opening tag's attributes, quoted values may hold `>` (`() => x`).
const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
const BUTTON = String.raw`(button|UiButton)`;
+const TIMES = String.raw`×|×|×|×`;
const CLOSE_GLYPH = [
- String.raw`×|×|×|×`,
+ TIMES,
+ String.raw`\s*(?:${TIMES})\s*`,
String.raw`]*\bmaterial-symbols-outlined\b[^>]*>\s*close\s*`,
String.raw``,
].join('|');
@@ -54,11 +57,14 @@ test('the scan finds each hand-written close glyph', () => {
'×',
'',
'',
+ '',
+ '\n ×\n',
])
assert.equal(handWrittenCloses(markup).length, 1, markup);
for (const markup of [
'',
'',
+ '',
'',
'',
])
diff --git a/src/ui/kit/dialogs.test.mjs b/src/ui/kit/dialogs.test.mjs
index 80a6244947..581112895a 100644
--- a/src/ui/kit/dialogs.test.mjs
+++ b/src/ui/kit/dialogs.test.mjs
@@ -1,7 +1,8 @@
// Every modal dialog in a Vue view is a UiDialog: no SFC template hand-writes
// `