Files
uconsole_asw_game/data/commander/js/views/feeds.js
T
db9979andClaude Opus 5.5 4dd23bc242 Web client: CIC redesign with ES modules and bundled fonts
- Remote Crew browser client rebuilt as a dark combat-information-centre layout
  for large desktop monitors: slim status bar (stations, mission, clocks, UTC,
  link state), pulsing alert band, the instrument as centrepiece and
  collapsible docks (contacts, station, contact detail, log drawer; keys , . L).
  Four columns from 2400 px, fluid type up to 4K; guide, lookout and contact
  library open as overlays (Esc closes).
- app.js split into native ES modules under data/commander/js; the transport
  (net/*) no longer touches the DOM and talks to the views through synchronous
  topics (core/events.js, app/bindings.js); redraws share one frame scheduler.
- style.css replaced by a token-based design system in data/commander/css.
- Inter 4.1 and JetBrains Mono 2.304 bundled unmodified (OFL-1.1) with
  provenance in THIRD_PARTY_NOTICES.md; CSP allows font-src 'self'.
- Server serves the css/js/fonts trees from one asset manifest
  (src/commander/assets.py); packaging, capture tool, help, manual and docs
  updated; tests share tests/commander_web.py and import modules directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 12:02:01 +02:00

31 lines
1.5 KiB
JavaScript

import { S } from "../state/store.js";
import { $ } from "../core/base.js";
import { t, unit } from "../core/format.js";
import { node } from "./dom.js";
export function renderProposals() {
const sonar = S.session?.station === "sonar";
const bridge = S.session?.station === "bridge";
$("target-proposal-controls").hidden = !sonar;
$("target-proposal").hidden = !sonar;
$("navigation-proposal").hidden = !bridge;
const target = sonar ? S.proposals?.target : null;
$("proposal-status").textContent = target ? t(`proposal_${target.status}`, {label: target.label}) : "";
const navigation = bridge ? S.proposals?.navigation : null;
if (navigation) {
const summary = t("navigation_summary", {
course: navigation.course === null ? t("navigation_unchanged") : unit(navigation.course, "\u00b0", 0),
speed: navigation.speed_kn === null ? t("navigation_unchanged") : unit(navigation.speed_kn, "kn"),
});
$("navigation-status").textContent = t(`proposal_${navigation.status}`, {label: summary});
} else $("navigation-status").textContent = t("navigation_none");
}
export function renderEvents() {
$("event-list").replaceChildren(...[...S.eventHistory].reverse().map((event) => {
const item = node("li", undefined, event.severity === "warning" ? "warning" : "");
item.append(node("span", `${event.seq} / ${event.kind}`, "event-meta"), node("span", event.message));
return item;
}));
if (!S.eventHistory.length) $("event-list").append(node("li", t("no_events")));
}