Remove the Cyber HUD layout and keep its sonar as a visual style

Display > HUD > Sonar now turns the sonar sweep on over Tactical or
Minimal. It is off by default, ON reveals its five sliders, and it keeps
its guards: an OFF control, the sweep only while the HUD is visible and
outside Cockpit, no animation under reduced motion, and repaint timers
re-armed only after a drawn frame that still shows contacts.

The Cyber layout, its shell skin and its Cockpit lanes are removed. Share
links, scenes, saved views and set_hud that name Cyber open Tactical with
Sonar on; links and scene shots record Tactical with Sonar under the same
code, and a restored state that names another layout turns Sonar off.
set_cyber_sonar keeps its name and works under any layout. A newer Sonar
toggle or voice setting wins over a share-link restore that lands later.

From 1200px wide the command dock and World Timeline sit 74px above the
bottom edge, as in the Omnibar layout, leaving the bottom row to the map
attribution (left) and the Power Up corner row (right). The attribution
moves to the bottom right when the page runs right to left, where the
corner row sits at the bottom left, and a long credit line wraps upward
before reaching the corner row. The Tactical bottom-right readout sits
8px above Power Up and the coordinates start level with it. The World
Timeline is narrowed to sit between the corners. Toasts keep clear of
the raised dock and the chat and voice panel height budgets subtract its
rise. Below 1200px the layout is unchanged. The left rail treats the
centered World Timeline and voice control as obstacles only where they
reach a laid-out panel.

On top of the Omnibar: sonar.css replaces cyber.css after the Omnibar
imports, the Omnibar's HUD guide step now says Layout picks Tactical or
Minimal, and the Omnibar's Tactical bottom-right readout keeps the same
8px above Power Up.

Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
Manjunath PaparajuandSameh Khamis authored and Sameh Khamis committed 2026-11-18 15:47:27 -08:00
1 parent 35b87c75f2
commit d68adcea21
112 files changed
+1433 -5239

No files matched your search

+6 -43
View File
@@ -1,18 +1,10 @@
import { applyCyberSonarThemePhase } from './cyberSonar.js';
import { syncRadioPanelPlacement } from './ui/radioPanelPlacement.js';
import { HUD_LAYOUTS } from './hudLayoutPolicy.js';
export { HUD_LAYOUTS } from './hudLayoutPolicy.js';
import { HUD_LAYOUTS, LEGACY_SONAR_HUD_LAYOUTS } from './hudLayoutPolicy.js';
export { HUD_LAYOUTS, LEGACY_SONAR_HUD_LAYOUTS } from './hudLayoutPolicy.js';
/** Canonical HUD layouts shared by the UI, voice schema and HUD renderer. */
export const DEFAULT_HUD_LAYOUT = 'tactical';
/** Visual treatment applied only when an operator explicitly enters Cyber. */
export const CYBER_VISUAL_DEFAULTS = Object.freeze({
style: 'thermal',
ironbow: 0.42,
});
const HUD_LAYOUT_SET = new Set(HUD_LAYOUTS);
/** @param {unknown} value */
@@ -27,38 +19,9 @@ export function normalizeHudLayout(value) {
}
/**
* Resolve the opt-in visual defaults for an explicit layout transition.
* Restores and repeated Cyber selections return null so they never overwrite
* a shared link or a user's subsequent FLIR tuning.
* Whether a layout name is a removed layout that now means "Sonar on".
* @param {unknown} value
*/
export function cyberVisualDefaultsForHudTransition(
previousLayout,
nextLayout,
{ explicit = false } = {},
) {
if (!explicit) return null;
if (normalizeHudLayout(previousLayout) === 'cyber') return null;
if (normalizeHudLayout(nextLayout) !== 'cyber') return null;
return CYBER_VISUAL_DEFAULTS;
}
/**
* Keep the global shell skin derived from the selected HUD layout. The data
* attribute lives on <html> so theme tokens are available to every UI surface.
* @param {HTMLElement|{dataset?: Record<string, string>}|null|undefined} root
* @param {unknown} layout
* @returns {'cyber'|null}
*/
export function applyHudUiTheme(root, layout) {
if (!root?.dataset) return null;
if (normalizeHudLayout(layout) === 'cyber') {
root.dataset.uiTheme = 'cyber';
applyCyberSonarThemePhase(root, true);
syncRadioPanelPlacement(root.ownerDocument);
return 'cyber';
}
delete root.dataset.uiTheme;
applyCyberSonarThemePhase(root, false);
syncRadioPanelPlacement(root.ownerDocument);
return null;
export function isLegacySonarHudLayout(value) {
return LEGACY_SONAR_HUD_LAYOUTS.includes(String(value ?? '').toLowerCase());
}