Files
gods-eye-view/src/ui/views/panels/CockpitSignalList.vue
T
Sameh KhamisandManjunath Paparaju b875b5f469 Vue kit: the Cockpit's buttons and glyphs are kit controls
Every hand-written button in the Cockpit HUD (CockpitView, the utility
strip, the briefing and Contact cards, the signal rows, the orbital view
and the bridge radar) is a ghost UiButton that keeps its id, classes,
data and aria attributes, title and listeners, so the Cockpit controller
and the cockpit stylesheets still find it. Radio's Enable, the briefing's
Auto and the Contact card's Weather are pressed toggles written as
:pressed="Boolean(...)". Every Material Symbols span (the rim pointers,
reticle, heading caret, vision and card chevrons, panel glyphs, the
contact and route arrows, the rail and view switcher glyphs) is a UiIcon
with :size="null", so the cockpit rules still size it.

The orbital view's focus hand-off reads each UiButton ref's $el. The
heading caret's rule now reads `.cockpit-compass .cockpit-heading-caret`
so it still outranks kit.css's `.ui-icon` display and line height, which
load after cockpit.css. The Cockpit markup test reads the Reset and Exit
buttons' attributes in any order.

src/ui/kit/cockpitControls.test.mjs pins it: no hand-written button,
Material span, select, checkbox or range in the Cockpit views, the kit
counts per file, the pressed toggles and the caret rule.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 10:46:39 -08:00

25 lines
1.6 KiB
Vue

<script setup>
import { storeToRefs } from 'pinia';
import { computed } from 'vue';
import { vFocusSafeChildren } from '../../rail/focusSafeChildren.js';
import { useCockpitStore } from '../../stores/cockpit.js';
import UiButton from '../../kit/UiButton.vue';
import UiIcon from '../../kit/UiIcon.vue';
// The Cockpit's live signal rows. The Cockpit controller presents them;
// until it does, the list is empty. Rows reorder several times a second,
// so the list keeps keyboard focus on its row while the others move, and
// moves focus to `leave` before the focused row goes. Selection stays with
// the controller's click listener. The template is one line: templates keep
// whitespace.
defineProps({
leave: { type: Function, required: true },
});
const { signals } = storeToRefs(useCockpitStore());
const rows = computed(() => signals.value ?? []);
</script>
<template>
<ol id="cockpit-signal-list" v-focus-safe-children="leave" class="cockpit-signal-list" aria-live="polite"><li v-for="row in rows" :key="row.key" :class="row.className" :data-signal-key="row.key"><time>{{ row.time }}</time><div><UiButton v-if="row.target" class="cockpit-signal-target" :data-signal-layer="row.target.layerId" :data-signal-id="row.target.id" :aria-label="row.target.label"><span class="cockpit-signal-target-label">{{ row.title }}</span><span class="cockpit-signal-target-rule" aria-hidden="true"></span><UiIcon name="chevron_right" class="cockpit-signal-target-chevron" :size="null" /></UiButton><strong v-else>{{ row.title }}</strong><span>{{ row.detail }}</span></div></li></ol>
</template>