diff --git a/changelog.d/1858-kit-sweep-cockpit.md b/changelog.d/1858-kit-sweep-cockpit.md new file mode 100644 index 0000000000..47f07f3b48 --- /dev/null +++ b/changelog.d/1858-kit-sweep-cockpit.md @@ -0,0 +1,2 @@ +- The Cockpit HUD's buttons and glyphs are now kit controls, and its rim + pointers are hidden from screen readers (manjunath22466, samehkhamis, #1858). diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md index aa5afe7c42..2dcedab29f 100644 --- a/docs/VUE-MIGRATION.md +++ b/docs/VUE-MIGRATION.md @@ -122,6 +122,23 @@ 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`. +Every button in the Cockpit HUD (`CockpitView` and its panels: the vision +selector, Look ahead, the view switcher's Reset and Exit, the utility +strip's launchers, collapse buttons, Radio transport and desktop rail, the +briefing card's paging, Auto, collapse and page tabs, the Contact card's +navigation, collapse and Weather, a signal row's target, the orbital +view's TLE, Nadir, zoom and Sensor, and the bridge radar's range) is a +ghost `UiButton` that keeps its id and classes, so the Cockpit +controller's listeners and the cockpit stylesheets still find it. Radio's +Enable (with `active`), Auto and Weather are pressed toggles; the +disclosures keep `aria-expanded` and the page tabs `aria-current`. Its +glyphs (the rim pointers, the reticle, the heading caret, the chevrons and +panel glyphs, the contact and route arrows) are `UiIcon`s with +`:size="null"`; the heading caret's rule reads +`.cockpit-compass .cockpit-heading-caret`, so it still outranks the kit's +`.ui-icon`, which loads after cockpit.css +(`src/ui/kit/cockpitControls.test.mjs` pins it). The −, ◀ ▶ and + glyphs +are text characters and stay text, and the Radio volume is a `UiSlider`. 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 diff --git a/scripts/format-scope.json b/scripts/format-scope.json index 069fec62e3..9a8a69ef05 100644 --- a/scripts/format-scope.json +++ b/scripts/format-scope.json @@ -1350,6 +1350,7 @@ "src/ui/kit/welcomeControls.test.mjs", "src/ui/kit/omnibarControls.test.mjs", "src/ui/kit/storiesControls.test.mjs", + "src/ui/kit/cockpitControls.test.mjs", "src/ui/kit/smallSurfacesControls.test.mjs", "src/ui/kit/commandDockControls.test.mjs", "src/ui/styles/chip.css", diff --git a/src/cockpitMarkup.test.mjs b/src/cockpitMarkup.test.mjs index cc1e9f072a..f8232a2f47 100644 --- a/src/cockpitMarkup.test.mjs +++ b/src/cockpitMarkup.test.mjs @@ -74,10 +74,14 @@ const voiceActions = fs.readFileSync( test('Cockpit has one reset action beside its bottom exit path', () => { assert.doesNotMatch(html, /id="cockpit-quick-entry"/); assert.doesNotMatch(html, /id="cockpit-exit"/); - assert.match( - html, - /id="map-view-switch"[^>]*aria-label="Exit cockpit view"[^>]*aria-keyshortcuts="Escape"[\s\S]*?close_fullscreen[\s\S]*?EXIT COCKPIT/, + // The exit button's attributes, in whatever order the button renders them. + const exit = html.match( + /]*\sid="map-view-switch")([^>]*)>([\s\S]*?)<\/button>/, ); + assert.ok(exit, 'Cockpit exit is missing'); + assert.match(exit[1], /\saria-label="Exit cockpit view"/); + assert.match(exit[1], /\saria-keyshortcuts="Escape"/); + assert.match(exit[2], /close_fullscreen[\s\S]*?EXIT COCKPIT/); const topCenterActions = html.match( /