diff --git a/changelog.d/1850-kit-sweep-entity-card.md b/changelog.d/1850-kit-sweep-entity-card.md new file mode 100644 index 0000000000..06d464488e --- /dev/null +++ b/changelog.d/1850-kit-sweep-entity-card.md @@ -0,0 +1,2 @@ +- The entity card's buttons and glyphs are now kit controls, with the same + look and behaviour (manjunath22466, samehkhamis, #1850). diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md index cf0678a1fa..cfea28e22b 100644 --- a/docs/VUE-MIGRATION.md +++ b/docs/VUE-MIGRATION.md @@ -84,7 +84,7 @@ 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 entity card, the context view, the Layer Finder, +the views is one yet: the context view, the Layer Finder, the Stories screens 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 @@ -117,6 +117,15 @@ sky, application-row and Reset glyphs are `UiIcon`s with `:size="null"`, so the panel's rules still size them (`src/ui/kit/visualControls.test.mjs` pins it). The toggles' other glyphs (◎ ▣ ✈ □ ✨ 🔍) and the presets' style glyphs are text characters, not Material symbols, and stay plain spans. +The entity card's buttons are ghost `UiButton`s: its four preview buttons +(Photos, Route, 3D, Cockpit view) are pressed toggles with `active`, Follow +is one with `entity-card__action--on`, and the cockpit entry, Fly to and +Ask GEV are plain buttons; so are the camera preview's bigger-view and More +info buttons and the nearby lists' rows (`SpotConditions`, which the +context view shows too). Their glyphs are `UiIcon`s with `:size="null"`, +so entity-card.css and spot-conditions.css still size them +(`src/ui/kit/entityCardControls.test.mjs` pins it). Ask GEV's chat bubble +stays inline SVG, since no Material symbol the page loads draws 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 d1e829041d..98325870b3 100644 --- a/scripts/format-scope.json +++ b/scripts/format-scope.json @@ -1343,6 +1343,7 @@ "src/ui/kit/UiDialog.vue", "src/ui/kit/UiDialog.test.mjs", "src/ui/kit/dialogs.test.mjs", + "src/ui/kit/entityCardControls.test.mjs", "src/ui/kit/visualControls.test.mjs", "src/ui/kit/welcomeControls.test.mjs", "src/ui/kit/omnibarControls.test.mjs", diff --git a/src/ui/kit/entityCardControls.test.mjs b/src/ui/kit/entityCardControls.test.mjs new file mode 100644 index 0000000000..5dd3f24587 --- /dev/null +++ b/src/ui/kit/entityCardControls.test.mjs @@ -0,0 +1,84 @@ +// The entity card's buttons and Material glyphs are the kit's: neither its +// template nor the camera preview and nearby lists it renders hand-writes a +// + + + - + + {{ t('More info') }} + diff --git a/src/ui/views/panels/EntityCard.vue b/src/ui/views/panels/EntityCard.vue index 77ae67c486..fd787d97fc 100644 --- a/src/ui/views/panels/EntityCard.vue +++ b/src/ui/views/panels/EntityCard.vue @@ -10,7 +10,9 @@ import AltitudeGraph from './AltitudeGraph.vue'; import { contextNeedle, contextSearchText, matchesContextSearch } from '../../contextSearch.js'; import RouteGlobe from './RouteGlobe.vue'; import CctvPreview from './CctvPreview.vue'; +import UiButton from '../../kit/UiButton.vue'; import UiCloseButton from '../../kit/UiCloseButton.vue'; +import UiIcon from '../../kit/UiIcon.vue'; import { useCctvStore } from '../../stores/cctv.js'; import SpotConditions from './SpotConditions.vue'; import { shownLayerName } from '../../layerNames.js'; @@ -365,10 +367,10 @@ watch(
- - - - + + + {{ t('3D') }} +
@@ -379,7 +381,7 @@ watch(
- +
{{ factFigure(fact).number }}{{ factFigure(fact).unit }} @@ -391,7 +393,7 @@ watch(
- +
{{ kindLine }}

{{ shownTitle }}

@@ -406,14 +408,14 @@ watch(
{{ card.route.from }} {{ card.route.to }}
@@ -435,7 +437,7 @@ watch( class="entity-card__route-note" :title="t('The scheduled route for this flight number does not match where the plane is; it may be another leg of the same flight.')" > - {{ t('Scheduled · unverified: does not match where the plane is') }} + {{ t('Scheduled · unverified: does not match where the plane is') }}

@@ -462,20 +464,21 @@ watch(
- + + {{ card.layerId === 'satellites' ? t('Enter orbital view') : t('Enter Cockpit') }} +
- - + + {{ t('Fly to') }} + + + {{ store.isFollowing() ? t('Following') : t('Follow') }} +
- +
diff --git a/src/ui/views/panels/SpotConditions.vue b/src/ui/views/panels/SpotConditions.vue index 225279625c..9b2b92dce8 100644 --- a/src/ui/views/panels/SpotConditions.vue +++ b/src/ui/views/panels/SpotConditions.vue @@ -5,6 +5,8 @@ import { compassName, hazardsNear, regionalBrief, weatherLook } from '../../spot import { distanceKm } from '../../../data/entityContext.js'; import { CONTEXT_RADIUS_STEPS, contextRadiusKm, setContextRadiusKm } from '../../contextRadius.js'; import { contextNeedle, matchesContextSearch } from '../../contextSearch.js'; +import UiButton from '../../kit/UiButton.vue'; +import UiIcon from '../../kit/UiIcon.vue'; import UiSlider from '../../kit/UiSlider.js'; import { sayWords, useEntityCardStore } from '../../stores/entityCard.js'; import { useOmnibarStore } from '../../stores/omnibar.js'; @@ -265,7 +267,7 @@ const sources = computed(() => {