v0.1.4-pre.008-fix.002

This commit is contained in:
2026-08-16 13:35:12 +02:00
parent 73d05862af
commit 60d3cb5606
15 changed files with 420 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
<!-- file: crates/ksp-app-config-desk/frontend/main.html -->
<!-- version: 2 -->
<!-- version: 3 -->
<!DOCTYPE html>
<html lang="fr">
@@ -8,18 +8,20 @@
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link rel="icon" href="imgs/logo.png">
<link rel="stylesheet" href="sass/main.scss">
<title>KSP Config Desk</title>
<title>Config Desk — Vue d'ensemble</title>
</head>
<body>
<header class="app-header">
<nav class="navbar h-100 py-0 bg-light text-dark">
<div class="container-fluid px-4 flex-nowrap">
<div class="navbar-brand d-flex align-items-center me-4">
<div class="navbar-brand d-flex align-items-center me-4 flex-nowrap">
<img alt="KSP" src="imgs/logo.png" class="app-logo">
<span class="ps-2 fs-4 fw-bold text-primary">KSP — <span class="badge text-bg-primary">Config Desk</span></span>
<span class="ps-2 fs-4 fw-semibold text-primary text-nowrap">Config Desk</span>
<span class="mx-2 fs-5 text-body-secondary" aria-hidden="true"></span>
<span id="headerViewTitle" class="fs-5 text-body text-nowrap">Vue d'ensemble</span>
</div>
<div class="app-nav nav nav-pills flex-nowrap gap-1" aria-label="Navigation Config Desk">
<div class="app-nav nav nav-pills flex-nowrap gap-1 ms-auto" aria-label="Navigation Config Desk">
<button class="nav-link app-nav-button active" type="button" data-view="overview">Vue d'ensemble</button>
<button class="nav-link app-nav-button" type="button" data-view="documents">Documents</button>
<button class="nav-link app-nav-button" type="button" data-view="profiles">Profils</button>

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-config-desk/frontend/ts/main.ts
// version: 3
// version: 4
import "bootstrap";
import ResizeObserver from "resize-observer-polyfill";
@@ -47,10 +47,15 @@ function activateView(viewId: ViewId, source: "startup" | "user"): void {
}
const copy = viewCopy[viewId];
const title = document.querySelector<HTMLElement>("#viewTitle");
const headerTitle = document.querySelector<HTMLElement>("#headerViewTitle");
const description = document.querySelector<HTMLElement>("#viewDescription");
if (title) {
title.textContent = copy.title;
}
if (headerTitle) {
headerTitle.textContent = copy.title;
}
document.title = `Config Desk — ${copy.title}`;
if (description) {
description.textContent = copy.description;
}
@@ -59,6 +64,7 @@ function activateView(viewId: ViewId, source: "startup" | "user"): void {
button.classList.toggle("active", active);
button.setAttribute("aria-current", active ? "page" : "false");
});
frontendTrace("main", "Main navigation tab state changed", { viewId, source });
const overview = document.querySelector<HTMLElement>("#overviewPanel");
if (overview) {
overview.hidden = viewId !== "overview";
@@ -74,6 +80,7 @@ function bindNavigation(): void {
document.querySelectorAll<HTMLButtonElement>("[data-view]").forEach(button => {
button.addEventListener("click", () => {
const requestedView = button.dataset.view;
frontendTrace("main", "Main navigation tab clicked", { requestedView: requestedView ?? null });
if (requestedView && isViewId(requestedView)) {
activateView(requestedView, "user");
}