v0.2.12-pre.002-fix.001

This commit is contained in:
2026-08-27 09:01:14 +02:00
parent d1d683d101
commit 0d01017c31
13 changed files with 422 additions and 69 deletions

View File

@@ -0,0 +1,25 @@
<!-- file: crates/ksp-app-solprices-desk/frontend/fonts/README.md -->
<!-- version: 1 -->
# Fonts du splash SOL Prices Desk
SOL Prices Desk réutilise le gabarit de splash KSP déjà stabilisé dans Config Desk et Wallet Desk et conserve la police locale :
```text
DOS_Amazigh.ttf
font-family: Dos Amazigh
```
Destination :
```text
crates/ksp-app-solprices-desk/frontend/fonts/DOS_Amazigh.ttf
```
Empreinte SHA-256 de l'asset repris du gabarit :
```text
a01ff4b5a0d699db7cefcf5336bf0e379ff6fbf0d096087571a13c8782f9aa02
```
`splash.scss` déclare `Dos Amazigh` avec `@font-face` et l'applique au titre `#app-name`.

View File

@@ -1,11 +1,11 @@
<!-- file: crates/ksp-app-solprices-desk/frontend/main.html -->
<!-- version: 2 -->
<!-- version: 3 -->
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<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>SOL Prices Desk — Prices</title>
@@ -21,7 +21,6 @@
<span class="mx-2 fs-5 text-body-secondary" aria-hidden="true"></span>
<span id="headerViewTitle" class="fs-5 text-body text-nowrap">Prices</span>
</div>
<span id="runtimeVersionBadge" class="badge text-bg-secondary">0.2.12-pre.2</span>
</div>
</nav>
</header>
@@ -51,7 +50,7 @@
<p class="text-body-secondary mb-0">Scaffold desktop actif. Le runtime Off-chain et la table SOL/USD arrivent dans les tranches suivantes.</p>
</div>
</div>
<div class="scaffold-placeholder border rounded-3 d-flex align-items-center justify-content-center bg-body-tertiary text-center p-4">
<div class="app-placeholder">
<div>
<i class="fa-solid fa-chart-line fa-3x text-body-secondary mb-3" aria-hidden="true"></i>
<h2 class="h5">Surface prix volontairement inactive</h2>
@@ -69,7 +68,7 @@
<div class="card shadow-sm">
<div class="card-header fw-semibold">Runtime</div>
<div class="card-body">
<dl class="row mb-0">
<dl class="row mb-0 app-runtime-list">
<dt class="col-sm-5">Version</dt>
<dd id="runtimeVersion" class="col-sm-7"></dd>
<dt class="col-sm-5">Phase</dt>

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-app-solprices-desk/frontend/sass/_app.scss
// version: 2
// version: 3
$app-header-height: 72px;
$app-footer-height: 42px;
@@ -46,22 +46,22 @@ body {
min-width: 0;
}
.app-scrollable {
height: 100%;
max-height: 100%;
}
.app-logo {
display: block;
width: auto;
height: 42px;
}
.app-scrollable {
height: 100%;
max-height: 100%;
}
.app-shell-card {
max-width: 1320px;
}
.app-shell-status {
.app-runtime-list dd {
font-family: var(--bs-font-monospace);
}
@@ -85,10 +85,21 @@ body {
white-space: nowrap;
}
.app-overview-list dd {
font-family: var(--bs-font-monospace);
.app-placeholder {
min-height: 320px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1rem;
padding: 2rem;
border: 1px dashed var(--bs-border-color);
border-radius: var(--bs-border-radius-lg);
color: var(--bs-secondary-color);
background: var(--bs-body-bg);
text-align: center;
}
.scaffold-placeholder {
min-height: 280px;
.app-placeholder i {
font-size: 2.5rem;
}

View File

@@ -1,19 +1,19 @@
<!-- file: crates/ksp-app-solprices-desk/frontend/splash.html -->
<!-- version: 1 -->
<!-- version: 2 -->
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link rel="icon" href="imgs/logo.png">
<link rel="stylesheet" href="sass/splash.scss">
<title>Chargement — SOL Prices Desk</title>
<title>KSP SOL Prices Desk — Chargement</title>
</head>
<body>
<div id="splash-container" style="opacity: 0;">
<img id="splash-image" src="imgs/splash.png" alt="Chargement de KSP Sol Prices Desk">
<img id="splash-image" src="imgs/splash.png" alt="Chargement de KSP SOL Prices Desk">
<div id="app-name">SOL Prices Desk</div>
<div id="debug-info" aria-live="off" hidden></div>
<div id="messages-container" aria-live="polite"></div>

View File

@@ -1,23 +1,29 @@
// file: crates/ksp-app-solprices-desk/frontend/ts/main.ts
// version: 1
// version: 2
import "bootstrap";
import ResizeObserver from "resize-observer-polyfill";
import "simplebar";
import { getCurrentWindow } from "@tauri-apps/api/window";
import type { RuntimeStatusDto } from "./bindings/ksp_app_solprices_desk/dto_common/RuntimeStatusDto.ts";
import { frontendDebug, frontendInfo, frontendTrace, installFrontendConsoleBridge } from "./frontend_log";
import { frontendDebug, frontendInfo, frontendTrace, frontendWarn, installFrontendConsoleBridge } from "./frontend_log";
import { invokeKsp } from "./invoke";
(window as Window & typeof globalThis & { ResizeObserver?: typeof ResizeObserver }).ResizeObserver = ResizeObserver;
installFrontendConsoleBridge("main");
const viewTitles: Record<string, string> = {
type ViewId = "prices" | "diagnostics";
const viewTitles: Record<ViewId, string> = {
prices: "Prices",
diagnostics: "Diagnostics",
};
function activateView(viewId: string): void {
if (!(viewId in viewTitles)) {
return;
}
function isViewId(value: string | undefined): value is ViewId {
return value === "prices" || value === "diagnostics";
}
function activateView(viewId: ViewId, source: "startup" | "user"): void {
document.querySelectorAll<HTMLElement>("[data-view-panel]").forEach(panel => {
panel.hidden = panel.dataset.viewPanel !== viewId;
});
@@ -28,7 +34,22 @@ function activateView(viewId: string): void {
if (header) {
header.textContent = viewTitles[viewId];
}
frontendDebug("main", "SOL Prices Desk view activated", { viewId });
document.title = `SOL Prices Desk — ${viewTitles[viewId]}`;
if (source !== "startup") {
frontendDebug("main", "SOL Prices Desk view activated", { viewId, source });
}
}
function bindNavigation(): void {
document.querySelectorAll<HTMLButtonElement>("[data-view]").forEach(button => {
button.addEventListener("click", () => {
const viewId = button.dataset.view;
if (isViewId(viewId)) {
activateView(viewId, "user");
}
});
});
frontendTrace("main", "SOL Prices Desk navigation handlers installed");
}
function renderRuntimeStatus(status: RuntimeStatusDto): void {
@@ -45,10 +66,6 @@ function renderRuntimeStatus(status: RuntimeStatusDto): void {
element.textContent = value;
}
}
const badge = document.querySelector<HTMLElement>("#runtimeVersionBadge");
if (badge) {
badge.textContent = status.applicationVersion;
}
const diagnostic = document.querySelector<HTMLElement>("#runtimeDiagnostic");
if (diagnostic) {
diagnostic.hidden = status.startupDiagnostic === null;
@@ -60,19 +77,26 @@ function renderRuntimeStatus(status: RuntimeStatusDto): void {
});
}
async function initializeMain(): Promise<void> {
frontendInfo("main", "SOL Prices Desk scaffold frontend loaded");
document.querySelectorAll<HTMLButtonElement>("[data-view]").forEach(button => {
button.addEventListener("click", () => {
const viewId = button.dataset.view;
if (viewId) {
activateView(viewId);
}
});
});
const status = await invokeKsp<RuntimeStatusDto>("main", "runtime_status");
async function loadRuntimeStatus(): Promise<void> {
const status = await invokeKsp<RuntimeStatusDto>("main", "get_runtime_status");
renderRuntimeStatus(status);
activateView("prices");
}
async function initializeMain(): Promise<void> {
const windowLabel = getCurrentWindow().label;
frontendInfo("main", "SOL Prices Desk main frontend loaded", { windowLabel });
bindNavigation();
activateView("prices", "startup");
try {
await loadRuntimeStatus();
} catch {
const diagnostic = document.querySelector<HTMLElement>("#runtimeDiagnostic");
if (diagnostic) {
diagnostic.hidden = false;
diagnostic.textContent = "Le statut runtime initial n'a pas pu être chargé.";
}
frontendWarn("main", "SOL Prices Desk startup runtime status load failed");
}
}
document.addEventListener("DOMContentLoaded", () => {