@leitwerk-dev/ui 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/assets/{ChronicleMarkdown-6T_LF-3B.js → ChronicleMarkdown-CDe1jngc.js} +1 -1
  2. package/dist/assets/DashboardPage-BRxe3uuy.css +1 -0
  3. package/dist/assets/DashboardPage-LiQ0_72g.js +1 -0
  4. package/dist/assets/{FutureLaunchDetailPage-D5Gc8YmZ.js → FutureLaunchDetailPage-DvyW_J5d.js} +1 -1
  5. package/dist/assets/GenericLauncher-D1qQy9hq.js +4 -0
  6. package/dist/assets/HomePage-Cnmp6osB.js +1 -0
  7. package/dist/assets/ProcessActionsMenu-DEQynjFa.js +1 -0
  8. package/dist/assets/{ProcessDetailPage-0c-fMf4Y.js → ProcessDetailPage-DvjQQTDj.js} +9 -9
  9. package/dist/assets/{ProcessesPage-CVvENTJg.js → ProcessesPage-B4BMXJT7.js} +1 -1
  10. package/dist/assets/SettingsPage-w1RHZ2l6.js +2 -0
  11. package/dist/assets/SkillsPage-Ber36rAD.js +2 -0
  12. package/dist/assets/{WatchersPage-D-uT5vWk.js → WatchersPage-Btq_SIk3.js} +1 -1
  13. package/dist/assets/{WikiPage-BNdWnJ6L.js → WikiPage-BjncVYf1.js} +1 -1
  14. package/dist/assets/http-contracts-public-BUgTIHYG.js +1 -0
  15. package/dist/assets/index-Dz0T5gKc.js +21 -0
  16. package/dist/assets/index-DzKWCM-z.css +1 -0
  17. package/dist/index.html +2 -2
  18. package/package.json +8 -8
  19. package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +8 -0
  20. package/src/components/GenericLauncher.svelte +69 -102
  21. package/src/components/ProcessActionsMenu.svelte +37 -59
  22. package/src/lib/api.ts +11 -0
  23. package/src/lib/dashboard-refresh.ts +47 -0
  24. package/src/lib/router-logic.ts +26 -5
  25. package/src/lib/router.svelte.ts +6 -2
  26. package/src/pages/DashboardPage.svelte +194 -0
  27. package/src/pages/FutureLaunchDetailPage.svelte +2 -2
  28. package/src/pages/HomePage.svelte +4 -4
  29. package/src/shell/AppShell.svelte +51 -57
  30. package/src/shell/Sidebar.svelte +134 -240
  31. package/src/test-support/wait.ts +19 -0
  32. package/dist/assets/GenericLauncher-4BQGl6fT.js +0 -4
  33. package/dist/assets/HomePage-mb9RzXht.js +0 -1
  34. package/dist/assets/ProcessActionsMenu-CEzADnZT.js +0 -1
  35. package/dist/assets/SettingsPage-CbNM5RWn.js +0 -2
  36. package/dist/assets/SkillsPage-rCSwSz89.js +0 -2
  37. package/dist/assets/http-contracts-public-BXXSFKbw.js +0 -1
  38. package/dist/assets/index-DybyOt1_.css +0 -1
  39. package/dist/assets/index-gVt2yBO1.js +0 -21
@@ -0,0 +1,47 @@
1
+ import type { DashboardResponseBody } from "@leitwerk-dev/protocol/http-contracts";
2
+
3
+ /** Snapshot state retained across refresh failures. @internal */
4
+ export interface DashboardLoadState {
5
+ data: DashboardResponseBody | null;
6
+ loading: boolean;
7
+ error: string | null;
8
+ }
9
+
10
+ /** Coalesces refresh triggers and invalidates responses after disposal. @internal */
11
+ export function createDashboardRefresh(
12
+ fetchSnapshot: (signal: AbortSignal) => Promise<DashboardResponseBody>,
13
+ publish: (state: DashboardLoadState) => void,
14
+ ) {
15
+ let state: DashboardLoadState = { data: null, loading: false, error: null };
16
+ let active: Promise<void> | null = null;
17
+ let disposed = false;
18
+ let controller: AbortController | null = null;
19
+ return {
20
+ refresh(): Promise<void> {
21
+ if (disposed) return Promise.resolve();
22
+ if (active) return active;
23
+ controller = new AbortController();
24
+ const signal = controller.signal;
25
+ state = { ...state, loading: true, error: null };
26
+ publish(state);
27
+ active = Promise.resolve()
28
+ .then(() => fetchSnapshot(signal))
29
+ .then(
30
+ (data) => ({ data, error: null }),
31
+ () => ({ data: state.data, error: "Couldn't refresh the dashboard. Try again." }),
32
+ )
33
+ .then((next) => {
34
+ active = null;
35
+ if (!disposed) {
36
+ state = { data: next.data, loading: false, error: next.error };
37
+ publish(state);
38
+ }
39
+ });
40
+ return active;
41
+ },
42
+ dispose() {
43
+ disposed = true;
44
+ controller?.abort();
45
+ },
46
+ };
47
+ }
@@ -2,6 +2,7 @@ export type Page =
2
2
  | "wiki"
3
3
  | "settings"
4
4
  | "api-tokens"
5
+ | "dashboard"
5
6
  | "home"
6
7
  | "processes"
7
8
  | "process-detail"
@@ -27,13 +28,17 @@ function decodeFirstSegment(pathname: string, prefix: string): string {
27
28
  return segment ? decodeURIComponent(segment) : "";
28
29
  }
29
30
 
30
- export function buildHomePath(launcherId?: string | null): string {
31
+ export function buildHomePath(): string {
32
+ return "/";
33
+ }
34
+
35
+ export function buildCreateProcessPath(launcherId?: string | null): string {
31
36
  if (!launcherId) {
32
- return "/";
37
+ return "/processes/new";
33
38
  }
34
39
  const params = new URLSearchParams();
35
40
  params.set("launcher", launcherId);
36
- return `/?${params.toString()}`;
41
+ return `/processes/new?${params.toString()}`;
37
42
  }
38
43
 
39
44
  export function buildFutureLaunchPath(futureExecutionId: string): string {
@@ -95,6 +100,10 @@ export function matchRoute(pathnameWithSearch: string): Route {
95
100
  };
96
101
  if (pathname === "/account/api-tokens" || pathname === "/account/api-tokens/")
97
102
  return { page: "api-tokens", params: {} };
103
+ if (pathname === "/processes/new" || pathname === "/processes/new/") {
104
+ const launcher = readSearchParams(pathnameWithSearch).get("launcher");
105
+ return { page: "home", params: launcher ? { launcher } : {} };
106
+ }
98
107
  const processDetailRoute = matchPrefixedDetailRoute(
99
108
  pathname,
100
109
  "/processes/",
@@ -153,10 +162,12 @@ export function matchRoute(pathnameWithSearch: string): Route {
153
162
 
154
163
  if (pathname === "/" || pathname === "/config" || pathname === "/system") {
155
164
  const launcher = readSearchParams(pathnameWithSearch).get("launcher");
156
- return launcher ? { page: "home", params: { launcher } } : { page: "home", params: {} };
165
+ return launcher || pathname !== "/"
166
+ ? { page: "home", params: launcher ? { launcher } : {} }
167
+ : { page: "dashboard", params: {} };
157
168
  }
158
169
 
159
- return { page: "home", params: {} };
170
+ return { page: "dashboard", params: {} };
160
171
  }
161
172
 
162
173
  /** @internal */
@@ -241,3 +252,13 @@ export function readInspectorTarget(path: string): InspectorRoute {
241
252
  }
242
253
  return invalid;
243
254
  }
255
+
256
+ /** @internal */
257
+ export function canonicalizeRoutePath(path: string): string {
258
+ const pathname = stripSearchAndHash(path);
259
+ const launcher = readSearchParams(path).get("launcher");
260
+ if (pathname === "/config" || pathname === "/system" || (pathname === "/" && launcher)) {
261
+ return buildCreateProcessPath(launcher);
262
+ }
263
+ return path;
264
+ }
@@ -1,6 +1,7 @@
1
1
  export type { Page, Route } from "./router-logic.js";
2
2
  export {
3
3
  buildAvailableSkillPath,
4
+ buildCreateProcessPath,
4
5
  buildFutureLaunchPath,
5
6
  buildHomePath,
6
7
  buildInstalledSkillPath,
@@ -12,7 +13,7 @@ export {
12
13
  } from "./router-logic.js";
13
14
 
14
15
  import { derived, writable } from "svelte/store";
15
- import { matchRoute } from "./router-logic.js";
16
+ import { canonicalizeRoutePath, matchRoute } from "./router-logic.js";
16
17
 
17
18
  interface NavigateOptions {
18
19
  replace?: boolean;
@@ -20,7 +21,10 @@ interface NavigateOptions {
20
21
  }
21
22
 
22
23
  function readCurrentLocationPath(): string {
23
- return `${window.location.pathname}${window.location.search}${window.location.hash}`;
24
+ const path = `${window.location.pathname}${window.location.search}${window.location.hash}`;
25
+ const canonical = canonicalizeRoutePath(path);
26
+ if (canonical !== path) history.replaceState(history.state, "", canonical);
27
+ return canonical;
24
28
  }
25
29
 
26
30
  const currentLocationPath = writable(readCurrentLocationPath());
@@ -0,0 +1,194 @@
1
+ <script lang="ts">
2
+ import { onMount } from "svelte";
3
+ import PageHeader from "../components/PageHeader.svelte";
4
+ import { fetchDashboard } from "../lib/api.js";
5
+ import { createDashboardRefresh, type DashboardLoadState } from "../lib/dashboard-refresh.js";
6
+ import {
7
+ buildCreateProcessPath,
8
+ buildProcessesPath,
9
+ buildSkillsPath,
10
+ buildWatchersPath,
11
+ followLink,
12
+ } from "../lib/router.svelte.js";
13
+ import { wsStore } from "../lib/ws.svelte.js";
14
+
15
+ let snapshot = $state<DashboardLoadState>({ data: null, loading: true, error: null });
16
+ const loader = createDashboardRefresh(fetchDashboard, (state) => {
17
+ snapshot = state;
18
+ });
19
+ let grouping = $state<"status" | "definition">("status");
20
+ let allModels = $state(false);
21
+ let allIssues = $state(false);
22
+ const data = $derived(snapshot.data);
23
+ const definitions = $derived(data?.definitions.items ?? []);
24
+ const watchers = $derived(data?.watchers.items ?? []);
25
+ const rankedDefinitions = $derived(data?.processes.byDefinition ?? []);
26
+ const processMaximum = $derived(Math.max(1, ...rankedDefinitions.map((item) => item.count)));
27
+ const modelMaximum = $derived(
28
+ Math.max(0, ...(data?.costs.byModel.map((item) => item.costUsd) ?? [])),
29
+ );
30
+ const usd = new Intl.NumberFormat("en-US", {
31
+ style: "currency",
32
+ currency: "USD",
33
+ minimumFractionDigits: 2,
34
+ maximumFractionDigits: 4,
35
+ });
36
+ function statusLabel(status: string) {
37
+ return status.charAt(0).toUpperCase() + status.slice(1);
38
+ }
39
+
40
+ onMount(() => {
41
+ void loader.refresh();
42
+ let reconnectCount: number | null = null;
43
+ const unsubscribe = wsStore.subscribe((connection) => {
44
+ if (reconnectCount !== null && connection.reconnectCount > reconnectCount)
45
+ void loader.refresh();
46
+ reconnectCount = connection.reconnectCount;
47
+ });
48
+ const visible = () => {
49
+ if (document.visibilityState === "visible") void loader.refresh();
50
+ };
51
+ document.addEventListener("visibilitychange", visible);
52
+ const timer = setInterval(visible, 30_000);
53
+ return () => {
54
+ clearInterval(timer);
55
+ document.removeEventListener("visibilitychange", visible);
56
+ unsubscribe();
57
+ loader.dispose();
58
+ };
59
+ });
60
+ </script>
61
+
62
+ <div class="dashboard" data-page="dashboard">
63
+ <PageHeader title="Dashboard" subtitle="An overview of your processes, resources, and model readiness.">
64
+ {#snippet actions()}
65
+ <a class="ui-button" data-variant="primary" href={buildCreateProcessPath()} onclick={(event) => followLink(event, buildCreateProcessPath())}>Start a process</a>
66
+ <button type="button" class="ui-button" disabled={snapshot.loading} onclick={() => void loader.refresh()}>{snapshot.loading ? "Refreshing…" : "Refresh"}</button>
67
+ {/snippet}
68
+ </PageHeader>
69
+ {#if snapshot.error}
70
+ <div class="refresh-error" role="alert"><p>{snapshot.error} {data ? "Showing the last loaded overview." : ""}</p><button type="button" class="ui-button" disabled={snapshot.loading} onclick={() => void loader.refresh()}>Retry</button></div>
71
+ {/if}
72
+ {#if !data}
73
+ {#if snapshot.loading}<p role="status" class="empty">Loading dashboard…</p>{/if}
74
+ {:else}
75
+ <div class="catalogs">
76
+ <a class="catalog" href={buildCreateProcessPath()} onclick={(event) => followLink(event, buildCreateProcessPath())}>
77
+ <h2>Process definitions <span class="count">{data.definitions.total}</span></h2>
78
+ {#if definitions.length}<ul>{#each definitions.slice(0, 3) as item (item.id)}<li>{item.name}</li>{/each}</ul>{:else}<p>No process definitions loaded.</p>{/if}
79
+ {#if data.definitions.total > 3}<p class="more">+{data.definitions.total - 3} more</p>{/if}
80
+ </a>
81
+ <a class="catalog" href={buildWatchersPath()} onclick={(event) => followLink(event, buildWatchersPath())}>
82
+ <h2>Watchers <span class="count">{data.watchers.total}</span></h2><p>{data.watchers.enabled} enabled</p>
83
+ {#if watchers.length}<ul>{#each watchers.slice(0, 3) as item (item.id)}<li>{item.name}</li>{/each}</ul>{:else}<p>No watchers registered.</p>{/if}
84
+ {#if data.watchers.total > 3}<p class="more">+{data.watchers.total - 3} more</p>{/if}
85
+ </a>
86
+ <a class="catalog" href={buildSkillsPath()} onclick={(event) => followLink(event, buildSkillsPath())}>
87
+ <h2>Skills <span class="count">{data.skills.total}</span></h2>
88
+ <dl class="skill-totals"><div><dt>Installed</dt><dd>{data.skills.installed}</dd></div><div><dt>Bundled</dt><dd>{data.skills.bundled}</dd></div></dl>
89
+ {#if !data.skills.total}<p>No skills available.</p>{/if}
90
+ </a>
91
+ </div>
92
+ <div class="overview">
93
+ <section class="panel" aria-labelledby="dashboard-processes">
94
+ <header class="panel-header"><h2 id="dashboard-processes">Processes <span class="count">{data.processes.total}</span></h2><a href={buildProcessesPath()} onclick={(event) => followLink(event, buildProcessesPath())}>View processes</a></header>
95
+ <p class="muted">All retained process instances</p>
96
+ <div class="grouping" role="group" aria-label="Group processes"><button type="button" aria-pressed={grouping === "status"} onclick={() => { grouping = "status"; }}>By status</button><button type="button" aria-pressed={grouping === "definition"} onclick={() => { grouping = "definition"; }}>By definition</button></div>
97
+ {#if data.processes.total === 0}<p class="empty">No processes yet. Start a process to see its progress here.</p>
98
+ {:else if grouping === "status"}
99
+ <div class="status-bar" aria-hidden="true">{#each data.processes.byStatus.filter((item) => item.count > 0) as item (item.status)}<span data-status={item.status} style:flex-grow={item.count}></span>{/each}</div>
100
+ <dl class="status-list">{#each data.processes.byStatus as item (item.status)}<div><dt><span class="status-dot" data-status={item.status} aria-hidden="true"></span>{statusLabel(item.status)}</dt><dd>{item.count}</dd></div>{/each}</dl>
101
+ {:else}
102
+ <ul class="ranked">{#each rankedDefinitions as item (item.processId)}<li><div class="row-label"><span>{item.name}</span><strong>{item.count}</strong></div><div class="track" aria-hidden="true"><span style:width={`${(item.count / processMaximum) * 100}%`}></span></div></li>{/each}</ul>
103
+ {/if}
104
+ </section>
105
+ <section class="panel" aria-labelledby="dashboard-costs">
106
+ <header class="panel-header"><h2 id="dashboard-costs">LLM costs</h2><span class="muted">All time · estimated USD</span></header>
107
+ {#if data.costs.totalLlmTurnCount === 0}<p class="empty">No LLM usage recorded yet.</p>
108
+ {:else if data.costs.totalUsd === null}<p class="empty">Cost unavailable. Recorded LLM turns have no cost information.</p>
109
+ {:else}
110
+ <p class="cost-total">{usd.format(data.costs.totalUsd)}</p>
111
+ {#if data.costs.totalUsd === 0}<p class="muted">Recorded usage has zero estimated cost.</p>{/if}
112
+ {#if data.costs.isPartial}<p class="coverage">Partial coverage: {data.costs.pricedTurnCount} of {data.costs.totalLlmTurnCount} LLM turns include cost. {data.costs.missingCostTurnCount} have no recorded cost.</p>{/if}
113
+ <ul class="cost-list">{#each data.costs.byModel.slice(0, allModels ? undefined : 5) as model}<li><div class="cost-row"><div><span>{model.modelId ?? "Unknown model"}</span><small>{model.providerId ?? "Unknown provider"} · {model.turnCount} {model.turnCount === 1 ? "priced turn" : "priced turns"}</small></div><strong>{usd.format(model.costUsd)}</strong></div><div class="track cost-track" aria-hidden="true"><span style:width={`${modelMaximum > 0 ? (model.costUsd / modelMaximum) * 100 : 0}%`}></span></div></li>{/each}</ul>
114
+ {#if data.costs.byModel.length > 5}<button type="button" class="text-button" aria-expanded={allModels} onclick={() => { allModels = !allModels; }}>{allModels ? "Show fewer models" : `Show all ${data.costs.byModel.length} models`}</button>{/if}
115
+ {/if}
116
+ </section>
117
+ </div>
118
+ <section class="panel configuration" aria-labelledby="dashboard-configuration">
119
+ <header class="panel-header"><h2 id="dashboard-configuration">Configuration issues</h2>{#if data.configuration.issues.length}<span class="muted">{data.configuration.issues.length} {data.configuration.issues.length === 1 ? "issue" : "issues"}</span>{/if}</header>
120
+ {#if !data.configuration.issues.length}<p class="healthy">No model readiness issues detected.</p>
121
+ {:else}
122
+ <ul class="issues">{#each data.configuration.issues.slice(0, allIssues ? undefined : 3) as issue (issue.id)}<li><span class="severity" data-severity={issue.severity}>{statusLabel(issue.severity)}</span><div><p>{issue.message}</p><div class="sources">{#each issue.sources as source}{#if source.href}<a href={source.href} onclick={(event) => followLink(event, source.href ?? "/")}>{source.label}</a>{:else}<span>{source.label}</span>{/if}{/each}</div></div></li>{/each}</ul>
123
+ {#if data.configuration.issues.length > 3}<button type="button" class="text-button" aria-expanded={allIssues} onclick={() => { allIssues = !allIssues; }}>{allIssues ? "Show fewer issues" : `Show all ${data.configuration.issues.length} issues`}</button>{/if}
124
+ {/if}
125
+ </section>
126
+ <p class="updated">Updated <time datetime={data.generatedAt}>{new Date(data.generatedAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })}</time></p>
127
+ {/if}
128
+ </div>
129
+
130
+ <style>
131
+ .dashboard { display: grid; gap: var(--space-lg); min-width: 0; padding: var(--space-2xs) 2px var(--space-xl); color: var(--chronicle-text); font-size: var(--type-body); }
132
+ .catalogs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); }
133
+ .catalog { display: block; padding: var(--space-md) var(--space-lg); border-radius: 14px; background: var(--chronicle-panel-muted); color: inherit; text-decoration: none; transition: background 150ms ease-out; }
134
+ .catalog:hover { background: var(--chronicle-accent-soft); }
135
+ h2 { margin: 0; font-size: var(--type-title-sm); font-weight: 650; line-height: 1.35; }
136
+ .count { margin-left: var(--space-xs); color: var(--chronicle-text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
137
+ p { margin: var(--space-xs) 0 0; line-height: 1.55; }
138
+ .catalog p, .muted, .updated, small { color: var(--chronicle-text-muted); font-size: var(--type-body-sm); }
139
+ ul { list-style: none; padding: 0; margin: var(--space-sm) 0 0; }
140
+ .catalog li { overflow-wrap: anywhere; line-height: 1.6; }
141
+ .more { color: var(--chronicle-accent); }
142
+ .skill-totals { margin: var(--space-sm) 0 0; display: grid; gap: var(--space-xs); }
143
+ .skill-totals div, .status-list div { display: flex; justify-content: space-between; gap: var(--space-md); }
144
+ dd { margin: 0; font-variant-numeric: tabular-nums; }
145
+ .overview { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-lg); }
146
+ .panel { min-width: 0; padding: var(--space-lg); border: 1px solid var(--chronicle-border); border-radius: 14px; }
147
+ .panel-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--space-sm); }
148
+ a:not(.ui-button):not(.catalog), .text-button { color: var(--chronicle-accent); text-underline-offset: 3px; }
149
+ a:focus-visible, button:focus-visible { outline: 2px solid var(--chronicle-accent); outline-offset: 4px; }
150
+ .grouping { display: inline-flex; flex-wrap: wrap; margin-top: var(--space-lg); padding: 3px; gap: 3px; background: var(--chronicle-panel-muted); border-radius: 10px; }
151
+ .grouping button { border: 0; border-radius: 7px; padding: 8px 12px; background: transparent; color: var(--chronicle-text-muted); font: inherit; cursor: pointer; }
152
+ .grouping button[aria-pressed="true"] { color: var(--chronicle-text); background: var(--chronicle-card-surface); }
153
+ .grouping button:hover { color: var(--chronicle-text); }
154
+ .status-bar { display: flex; height: 16px; overflow: hidden; border-radius: 4px; margin-top: var(--space-lg); gap: 3px; }
155
+ [data-status="running"] { background: var(--chronicle-accent); }
156
+ [data-status="waiting"] { background: var(--chronicle-attention); }
157
+ [data-status="error"] { background: var(--chronicle-danger); }
158
+ [data-status="completed"] { background: var(--chronicle-success); }
159
+ [data-status="aborted"] { background: var(--chronicle-text-muted); }
160
+ .status-list { display: grid; gap: var(--space-sm); margin: var(--space-md) 0 0; }
161
+ .status-list dt { display: flex; align-items: center; gap: var(--space-xs); }
162
+ .status-dot { width: 8px; height: 8px; border-radius: 50%; }
163
+ .ranked li { margin-bottom: var(--space-md); }
164
+ .row-label { display: flex; justify-content: space-between; gap: var(--space-md); }
165
+ .row-label span, .cost-list span, .sources { overflow-wrap: anywhere; }
166
+ .track { margin-top: 6px; height: 7px; border-radius: 3px; background: var(--chronicle-panel-muted); overflow: hidden; }
167
+ .track span { display: block; height: 100%; background: var(--chronicle-accent); }
168
+ .cost-total { font-size: 1.65rem; font-weight: 620; font-variant-numeric: tabular-nums; margin-top: var(--space-lg); }
169
+ .coverage { font-size: var(--type-body-sm); color: var(--chronicle-text-muted); }
170
+ .cost-list li { padding: var(--space-sm) 0; }
171
+ .cost-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); }
172
+ .cost-track span { background: var(--chronicle-text-muted); }
173
+ .cost-row > div { min-width: 0; }
174
+ .cost-list small { display: block; margin-top: 3px; }
175
+ strong { font-weight: 620; font-variant-numeric: tabular-nums; }
176
+ .cost-list strong { white-space: nowrap; }
177
+ .text-button { background: transparent; border: 0; font: inherit; padding: var(--space-sm) 0; text-decoration: underline; cursor: pointer; }
178
+ .text-button:hover { color: var(--chronicle-text); }
179
+ .issues li { display: flex; align-items: baseline; gap: var(--space-md); padding: var(--space-md) 0; border-top: 1px solid var(--chronicle-border); }
180
+ .issues li > div { min-width: 0; }
181
+ .issues p { margin: 0; overflow-wrap: anywhere; }
182
+ .severity { flex: 0 0 auto; font-weight: 620; font-size: var(--type-body-sm); }
183
+ .severity[data-severity="error"] { color: var(--chronicle-danger-text); }
184
+ .severity[data-severity="warning"] { color: var(--chronicle-attention); }
185
+ .sources { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-top: var(--space-xs); color: var(--chronicle-text-muted); font-size: var(--type-body-sm); }
186
+ .healthy { color: var(--chronicle-success); font-weight: 550; }
187
+ .empty { padding: var(--space-lg) 0; color: var(--chronicle-text-muted); max-width: 68ch; }
188
+ .refresh-error { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding: var(--space-md); border-radius: 14px; background: color-mix(in srgb, var(--chronicle-danger) 7%, white); color: var(--chronicle-danger-text); }
189
+ .refresh-error p { margin: 0; }
190
+ .updated { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
191
+ @media (max-width: 900px) { .catalogs { grid-template-columns: 1fr; } .overview { grid-template-columns: 1fr; } }
192
+ @media (max-width: 540px) { .panel, .catalog { padding: var(--space-md); } .issues li, .refresh-error { align-items: flex-start; flex-direction: column; gap: var(--space-xs); } }
193
+ @media (prefers-reduced-motion: reduce) { .catalog { transition: none; } }
194
+ </style>
@@ -12,8 +12,8 @@ import { formatLocalDateTime24Hour, formatUtcDateTime24Hour } from "../lib/forma
12
12
  import { buildFutureLaunchDetailSections } from "../lib/future-launch-detail.js";
13
13
  import { loadProcessesList, upsertFutureExecution } from "../lib/processes.svelte";
14
14
  import {
15
+ buildCreateProcessPath,
15
16
  buildFutureLaunchPath,
16
- buildHomePath,
17
17
  buildProcessesPath,
18
18
  buildProcessPath,
19
19
  navigate,
@@ -40,7 +40,7 @@ let observedFutureExecutionId = $state<string | null>(null);
40
40
  let launchersLoadToken = 0;
41
41
  let futureLaunchDetailLoadToken = 0;
42
42
 
43
- const homePath = buildHomePath();
43
+ const homePath = buildCreateProcessPath();
44
44
  const processesPath = buildProcessesPath();
45
45
  const futureLaunch = $derived(
46
46
  loadedFutureLaunch?.id === futureExecutionId ? loadedFutureLaunch : null,
@@ -13,8 +13,8 @@ import { queueProcessLaunchNotice } from "../lib/process-launch-notices.svelte";
13
13
  import { upsertFutureExecution } from "../lib/processes.svelte.js";
14
14
  import { consumePendingRetryConfig } from "../lib/retry-config.svelte.js";
15
15
  import {
16
+ buildCreateProcessPath,
16
17
  buildFutureLaunchPath,
17
- buildHomePath,
18
18
  buildProcessPath,
19
19
  navigate,
20
20
  } from "../lib/router.svelte";
@@ -168,7 +168,7 @@ async function loadLaunchers() {
168
168
  retryInitialDraft = pendingRetry;
169
169
  unavailableLauncherId = null;
170
170
  if (!routeLauncherId) {
171
- navigate(buildHomePath(pendingRetry.launcherId), { replace: true });
171
+ navigate(buildCreateProcessPath(pendingRetry.launcherId), { replace: true });
172
172
  }
173
173
  } else {
174
174
  retryLauncherId = null;
@@ -199,12 +199,12 @@ function openLauncher(nextLauncherId: string) {
199
199
  if (launcherId === undefined) {
200
200
  retryLauncherId = nextLauncherId;
201
201
  }
202
- navigate(buildHomePath(nextLauncherId));
202
+ navigate(buildCreateProcessPath(nextLauncherId));
203
203
  }
204
204
 
205
205
  function goBackToGallery() {
206
206
  clearRetryPrefill();
207
- navigate(buildHomePath());
207
+ navigate(buildCreateProcessPath());
208
208
  }
209
209
 
210
210
  function handleLaunched(instanceId: string, launchWarning?: string | null) {
@@ -134,60 +134,52 @@ $effect(() => {
134
134
  };
135
135
  });
136
136
 
137
- const shortcutHelpTitle = $derived.by(() => {
138
- if (route.page === "settings") return "Settings";
139
- if (route.page === "api-tokens") return "API tokens";
140
- if (route.page === "home") {
141
- return "Start a process";
142
- }
143
- if (route.page === "processes") {
144
- return "All processes";
145
- }
146
- if (route.page === "watchers") {
147
- return "Watchers";
148
- }
149
- if (route.page === "skills") {
150
- return "Skills";
151
- }
152
- if (route.page === "future-launch-detail") {
153
- return "Scheduled launch";
154
- }
155
- return "Process detail";
156
- });
157
- const shortcutHelpDescription = $derived.by(() => {
158
- if (route.page === "home") {
159
- return "Quick reference for choosing a process type, opening setup, and returning to the process gallery.";
160
- }
161
- if (route.page === "processes") {
162
- return "Quick reference for searching and filtering process records.";
163
- }
164
- if (route.page === "watchers") {
165
- return "Quick reference for reviewing configured watcher registrations.";
166
- }
167
- if (route.page === "skills") {
168
- return "Quick reference for browsing, registering, and maintaining skills.";
169
- }
170
- if (route.page === "future-launch-detail") {
171
- return "Quick reference for reviewing or editing a scheduled launch.";
172
- }
173
- return "Quick reference for moving through the turn rail and returning to the latest activity.";
174
- });
175
- const shortcutHelpItems = $derived.by(() => {
176
- const extensionItems = $browserUiExtensionShortcutHelpItems;
177
- if (route.page === "home") {
178
- return [...homeShortcutItems, ...extensionItems];
179
- }
180
- if (route.page === "processes") {
181
- return [...browseShortcutItems, ...extensionItems];
182
- }
183
- if (route.page === "watchers" || route.page === "skills" || route.page === "api-tokens") {
184
- return [...watcherShortcutItems, ...extensionItems];
185
- }
186
- if (route.page === "future-launch-detail") {
187
- return [...watcherShortcutItems, ...extensionItems];
188
- }
189
- return [...processShortcutItems, ...extensionItems];
190
- });
137
+ const processShortcutHelp = {
138
+ title: "Process detail",
139
+ description:
140
+ "Quick reference for moving through the turn rail and returning to the latest activity.",
141
+ items: processShortcutItems,
142
+ };
143
+ const shortcutHelpByPage: Partial<Record<Route["page"], typeof processShortcutHelp>> = {
144
+ dashboard: {
145
+ title: "Dashboard",
146
+ description: "Quick reference for reviewing work and system health.",
147
+ items: watcherShortcutItems,
148
+ },
149
+ settings: { ...processShortcutHelp, title: "Settings" },
150
+ "api-tokens": { ...processShortcutHelp, title: "API tokens", items: watcherShortcutItems },
151
+ home: {
152
+ title: "Start a process",
153
+ description:
154
+ "Quick reference for choosing a process type, opening setup, and returning to the process gallery.",
155
+ items: homeShortcutItems,
156
+ },
157
+ processes: {
158
+ title: "All processes",
159
+ description: "Quick reference for searching and filtering process records.",
160
+ items: browseShortcutItems,
161
+ },
162
+ watchers: {
163
+ title: "Watchers",
164
+ description: "Quick reference for reviewing configured watcher registrations.",
165
+ items: watcherShortcutItems,
166
+ },
167
+ skills: {
168
+ title: "Skills",
169
+ description: "Quick reference for browsing, registering, and maintaining skills.",
170
+ items: watcherShortcutItems,
171
+ },
172
+ "future-launch-detail": {
173
+ title: "Scheduled launch",
174
+ description: "Quick reference for reviewing or editing a scheduled launch.",
175
+ items: watcherShortcutItems,
176
+ },
177
+ };
178
+ const shortcutHelp = $derived(shortcutHelpByPage[route.page] ?? processShortcutHelp);
179
+ const shortcutHelpItems = $derived([
180
+ ...shortcutHelp.items,
181
+ ...$browserUiExtensionShortcutHelpItems,
182
+ ]);
191
183
 
192
184
  $effect(() => {
193
185
  const helpOpen = $keyboardShortcutHelpOpen;
@@ -290,7 +282,9 @@ $effect(() => {
290
282
  </div>
291
283
  {/if}
292
284
  <main class="content-region">
293
- {#if route.page === "home"}
285
+ {#if route.page === "dashboard"}
286
+ <RouteLoadBoundary load={import("../pages/DashboardPage.svelte")} props={{}} />
287
+ {:else if route.page === "home"}
294
288
  <RouteLoadBoundary
295
289
  load={import("../pages/HomePage.svelte")}
296
290
  props={{ launcherId: route.params.launcher ?? null }}
@@ -331,8 +325,8 @@ $effect(() => {
331
325
 
332
326
  <KeyboardShortcutsModal
333
327
  open={$keyboardShortcutHelpOpen}
334
- title={shortcutHelpTitle}
335
- description={shortcutHelpDescription}
328
+ title={shortcutHelp.title}
329
+ description={shortcutHelp.description}
336
330
  items={shortcutHelpItems}
337
331
  onClose={closeKeyboardShortcutHelp}
338
332
  />