Files
gods-eye-view/src/ui/views/panels/GlobeActions.vue
T
Sameh KhamisandManjunath Paparaju 1e70e15ceb Vue kit: the docs' every-control claims hold, and a scan of every view pins them
docs/VUE-MIGRATION.md says every select is a UiSelect, every close button
a UiCloseButton and (nearly) every pressed toggle a UiButton. Make those
true in code, correct the sentences that were not, and pin them.

Selects: Story Explore's sort, the chat's layer picker and a layer row's
range ends are UiSelects. The range ends take `hold`, since the layer
panel repaints the row on a later frame.

Close buttons: the space mission replay's Cancel is a bare UiCloseButton.
An imported file's row actions (show or hide, fly to, remove) are icon
UiButtons drawing the icon the file import names, so Remove stays one of
them; the presenter's `pressed` is now a boolean.

Pressed toggles: the tilt-map button, the scene action buttons, the chat
and voice panels' dock (and its minimize), the Context header's search
and expand, Recent Imagery's day chips, SWAP and ZOOM IN, the rail row
lists and the rail cards' action chips are UiButtons with `pressed` (and
`pressed-class="active"` where their active class came from the same
state). Their Material glyphs, and the rail chips' icons, are UiIcons
with `:size="null"`. Bhote Koshi's cinematic button keeps the attributes
its layer writes, and Explore's story cards stay role="button" elements.

Docs: the kit list gains UiPanelToggle and UiPanelEdge; the pressed-toggle,
chips, Stories search fields, role="dialog", close button, range and
source-reading-tests sentences now say what the code does.

Tests: src/ui/kit/viewControls.test.mjs walks every .vue outside the kit
and fails on a raw select, a hand-written aria-pressed on a button,
UiButton or role="button" element (outside the two documented
exceptions), or a hand-written close glyph button. closeButtons.test.mjs
also catches a × inside a span.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 07:56:34 -08:00

38 lines
2.2 KiB
Vue

<script setup>
import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { t } from '../../../i18n/index.js';
import { useGlobeActionsStore } from '../../stores/globeActions.js';
import GlobeCompass from './GlobeCompass.vue';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The top-center camera and share actions. The shell answers the buttons
// through the store and publishes a clear under way, which keeps the button
// focusable and marks it busy, and the camera's tilt and heading. The heading
// changes on every frame a rotating camera draws, so only the compass reads
// it; the bar renders again only when the tilt changes.
const globe = useGlobeActionsStore();
const { clearBusy, resetBusy, camera } = storeToRefs(globe);
const { act } = globe;
const tilted = computed(() => Boolean(camera.value?.tilted));
</script>
<template>
<nav id="top-center-actions" :aria-label="t('Globe actions')">
<button id="clear-selected-layers" type="button" :aria-label="clearBusy ? t('Clearing selected data layers') : t('Clear selected data layers')" :aria-disabled="clearBusy == null ? undefined : String(clearBusy)" :aria-busy="clearBusy == null ? undefined : String(clearBusy)" :title="t('Turn off all selected data layers')" @click="act('clear')">
<span class="material-symbols-outlined" aria-hidden="true">layers_clear</span>
</button>
<button id="share-btn" type="button" :aria-label="t('Copy share link')" :title="t('Copy share link')" @click="act('share')">
<span class="share-icon" aria-hidden="true">&#x1F517;</span>
</button>
<UiButton id="tilt-map-view" :aria-label="tilted ? t('Return map to straight-down view') : t('Tilt map to oblique view')" :pressed="tilted" :title="t('Toggle straight-down and tilted map views')" @click="act('tilt')">
<UiIcon name="view_in_ar" :size="null" />
</UiButton>
<GlobeCompass @click="act('northUp')" />
<button id="reset-globe-view" type="button" :aria-label="resetBusy ? t('Resetting to full globe view') : t('Reset to full globe view')" :title="t('Reset camera and return to full globe view')" @click="act('reset')">
<span class="material-symbols-outlined" aria-hidden="true">public</span>
</button>
</nav>
</template>