From 2c7a1b80143fdfd2f9296578305d1768bc1ecbcc Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Thu, 19 Nov 2026 03:45:48 -0800 Subject: [PATCH 1/2] Vue kit: the Stories views' buttons are UiButtons and Explore's filters UiCheckboxes Every button in the Stories entry, its popup and toast, Explore and the Story screen (header, rail, timeline and context panel) is a ghost UiButton that keeps its id, classes and listeners. Explore's topic chips and map pins, the Context button and Expand map are pressed toggles in place of hand-written aria-pressed. The Filter, Minimise, Expand card and Back buttons are reached through the UiButton's root where code focuses them or checks what a click landed on. Explore's filter options are UiCheckboxes that keep their fopt label. The views' glyphs stay inline SVG, since no Material symbol the page loads draws them the same; the search fields keep their own markup and their SVG clear buttons are ghost UiButtons. A guard test pins it, and the migration notes say so. Co-authored-by: Manjunath Paparaju --- docs/VUE-MIGRATION.md | 28 +++++-- scripts/format-scope.json | 1 + scripts/package-boundaries.json | 1 + src/ui/kit/checkboxes.test.mjs | 7 +- src/ui/kit/storiesControls.test.mjs | 107 +++++++++++++++++++++++++ src/ui/views/StoriesView.vue | 12 +-- src/ui/views/stories/ExploreScreen.vue | 94 ++++++++++------------ src/ui/views/stories/StoriesHeader.vue | 43 +++++----- src/ui/views/stories/StoryContext.vue | 31 +++---- src/ui/views/stories/StoryRail.vue | 11 ++- src/ui/views/stories/StoryScreen.vue | 38 ++++----- src/ui/views/stories/StoryTimeline.vue | 18 ++--- 12 files changed, 243 insertions(+), 148 deletions(-) create mode 100644 src/ui/kit/storiesControls.test.mjs diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md index a97b42c286..967607291d 100644 --- a/docs/VUE-MIGRATION.md +++ b/docs/VUE-MIGRATION.md @@ -89,6 +89,18 @@ tilt-map button, whose owners still 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. +Every button in the Stories views (the Stories entry and its popup and +toast, Explore, the Story screen, its header, rail, timeline and context +panel) is a ghost `UiButton`. Explore's topic chips and map pins, the +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). 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 @@ -114,9 +126,12 @@ empty rows stay a paragraph and table cells. `UiCloseButton` is a `UiButton` with a fixed glyph, a required `label` and 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 is one (`src/ui/kit/closeButtons.test.mjs` pins -it); 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 +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 +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. `UiSearchField` takes `v-model`, a required `label` (the input's @@ -143,9 +158,10 @@ a refused change. Attributes and classes go to the label; `inputId` and `inputAttrs` (such as `aria-describedby` or a data hook) to the box. The Visual panel's Scope, sky and application toggles, the voice and chat preferences, the Data Library's filter and the welcome card's box are -`UiCheckbox`es (`src/ui/kit/checkboxes.test.mjs` pins it); Story Explore's -filters are not converted yet. Its kit rule holds the centred row the -checkbox-only labels drew, moved rather than copied. +`UiCheckbox`es, and so are Story Explore's filter options, whose label +keeps its `fopt` class (`src/ui/kit/checkboxes.test.mjs` pins it). Its kit +rule holds the centred row the checkbox-only labels drew, moved rather than +copied. `UiDialog` is a native `` its owner opens and closes with `open`: true opens it with `showModal()` (on mount, for one mounted open), false closes it, and unmounting closes it. Each change is applied once the content diff --git a/scripts/format-scope.json b/scripts/format-scope.json index 5fd2aaf499..f8d11ed4d6 100644 --- a/scripts/format-scope.json +++ b/scripts/format-scope.json @@ -1344,6 +1344,7 @@ "src/ui/kit/UiDialog.test.mjs", "src/ui/kit/dialogs.test.mjs", "src/ui/kit/omnibarControls.test.mjs", + "src/ui/kit/storiesControls.test.mjs", "src/ui/styles/chip.css", "src/ui/styles/empty-state.css", "src/ui/rail/RailChips.vue", diff --git a/scripts/package-boundaries.json b/scripts/package-boundaries.json index ad73b786c3..31245c7cf2 100644 --- a/scripts/package-boundaries.json +++ b/scripts/package-boundaries.json @@ -5385,6 +5385,7 @@ "src/ui/kit/UiEmpty.vue", "src/ui/kit/UiBadge.vue", "src/ui/kit/UiCloseButton.vue", + "src/ui/kit/UiCheckbox.vue", "src/ui/stores/globeActions.js", "src/ui/stores/recording.js", "src/ui/i18n.js", diff --git a/src/ui/kit/checkboxes.test.mjs b/src/ui/kit/checkboxes.test.mjs index 5ee5508551..8494fd9805 100644 --- a/src/ui/kit/checkboxes.test.mjs +++ b/src/ui/kit/checkboxes.test.mjs @@ -1,5 +1,5 @@ // Every checkbox in a Vue view is a UiCheckbox: no SFC template hand-writes -// ``. Story Explore's filters are not converted yet. +// ``. import { test } from 'node:test'; import assert from 'node:assert/strict'; import { readFileSync, readdirSync } from 'node:fs'; @@ -8,10 +8,7 @@ import { fileURLToPath } from 'node:url'; const SRC_ROOT = fileURLToPath(new URL('../../', import.meta.url)); const REPO_ROOT = path.resolve(SRC_ROOT, '..'); -const NOT_YET = new Set([ - 'src/ui/kit/UiCheckbox.vue', - 'src/ui/views/stories/ExploreScreen.vue', -]); +const NOT_YET = new Set(['src/ui/kit/UiCheckbox.vue']); /** Every SFC under src. */ function sfcFiles(directory = SRC_ROOT) { diff --git a/src/ui/kit/storiesControls.test.mjs b/src/ui/kit/storiesControls.test.mjs new file mode 100644 index 0000000000..4524e5ee80 --- /dev/null +++ b/src/ui/kit/storiesControls.test.mjs @@ -0,0 +1,107 @@ +// The Stories views' buttons and checkboxes are the kit's: neither the +// Stories entry nor any Explore or Story screen hand-writes a + >

{{ t('GEV Stories') }}

{{ t('Longest') }} - +
@@ -503,9 +504,8 @@ defineExpose({ autocomplete="off" @keydown="onSearchKey" /> - + /
@@ -533,21 +533,19 @@ defineExpose({ role="group" :aria-label="t('Topics')" > - {{ t('All') }} - {{ t(c) }}
@@ -561,25 +559,25 @@ defineExpose({ >
{{ t(label) }} - +
- - +
@@ -598,9 +596,9 @@ defineExpose({
  • {{ t('No stories match') }} {{ t('Try another word or clear the filters.') }} - + }}
  • {{ fmtDur(s.durationMs) }} - + {{ titleOf(s) }} {{ s.creator }} · {{ windowText(s) }} @@ -640,9 +637,8 @@ defineExpose({ >{{ l }} - +
  • @@ -664,14 +660,13 @@ defineExpose({
    - +
    - +
    {{ t('Pick a story or a pin to preview it here') diff --git a/src/ui/views/stories/StoriesHeader.vue b/src/ui/views/stories/StoriesHeader.vue index 412f8454d6..f4715c5825 100644 --- a/src/ui/views/stories/StoriesHeader.vue +++ b/src/ui/views/stories/StoriesHeader.vue @@ -9,6 +9,7 @@ import { } from 'vue'; import { t } from '../../../i18n/index.js'; import { useStoriesStore } from '../../stores/stories.js'; +import UiButton from '../../kit/UiButton.vue'; /** * The Stories top bar (prototype `.h-top.s-head`): back, GEV logo and @@ -39,6 +40,7 @@ async function share() { } // Long titles scroll gently so the whole name can be read. const mtitle = ref(null); +// Back is a UiButton; its root is the button. const back = ref(null); const trail = ref(null); let observer = null; @@ -52,8 +54,9 @@ function fitTitle() { el.style.setProperty('--mq-dur', `${Math.max(5, (over + 22) / 22)}s`); } onMounted(() => { - const target = back.value?.getClientRects().length - ? back.value + const backEl = back.value?.$el; + const target = backEl?.getClientRects().length + ? backEl : trail.value?.querySelector('button'); target?.focus({ preventScroll: true }); if (globalThis.ResizeObserver && mtitle.value) { @@ -71,10 +74,9 @@ onBeforeUnmount(() => observer?.disconnect()); diff --git a/src/ui/views/stories/StoryContext.vue b/src/ui/views/stories/StoryContext.vue index 256d883a7d..adb53a2a17 100644 --- a/src/ui/views/stories/StoryContext.vue +++ b/src/ui/views/stories/StoryContext.vue @@ -3,6 +3,7 @@ import { computed, ref } from 'vue'; import { storeToRefs } from 'pinia'; import { t, tn } from '../../../i18n/index.js'; import { useStoriesStore } from '../../stores/stories.js'; +import UiButton from '../../kit/UiButton.vue'; import { chapterAt } from '../../../stories/format.js'; import { anchorStamp, @@ -206,10 +207,9 @@ defineExpose({ dragging }); :aria-label="t('Context')" :style="dragH != null ? { height: `${dragH}px` } : null" > - +
    • - +
    • {{ t('Nothing in this story matches.') @@ -334,12 +332,11 @@ defineExpose({ dragging });
      {{ t('About') }} - {{ t('Close') }}

      @@ -356,8 +353,7 @@ defineExpose({ dragging });

      {{ t('Key moments') }}
      • - +
      @@ -391,10 +387,9 @@ defineExpose({ dragging });
      {{ t('Related stories') }}
    diff --git a/src/ui/views/stories/StoryRail.vue b/src/ui/views/stories/StoryRail.vue index 5687a61c94..6cf5360918 100644 --- a/src/ui/views/stories/StoryRail.vue +++ b/src/ui/views/stories/StoryRail.vue @@ -2,6 +2,7 @@ import { computed } from 'vue'; import { t } from '../../../i18n/index.js'; import { useStoriesStore } from '../../stores/stories.js'; +import UiButton from '../../kit/UiButton.vue'; /** * The right rail over the story map (prototype `.ov-rail`): Open in GEV (it @@ -25,10 +26,9 @@ async function share() { diff --git a/src/ui/views/stories/StoryScreen.vue b/src/ui/views/stories/StoryScreen.vue index ad32f837fe..c5b94bdeca 100644 --- a/src/ui/views/stories/StoryScreen.vue +++ b/src/ui/views/stories/StoryScreen.vue @@ -23,6 +23,7 @@ import StoriesHeader from './StoriesHeader.vue'; import StoryTimeline from './StoryTimeline.vue'; import StoryContext from './StoryContext.vue'; import StoryRail from './StoryRail.vue'; +import UiButton from '../../kit/UiButton.vue'; /** * One story (prototype `.scr-story`): a GEV scene playing on GEV's Cesium @@ -155,6 +156,7 @@ function onCardKey(e) { if (e.key === 'ArrowRight') setPage(page.value + 1); else if (e.key === 'ArrowLeft') setPage(page.value - 1); } +// Minimise and Expand are UiButtons; each root is the button. const minBtn = ref(null); const miniBtn = ref(null); function setCardMin(on) { @@ -352,10 +354,9 @@ watch([k, page], () => nextTick(sizeCard));
    1. - +
    @@ -445,16 +446,15 @@ watch([k, page], () => nextTick(sizeCard)); - - +
    - + >
    @@ -532,9 +530,8 @@ watch([k, page], () => nextTick(sizeCard)); id="ovPlay" class="ov ov-play" > - + - +
    {{ hint }}
    diff --git a/src/ui/views/stories/StoryTimeline.vue b/src/ui/views/stories/StoryTimeline.vue index 070a6af83f..6a2ca5915e 100644 --- a/src/ui/views/stories/StoryTimeline.vue +++ b/src/ui/views/stories/StoryTimeline.vue @@ -3,6 +3,7 @@ import { computed, onMounted, ref, watch } from 'vue'; import { storeToRefs } from 'pinia'; import { t } from '../../../i18n/index.js'; import { useStoriesStore } from '../../stores/stories.js'; +import UiButton from '../../kit/UiButton.vue'; import { chapterAt } from '../../../stories/format.js'; import { chapterTitle, @@ -318,10 +319,9 @@ defineExpose({ goChapter }); From f821c31a36da749cd0c30f07b1b9d31291d34175 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Thu, 19 Nov 2026 05:04:48 -0800 Subject: [PATCH 2/2] Add the changelog entry for #1852 Co-authored-by: Manjunath Paparaju --- changelog.d/1852-kit-sweep-stories.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog.d/1852-kit-sweep-stories.md diff --git a/changelog.d/1852-kit-sweep-stories.md b/changelog.d/1852-kit-sweep-stories.md new file mode 100644 index 0000000000..ea55506827 --- /dev/null +++ b/changelog.d/1852-kit-sweep-stories.md @@ -0,0 +1,3 @@ +- The Stories views' buttons and Explore's filter checkbox are now kit + controls, with the same look and behaviour (manjunath22466, samehkhamis, + #1852).