@leitwerk-dev/ui 0.3.1 → 0.4.0
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.
- package/dist/assets/ApiTokensPage-DCmYvZdE.js +1 -0
- package/dist/assets/ChronicleMarkdown-6T_LF-3B.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-D5Gc8YmZ.js +1 -0
- package/dist/assets/GenericLauncher-4BQGl6fT.js +4 -0
- package/dist/assets/GenericLauncher-DRUMMTd7.css +1 -0
- package/dist/assets/HomePage-mb9RzXht.js +1 -0
- package/dist/assets/ProcessActionsMenu-CEzADnZT.js +1 -0
- package/dist/assets/ProcessDetailPage-0c-fMf4Y.js +14 -0
- package/dist/assets/ProcessDetailPage-km76G8wj.css +1 -0
- package/dist/assets/ProcessFlowDiagram-DI5KZ2Qj.js +1 -0
- package/dist/assets/ProcessFlowDiagram-NQ6oEZi7.css +1 -0
- package/dist/assets/ProcessesPage-CVvENTJg.js +1 -0
- package/dist/assets/ScheduleDateTimePicker-2eJ0jBQ-.css +1 -0
- package/dist/assets/ScheduleDateTimePicker-fg0Vau5Z.js +3 -0
- package/dist/assets/SettingsPage-BHSV4rl7.css +1 -0
- package/dist/assets/SettingsPage-CbNM5RWn.js +2 -0
- package/dist/assets/SkillsPage-rCSwSz89.js +2 -0
- package/dist/assets/WatchersPage-D-uT5vWk.js +1 -0
- package/dist/assets/WikiPage-BNdWnJ6L.js +1 -0
- package/dist/assets/WikiPage-Bvnhxl3m.css +1 -0
- package/dist/assets/http-client-Cvi3zOou.js +2 -0
- package/dist/assets/http-contracts-public-BXXSFKbw.js +1 -0
- package/dist/assets/index-DybyOt1_.css +1 -0
- package/dist/assets/{index-client-BYQviCtQ.js → index-client-BSAA7n1a.js} +2 -2
- package/dist/assets/index-gVt2yBO1.js +21 -0
- package/dist/assets/mermaid-render.worker-BN0bcvGc.js +6398 -0
- package/dist/assets/retry-config.svelte-HNNF65qc.js +1 -0
- package/dist/assets/settings-Dk5UoSQa.js +1 -0
- package/dist/index.html +4 -7
- package/package.json +10 -9
- package/src/App.svelte +9 -0
- package/src/chronicle/components/ChronicleActionSection.svelte +10 -2
- package/src/chronicle/components/ChronicleEntryHeader.svelte +4 -16
- package/src/chronicle/components/ChronicleFlow.svelte +24 -6
- package/src/chronicle/components/ChronicleLiveTail.svelte +52 -24
- package/src/chronicle/components/ChronicleProcessErrorSection.svelte +14 -0
- package/src/chronicle/components/ChronicleQuestionRequest.svelte +1 -1
- package/src/chronicle/components/ChronicleRecoverySection.svelte +14 -10
- package/src/chronicle/components/ChronicleStartupRecoverySection.svelte +14 -10
- package/src/chronicle/components/ChronicleThinkingSection.svelte +8 -2
- package/src/chronicle/components/ChronicleToolApproval.svelte +120 -17
- package/src/chronicle/components/ChronicleToolCallItem.svelte +32 -6
- package/src/chronicle/components/ChronicleTurnCluster.svelte +6 -6
- package/src/chronicle/components/ChronicleTurnProgress.svelte +10 -4
- package/src/chronicle/components/ChronicleTurnRail.svelte +1 -0
- package/src/chronicle/components/RecoveryModelControl.svelte +14 -13
- package/src/chronicle/lib/chronicle-projection.ts +74 -376
- package/src/chronicle/lib/chronicle-selectable-items.ts +23 -3
- package/src/chronicle/lib/recovery-model.ts +17 -0
- package/src/components/ConversationTreeDiagram.svelte +93 -30
- package/src/components/FormFieldRenderer.svelte +184 -27
- package/src/components/GenericLauncher.svelte +378 -166
- package/src/components/NamedSelectionList.svelte +77 -0
- package/src/components/ProcessSettings.svelte +110 -0
- package/src/components/ScheduleDateTimePicker.svelte +9 -4
- package/src/components/SettingsField.svelte +317 -0
- package/src/components/SettingsOverview.svelte +237 -0
- package/src/components/SkillSelector.svelte +15 -3
- package/src/components/launcher-form-copy.ts +2 -1
- package/src/components/launcher-model-config.ts +8 -7
- package/src/components/launcher-selections.ts +123 -0
- package/src/lib/api.ts +89 -43
- package/src/lib/http-client.ts +20 -1
- package/src/lib/instance-tree-layout.ts +41 -10
- package/src/lib/primary-path-detail.ts +56 -341
- package/src/lib/primary-path-replay.ts +8 -9
- package/src/lib/process-history.ts +57 -0
- package/src/lib/processes.svelte.ts +71 -79
- package/src/lib/reasoning-history.ts +31 -23
- package/src/lib/router-logic.ts +101 -51
- package/src/lib/router.svelte.ts +4 -4
- package/src/lib/settings.ts +114 -0
- package/src/lib/wiki.ts +34 -0
- package/src/pages/ProcessDetailPage.svelte +55 -344
- package/src/pages/ProcessFlowDiagram.svelte +39 -684
- package/src/pages/SettingsPage.svelte +265 -0
- package/src/pages/SkillsPage.svelte +26 -12
- package/src/pages/WikiPage.svelte +9 -0
- package/src/pages/process-detail/ProcessDetailChronicle.svelte +57 -13
- package/src/pages/process-detail/ProcessDetailHeader.svelte +9 -3
- package/src/pages/process-detail/TicketCreationComposer.svelte +49 -10
- package/src/pages/process-detail/inspector/ExecutionDetails.svelte +210 -0
- package/src/pages/process-detail/inspector/InspectionEvidence.svelte +48 -0
- package/src/pages/process-detail/inspector/InspectionMessage.svelte +71 -0
- package/src/pages/process-detail/inspector/ProcessInspector.svelte +144 -0
- package/src/pages/process-detail/inspector/ProcessModelEditor.svelte +161 -0
- package/src/pages/process-detail/inspector/ProcessReference.svelte +166 -0
- package/src/pages/process-detail/inspector/inspection-activity.ts +118 -0
- package/src/pages/process-detail/inspector/inspection-data.svelte.ts +107 -0
- package/src/pages/process-detail/inspector/inspection-tool-call.ts +30 -0
- package/src/pages/process-detail/inspector/inspector-navigation.ts +190 -0
- package/src/pages/process-detail/inspector/model-source-label.ts +17 -0
- package/src/pages/process-detail/process-detail-actions.svelte.ts +10 -0
- package/src/pages/process-detail/process-detail-chronicle-scroll.svelte.ts +18 -2
- package/src/pages/process-detail/process-detail-view-model.ts +2 -2
- package/src/shell/AppShell.svelte +5 -0
- package/src/shell/Sidebar.svelte +10 -0
- package/src/test-support/mount.ts +34 -0
- package/dist/assets/ApiTokensPage-ClJp9PYr.js +0 -1
- package/dist/assets/ChronicleMarkdown-lqwX9Ywa.js +0 -16
- package/dist/assets/FutureLaunchDetailPage-ygp-IdXC.js +0 -1
- package/dist/assets/GenericLauncher-CExW6wei.css +0 -1
- package/dist/assets/GenericLauncher-DOwsERpB.js +0 -1
- package/dist/assets/HomePage-D1J-Rmsw.js +0 -1
- package/dist/assets/PageHeader-DPuQInDo.css +0 -1
- package/dist/assets/PageHeader-sphJnWL1.js +0 -1
- package/dist/assets/ProcessActionsMenu-DV9zaxNS.js +0 -1
- package/dist/assets/ProcessDetailPage-BW1M2IH8.js +0 -14
- package/dist/assets/ProcessDetailPage-Cth6A0DN.css +0 -1
- package/dist/assets/ProcessFlowDiagram-Cz8wNicU.css +0 -1
- package/dist/assets/ProcessFlowDiagram-Dx2wheGN.js +0 -2
- package/dist/assets/ProcessesPage-CSPH5L7E.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-DmojMRxN.js +0 -1
- package/dist/assets/ScheduleDateTimePicker-uacJAkIq.css +0 -1
- package/dist/assets/SkillsPage-KnLql0n1.js +0 -2
- package/dist/assets/WatchersPage-B4jf3Ywp.js +0 -1
- package/dist/assets/http-client-VpPXJwbR.js +0 -2
- package/dist/assets/index-DPCokDbS.js +0 -6
- package/dist/assets/index-DtEI5gsQ.css +0 -1
- package/dist/assets/mermaid-render.worker-QW2WZpEE.js +0 -6393
- package/dist/assets/process-terminal-display-BQRQwGod.js +0 -1
- package/dist/assets/router.svelte-EEldxHlO.js +0 -1
- package/src/chronicle/components/ChronicleReasoningDetailsOverlay.svelte +0 -855
- package/src/components/ProcessInfoOverlay.svelte +0 -1221
- package/src/lib/flow-layout.ts +0 -319
- package/src/pages/process-detail/OverlayFrame.svelte +0 -58
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type {
|
|
3
|
+
SettingsPreview,
|
|
4
|
+
SettingsScopesResponse,
|
|
5
|
+
} from "@leitwerk-dev/protocol/http-contracts";
|
|
6
|
+
import { onMount, tick, untrack } from "svelte";
|
|
7
|
+
import SettingsField from "../components/SettingsField.svelte";
|
|
8
|
+
import SettingsOverview from "../components/SettingsOverview.svelte";
|
|
9
|
+
import { locationStore, navigate } from "../lib/router.svelte.js";
|
|
10
|
+
import { fetchSettingsPreview, fetchSettingsScopes, onSettingsChanged } from "../lib/settings.js";
|
|
11
|
+
import { wsStore } from "../lib/ws.svelte.js";
|
|
12
|
+
|
|
13
|
+
let { subjectId = "instance" }: { subjectId?: string } = $props();
|
|
14
|
+
let selected = $state(untrack(() => subjectId));
|
|
15
|
+
let scopes = $state<SettingsScopesResponse | null>(null);
|
|
16
|
+
let preview = $state<SettingsPreview | null>(null);
|
|
17
|
+
let loading = $state(true);
|
|
18
|
+
let panelOpen = $state(untrack(() => subjectId !== "instance"));
|
|
19
|
+
let refreshVersion = $state(0);
|
|
20
|
+
let error = $state("");
|
|
21
|
+
let sourceError = $state("");
|
|
22
|
+
let refreshing = $state(false);
|
|
23
|
+
let loadId = 0;
|
|
24
|
+
let scopesLoadId = 0;
|
|
25
|
+
let selectionGeneration = 0;
|
|
26
|
+
let acceptSaved = $state(untrack(() => savedFor(selected, selectionGeneration)));
|
|
27
|
+
function savedFor(id: string, generation: number) {
|
|
28
|
+
return (result: SettingsPreview) => {
|
|
29
|
+
if (selected !== id || selectionGeneration !== generation) return;
|
|
30
|
+
loadId++;
|
|
31
|
+
preview = result;
|
|
32
|
+
loading = false;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function selectScope(id: string, updateUrl = false) {
|
|
36
|
+
if (id === selected) return;
|
|
37
|
+
lastSelected[selectedGroup.id] = selected;
|
|
38
|
+
selected = id;
|
|
39
|
+
acceptSaved = savedFor(selected, ++selectionGeneration);
|
|
40
|
+
if (updateUrl) updatePath(selected);
|
|
41
|
+
void load(selected);
|
|
42
|
+
}
|
|
43
|
+
$effect(() => {
|
|
44
|
+
const id = subjectId;
|
|
45
|
+
untrack(() => selectScope(id));
|
|
46
|
+
});
|
|
47
|
+
$effect(() => {
|
|
48
|
+
const url = new URL($locationStore, window.location.origin);
|
|
49
|
+
if (url.pathname === "/settings" && (url.searchParams.get("scope") ?? "instance") === selected)
|
|
50
|
+
panelOpen = selected !== "instance" && url.searchParams.get("view") !== "overview";
|
|
51
|
+
});
|
|
52
|
+
function updatePath(id = selected, overview = false) {
|
|
53
|
+
const params = new URL($locationStore, window.location.origin).searchParams;
|
|
54
|
+
params.set("scope", id);
|
|
55
|
+
if (overview) params.set("view", "overview");
|
|
56
|
+
else params.delete("view");
|
|
57
|
+
navigate(`/settings?${params}`);
|
|
58
|
+
}
|
|
59
|
+
async function openSubject(id: string) {
|
|
60
|
+
panelOpen = true;
|
|
61
|
+
if (id === selected) updatePath();
|
|
62
|
+
else selectScope(id, true);
|
|
63
|
+
await tick();
|
|
64
|
+
document.getElementById("settings-editor-heading")?.focus();
|
|
65
|
+
}
|
|
66
|
+
function closeEditor() {
|
|
67
|
+
panelOpen = false;
|
|
68
|
+
updatePath(selected, true);
|
|
69
|
+
}
|
|
70
|
+
const lastSelected: Record<string, string> = {};
|
|
71
|
+
const lastView: Record<string, string> = {};
|
|
72
|
+
const groups = $derived([...new Set(preview?.fields.map((field) => field.form.group) ?? [])]);
|
|
73
|
+
const scopeGroups = $derived.by(() => {
|
|
74
|
+
const subjects = (scopes?.subjects ?? [])
|
|
75
|
+
.filter((subject) => subject.hasSettings || subject.id === selected)
|
|
76
|
+
.map(({ id, scopeType, label, active }) => ({
|
|
77
|
+
id,
|
|
78
|
+
scopeType,
|
|
79
|
+
label,
|
|
80
|
+
active,
|
|
81
|
+
}));
|
|
82
|
+
// Keep deep links and redirected identities selectable while sources refresh.
|
|
83
|
+
if (!subjects.some((subject) => subject.id === selected))
|
|
84
|
+
subjects.push({
|
|
85
|
+
id: selected,
|
|
86
|
+
scopeType: preview?.subject.scopeType ?? (selected === "instance" ? "instance" : ""),
|
|
87
|
+
label: preview?.subject.label ?? (selected === "instance" ? "Instance" : "Loading scope…"),
|
|
88
|
+
active: true,
|
|
89
|
+
});
|
|
90
|
+
const labels = new Map([
|
|
91
|
+
["instance", "Instance"],
|
|
92
|
+
...(scopes?.scopes ?? []).map(
|
|
93
|
+
({ id, label }) => [id, id === "repository" ? "Repositories" : label] as const,
|
|
94
|
+
),
|
|
95
|
+
]);
|
|
96
|
+
for (const subject of subjects)
|
|
97
|
+
if (!labels.has(subject.scopeType))
|
|
98
|
+
labels.set(
|
|
99
|
+
subject.scopeType,
|
|
100
|
+
subject.scopeType ? `${subject.scopeType} (inactive)` : "Loading scope…",
|
|
101
|
+
);
|
|
102
|
+
return [...labels]
|
|
103
|
+
.map(([id, label]) => ({
|
|
104
|
+
id,
|
|
105
|
+
label,
|
|
106
|
+
subjects: subjects
|
|
107
|
+
.filter((subject) => subject.scopeType === id)
|
|
108
|
+
.sort((a, b) => a.label.localeCompare(b.label) || a.id.localeCompare(b.id)),
|
|
109
|
+
}))
|
|
110
|
+
.filter((group) => group.subjects.length > 0);
|
|
111
|
+
});
|
|
112
|
+
const selectedGroup = $derived(
|
|
113
|
+
scopeGroups.find((group) => group.subjects.some((subject) => subject.id === selected)) ??
|
|
114
|
+
scopeGroups[0],
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
function selectGroup(id: string) {
|
|
118
|
+
if (id === selectedGroup.id) return;
|
|
119
|
+
const group = scopeGroups.find((group) => group.id === id);
|
|
120
|
+
if (!group) return;
|
|
121
|
+
lastView[selectedGroup.id] = new URL($locationStore, window.location.origin).search;
|
|
122
|
+
const next =
|
|
123
|
+
group.subjects.find((subject) => subject.id === lastSelected[id])?.id ?? group.subjects[0].id;
|
|
124
|
+
panelOpen = false;
|
|
125
|
+
selectScope(next);
|
|
126
|
+
const params = new URLSearchParams(lastView[id] ?? "");
|
|
127
|
+
params.set("scope", next);
|
|
128
|
+
if (id === "instance") params.delete("view");
|
|
129
|
+
else params.set("view", "overview");
|
|
130
|
+
navigate(`/settings?${params}`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function navigateGroups(event: KeyboardEvent, index: number) {
|
|
134
|
+
let next: number;
|
|
135
|
+
switch (event.key) {
|
|
136
|
+
case "ArrowLeft":
|
|
137
|
+
next = (index - 1 + scopeGroups.length) % scopeGroups.length;
|
|
138
|
+
break;
|
|
139
|
+
case "ArrowRight":
|
|
140
|
+
next = (index + 1) % scopeGroups.length;
|
|
141
|
+
break;
|
|
142
|
+
case "Home":
|
|
143
|
+
next = 0;
|
|
144
|
+
break;
|
|
145
|
+
case "End":
|
|
146
|
+
next = scopeGroups.length - 1;
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
document.getElementById(`settings-group-${scopeGroups[next].id}`)?.focus();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async function load(id = selected, background = false) {
|
|
156
|
+
const token = ++loadId;
|
|
157
|
+
if (!background) loading = true;
|
|
158
|
+
error = "";
|
|
159
|
+
if (!background && preview?.subject.id !== id) preview = null;
|
|
160
|
+
try {
|
|
161
|
+
const result = await fetchSettingsPreview(id);
|
|
162
|
+
if (token === loadId && selected === id) preview = result;
|
|
163
|
+
} catch (caught) {
|
|
164
|
+
if (token === loadId)
|
|
165
|
+
error = caught instanceof Error ? caught.message : "Could not load settings";
|
|
166
|
+
} finally {
|
|
167
|
+
if (token === loadId) loading = false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
async function loadScopes(discover = false) {
|
|
171
|
+
const token = ++scopesLoadId;
|
|
172
|
+
sourceError = "";
|
|
173
|
+
if (discover) refreshing = true;
|
|
174
|
+
try {
|
|
175
|
+
const result = await fetchSettingsScopes(discover);
|
|
176
|
+
if (token === scopesLoadId) {
|
|
177
|
+
scopes = result;
|
|
178
|
+
refreshVersion++;
|
|
179
|
+
if (discover) await load(selected, true);
|
|
180
|
+
}
|
|
181
|
+
} catch (caught) {
|
|
182
|
+
if (token === scopesLoadId)
|
|
183
|
+
sourceError = caught instanceof Error ? caught.message : "Could not refresh settings sources";
|
|
184
|
+
} finally {
|
|
185
|
+
if (token === scopesLoadId) refreshing = false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
onMount(() => {
|
|
189
|
+
const refreshPreview = () => {
|
|
190
|
+
void load(selected, true);
|
|
191
|
+
void loadScopes();
|
|
192
|
+
};
|
|
193
|
+
let reconnectCount: number | undefined;
|
|
194
|
+
const unsubscribe = wsStore.subscribe((state) => {
|
|
195
|
+
if (state.reconnectCount === reconnectCount) return;
|
|
196
|
+
reconnectCount = state.reconnectCount;
|
|
197
|
+
refreshPreview();
|
|
198
|
+
});
|
|
199
|
+
const unsubscribeSettings = onSettingsChanged(refreshPreview);
|
|
200
|
+
return () => {
|
|
201
|
+
loadId++;
|
|
202
|
+
scopesLoadId++;
|
|
203
|
+
selectionGeneration++;
|
|
204
|
+
unsubscribe();
|
|
205
|
+
unsubscribeSettings();
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
</script>
|
|
209
|
+
|
|
210
|
+
{#snippet editor()}
|
|
211
|
+
{#if error}<p role="alert" class="error">{error}</p><button type="button" onclick={() => load()}>Try again</button>{/if}
|
|
212
|
+
{#if loading}<p role="status">Loading settings…</p>
|
|
213
|
+
{:else if preview}
|
|
214
|
+
{#key selected}
|
|
215
|
+
{#each groups as group}<section class="purpose" aria-label={group}><h2>{group}</h2>{#each preview.fields.filter((field) => field.form.group === group) as field (field.key)}<SettingsField {field} subjectId={selected} onSaved={acceptSaved} />{/each}</section>{/each}
|
|
216
|
+
{/key}
|
|
217
|
+
{#if !preview.fields.length && !preview.inactive.length}<p>No installed extension declares settings for this scope.</p>{/if}
|
|
218
|
+
{#if preview.inactive.length}<section class="purpose"><h2>Inactive settings</h2><p>These saved overrides are retained. Install their owning extensions to use or edit them.</p>{#each preview.inactive as override}<div class="inactive"><strong>{override.key}</strong><pre>{typeof override.value === "string" ? override.value : JSON.stringify(override.value, null, 2)}</pre><span>Revision {override.revision}</span></div>{/each}</section>{/if}
|
|
219
|
+
{/if}
|
|
220
|
+
{/snippet}
|
|
221
|
+
<div class="settings-page" class:collection={selectedGroup.id !== "instance"} class:editor-open={panelOpen}>
|
|
222
|
+
<header><h1>Settings</h1><p>Defaults shared across this installation. Changes apply when a new step is prepared, including operator retries.</p></header>
|
|
223
|
+
<div class="scope-tabs" role="tablist" aria-label="Settings groups">
|
|
224
|
+
{#each scopeGroups as group, index (group.id)}
|
|
225
|
+
<button type="button" role="tab" id={`settings-group-${group.id}`} aria-selected={selectedGroup.id === group.id} aria-controls="settings-group-panel" tabindex={selectedGroup.id === group.id ? 0 : -1} onclick={() => selectGroup(group.id)} onkeydown={(event) => navigateGroups(event, index)}>{group.label}</button>
|
|
226
|
+
{/each}
|
|
227
|
+
</div>
|
|
228
|
+
<div role="tabpanel" id="settings-group-panel" aria-labelledby={`settings-group-${selectedGroup.id}`}>
|
|
229
|
+
{#if sourceError}<p class="error" role="alert">{sourceError}</p><button type="button" onclick={() => loadScopes(true)}>Retry sources</button>{/if}
|
|
230
|
+
{#if selectedGroup.id === "instance"}
|
|
231
|
+
{@render editor()}
|
|
232
|
+
{:else}
|
|
233
|
+
{#key selectedGroup.id}
|
|
234
|
+
<SettingsOverview overview={scopes?.scopes.find((scope) => scope.id === selectedGroup.id)?.overview} scopeType={selectedGroup.id} label={selectedGroup.label} subjects={(scopes?.subjects ?? []).filter((subject) => selectedGroup.subjects.some((candidate) => candidate.id === subject.id))} {selected} {panelOpen} {refreshVersion} onSelect={openSubject} onClose={closeEditor}>
|
|
235
|
+
{#snippet refresh()}<button type="button" disabled={refreshing} onclick={() => loadScopes(true)}>{refreshing ? "Refreshing…" : "Refresh sources"}</button>{/snippet}
|
|
236
|
+
{@render editor()}
|
|
237
|
+
</SettingsOverview>
|
|
238
|
+
{/key}
|
|
239
|
+
{/if}
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
<style>
|
|
244
|
+
.settings-page { width: min(100%, 860px); margin: 0 auto; padding: clamp(1rem, 4vw, 2.5rem); color: var(--chronicle-text); }
|
|
245
|
+
.settings-page.collection { width: min(100%, 1440px); }
|
|
246
|
+
h1 { margin: 0; font-size: var(--type-title-lg); }
|
|
247
|
+
h2 { margin: 0 0 .75rem; font-size: var(--type-title-sm); }
|
|
248
|
+
header p, .purpose > p { color: var(--chronicle-text-muted); max-width: 65ch; line-height: 1.6; }
|
|
249
|
+
.scope-tabs { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: 1.5rem; border-bottom: 1px solid var(--chronicle-border); }
|
|
250
|
+
.scope-tabs button { padding: .75rem .5rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--chronicle-text-muted); overflow-wrap: anywhere; }
|
|
251
|
+
.scope-tabs button:hover { background: var(--chronicle-panel-muted); color: var(--chronicle-text); }
|
|
252
|
+
.scope-tabs button[aria-selected="true"] { border-bottom-color: var(--chronicle-accent); color: var(--chronicle-accent); font-weight: 600; }
|
|
253
|
+
button { min-height: 44px; padding: .65rem .8rem; border: 1px solid var(--chronicle-border-strong); border-radius: var(--radius-sm); background: var(--chronicle-panel-surface); color: var(--chronicle-text); font: inherit; }
|
|
254
|
+
button { cursor: pointer; }
|
|
255
|
+
button:hover { background: var(--chronicle-panel-muted); }
|
|
256
|
+
button:focus-visible { outline: 2px solid var(--chronicle-accent); outline-offset: 3px; }
|
|
257
|
+
.purpose { margin: 2rem 0; }
|
|
258
|
+
.error { color: var(--chronicle-danger); }
|
|
259
|
+
.inactive { padding: 1rem 0; border-top: 1px solid var(--chronicle-border); }
|
|
260
|
+
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
261
|
+
@media (max-width: 700px) { .editor-open header, .editor-open .scope-tabs { display: none; } }
|
|
262
|
+
@media (max-width: 600px) {
|
|
263
|
+
.scope-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .75rem; }
|
|
264
|
+
}
|
|
265
|
+
</style>
|
|
@@ -143,6 +143,9 @@ const visibleCount = $derived(
|
|
|
143
143
|
activeView === "installed" ? filteredInstalled.length : filteredAvailable.length,
|
|
144
144
|
);
|
|
145
145
|
function skillStatus(skill: SkillCatalogItem | InstalledSkillCatalogItem) {
|
|
146
|
+
if ("registrationKind" in skill && skill.registrationKind === "bundled") {
|
|
147
|
+
return { label: "Bundled", className: "registered" };
|
|
148
|
+
}
|
|
146
149
|
if ("stale" in skill && skill.stale) {
|
|
147
150
|
return { label: "No longer available", className: "stale" };
|
|
148
151
|
}
|
|
@@ -326,11 +329,12 @@ $effect(() => {
|
|
|
326
329
|
{@const available = item.kind === "available"}
|
|
327
330
|
{@const repositoryId = available ? item.value.repositoryId : item.value.sourceRepositoryId}
|
|
328
331
|
{@const registrationKind = available ? null : item.value.registrationKind}
|
|
332
|
+
{@const bundled = registrationKind === "bundled"}
|
|
329
333
|
{@const revision = available ? item.value.sourceRevision : item.value.activeSourceRevision}
|
|
330
334
|
{@const href = available ? buildAvailableSkillPath(item.value.repositoryId, skill.id) : buildInstalledSkillPath(skill.id)}
|
|
331
335
|
{@const selected = selectedKey === `${item.kind}/${available ? `${item.value.repositoryId}/` : ""}${skill.id}`}
|
|
332
336
|
{@const status = skillStatus(skill)}
|
|
333
|
-
{@const repoLabel = registrationKind === "configuration" ? "Configuration" : repositoryLabels.get(repositoryId ?? "") ?? repositoryId ?? "Repository"}
|
|
337
|
+
{@const repoLabel = bundled && item.kind === "installed" ? item.value.sourceExtensionId ?? "Bundled extension" : registrationKind === "extension" && item.kind === "installed" ? item.value.ownerExtensionId ?? "Extension" : registrationKind === "configuration" ? "Configuration" : repositoryLabels.get(repositoryId ?? "") ?? repositoryId ?? "Repository"}
|
|
334
338
|
<tr
|
|
335
339
|
class:selected
|
|
336
340
|
onclick={(event) => {
|
|
@@ -351,25 +355,30 @@ $effect(() => {
|
|
|
351
355
|
<td>
|
|
352
356
|
<span>{repoLabel}</span>
|
|
353
357
|
<code>
|
|
354
|
-
{repositoryId && repositoryLabels.get(repositoryId) && repositoryLabels.get(repositoryId) !== repositoryId
|
|
358
|
+
{#if item.kind === "installed" && bundled}{item.value.sourceExtensionId ?? "Extension"}{:else}{repositoryId && repositoryLabels.get(repositoryId) && repositoryLabels.get(repositoryId) !== repositoryId
|
|
355
359
|
? `${repositoryId} · `
|
|
356
|
-
: ""}{revision?.slice(0, 8) ?? "local"}
|
|
360
|
+
: ""}{revision?.slice(0, 8) ?? "local"}{/if}
|
|
357
361
|
</code>
|
|
358
362
|
</td>
|
|
359
363
|
<td>
|
|
360
364
|
<span class={`status-chip ${status.className}`}>{status.label}</span>
|
|
361
365
|
{#if available && item.value.conflict}<span class="conflict">ID conflict</span>{/if}
|
|
362
366
|
</td>
|
|
363
|
-
|
|
364
|
-
|
|
367
|
+
{#if bundled}
|
|
368
|
+
<td><strong>Automatic</strong><span>Every AI step</span></td>
|
|
369
|
+
<td><span>Not tracked</span></td>
|
|
370
|
+
{:else}
|
|
371
|
+
<td><strong>{skill.usage.attachedLast30Days}</strong><span>30d · {skill.usage.attachedAllTime} total</span></td>
|
|
372
|
+
<td><strong>{skill.usage.invokedLast30Days}</strong><span>30d · {skill.usage.invokedAllTime} total</span></td>
|
|
373
|
+
{/if}
|
|
365
374
|
</tr>
|
|
366
375
|
{/snippet}
|
|
367
376
|
|
|
368
377
|
<div class="skills-page" data-page="skills">
|
|
369
378
|
<section class="catalog-pane" class:with-detail={Boolean(selectedKey)}>
|
|
370
379
|
<PageHeader
|
|
371
|
-
|
|
372
|
-
|
|
380
|
+
title="Skills"
|
|
381
|
+
subtitle="Browse bundled skills and manage skills from configured repositories."
|
|
373
382
|
>
|
|
374
383
|
{#snippet actions()}
|
|
375
384
|
{#if repositories.length > 0}
|
|
@@ -404,7 +413,7 @@ $effect(() => {
|
|
|
404
413
|
</div>
|
|
405
414
|
<p class="view-explanation">
|
|
406
415
|
{activeView === "installed"
|
|
407
|
-
? "
|
|
416
|
+
? "Bundled skills are automatically available to every AI step. Other installed skills can be attached to new process launches."
|
|
408
417
|
: "Remote skills must be installed before they can be attached to a process."}
|
|
409
418
|
</p>
|
|
410
419
|
|
|
@@ -477,13 +486,15 @@ $effect(() => {
|
|
|
477
486
|
{#if detail.kind === "available"}
|
|
478
487
|
<div class="detail-actions"><button class="ui-button primary-action" data-variant="primary" type="button" disabled={actionPending || detail.value.stale || detail.value.conflict || (detail.value.registered && !detail.value.updateAvailable)} onclick={() => void activateSkill()}>{actionPending ? "Working…" : detail.value.updateAvailable ? "Update skill" : detail.value.registered ? "Already installed" : "Install skill"}</button></div>
|
|
479
488
|
{#if detail.value.stale}<p class="action-note warning">This revision was not found during the latest successful repository refresh. It remains visible for history but cannot be installed or updated.</p>{/if}
|
|
480
|
-
{#if detail.value.conflict}<p class="action-note warning">This skill ID conflicts with another repository or
|
|
489
|
+
{#if detail.value.conflict}<p class="action-note warning">This skill ID conflicts with another repository, extension, or configuration-managed skill. Resolve the conflict before installing it.</p>{/if}
|
|
481
490
|
{:else}
|
|
482
491
|
<div class="detail-actions">
|
|
483
492
|
{#if detail.value.updateAvailable && detail.value.sourceRepositoryId}<button class="ui-button primary-action" data-variant="primary" type="button" disabled={actionPending} onclick={() => void activateSkill(detail.value.sourceRepositoryId)}>{actionPending ? "Updating…" : "Update skill"}</button>{/if}
|
|
484
493
|
{#if detail.value.registrationKind === "catalog"}<button bind:this={removeButtonEl} class="ui-button secondary-action danger" type="button" disabled={actionPending} onclick={() => void requestRemove()}>Remove</button>{/if}
|
|
485
494
|
</div>
|
|
495
|
+
{#if detail.value.registrationKind === "extension"}<p class="action-note">This skill is managed by the <code>{detail.value.ownerExtensionId}</code> extension. Update or remove that extension to change availability for future runs.</p>{/if}
|
|
486
496
|
{#if detail.value.registrationKind === "configuration"}<p class="action-note">This skill is managed by <code>leitwerk.yaml</code>. Change configuration to remove or update it.</p>{/if}
|
|
497
|
+
{#if detail.value.registrationKind === "bundled"}<p class="action-note">This skill is bundled with a loaded extension and is automatically available to every AI step. Update or remove the extension to change it.</p>{/if}
|
|
487
498
|
{#if confirmRemove}<div class="remove-confirmation" role="group" aria-label={`Remove ${detail.value.label}`}><strong>Remove {detail.value.label} from future runs?</strong><p>Existing processes and schedules keep their pinned revision.</p><div><button bind:this={confirmRemoveButtonEl} class="ui-button danger-action" data-variant="danger" type="button" disabled={actionPending} onclick={() => void deactivateSkill()}>{actionPending ? "Removing…" : "Confirm removal"}</button><button class="ui-button secondary-action" type="button" disabled={actionPending} onclick={() => void cancelRemove()}>Cancel</button></div></div>{/if}
|
|
488
499
|
{/if}
|
|
489
500
|
{#if actionError}<p class="action-note error" role="alert">{actionError} Try again.</p>{/if}
|
|
@@ -497,10 +508,13 @@ $effect(() => {
|
|
|
497
508
|
{#if detail.kind === "available"}
|
|
498
509
|
{@render sourceMetadata(detail.value)}
|
|
499
510
|
{:else}
|
|
500
|
-
<dl class="detail-meta"><div><dt>Managed by</dt><dd>{detail.value.registrationKind === "configuration" ? "Configuration" : repositoryLabels.get(detail.value.sourceRepositoryId ?? "") ?? detail.value.sourceRepositoryId ?? "Repository"}</dd></div><div><dt>Active revision</dt><dd><code>{detail.value.activeSourceRevision ?? detail.value.activeRevisionId}</code></dd></div
|
|
501
|
-
|
|
511
|
+
<dl class="detail-meta"><div><dt>Managed by</dt><dd>{detail.value.registrationKind === "bundled" ? detail.value.sourceExtensionId ?? "Bundled extension" : detail.value.registrationKind === "extension" ? detail.value.ownerExtensionId ?? "Extension" : detail.value.registrationKind === "configuration" ? "Configuration" : repositoryLabels.get(detail.value.sourceRepositoryId ?? "") ?? detail.value.sourceRepositoryId ?? "Repository"}</dd></div><div><dt>{detail.value.registrationKind === "bundled" ? "Bundle digest" : "Active revision"}</dt><dd><code>{detail.value.activeSourceRevision ?? detail.value.activeRevisionId}</code></dd></div>{#if detail.value.registrationKind !== "bundled"}<div><dt>Usage</dt><dd>{detail.value.usage.attachedAllTime} attached · {detail.value.usage.invokedAllTime} invoked</dd></div>{/if}</dl>
|
|
512
|
+
{#if detail.value.provenance}
|
|
513
|
+
<dl class="detail-meta"><div><dt>Package</dt><dd><code>{detail.value.provenance.packageName}@{detail.value.provenance.packageVersion}</code></dd></div><div><dt>Upstream</dt><dd>{detail.value.provenance.upstream.url}</dd></div><div><dt>Source path</dt><dd><code>{detail.value.provenance.sourcePath}</code></dd></div><div><dt>Adaptation digest</dt><dd><code>{detail.value.provenance.patchDigest}</code></dd></div></dl>
|
|
514
|
+
{/if}
|
|
515
|
+
{#if detail.value.registrationKind !== "bundled"}<section class="revision-section"><h3>Revision history</h3><div class="revision-list">{#each detail.value.revisions as revision (revision.id)}<div><span><code>{revision.sourceRevision ?? revision.id}</code><small>Imported {formatLocalDateTime(revision.importedAt)}</small></span>{#if revision.active}<span class="status-chip registered">Active</span>{/if}</div>{/each}</div></section>{/if}
|
|
502
516
|
{/if}
|
|
503
|
-
{@render processUsage(detail.value.processes)}
|
|
517
|
+
{#if detail.kind === "available" || detail.value.registrationKind !== "bundled"}{@render processUsage(detail.value.processes)}{/if}
|
|
504
518
|
</div>
|
|
505
519
|
{:else}
|
|
506
520
|
<section id="skill-instructions" class="instructions-section" role="tabpanel"><h3>Instructions</h3><ChronicleMarkdown markdown={instructionMarkdown(detail.value.skillMarkdown)} /></section>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import WikiPage from "@leitwerk-dev/wiki/ui/WikiPage.svelte";
|
|
3
|
+
import { wikiUiHost } from "../lib/wiki.js";
|
|
4
|
+
import { wsStore } from "../lib/ws.svelte.js";
|
|
5
|
+
|
|
6
|
+
let { topicId = "", pageId = "" }: { topicId?: string; pageId?: string } = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<WikiPage {topicId} {pageId} reconnectCount={$wsStore.reconnectCount} host={wikiUiHost} />
|
|
@@ -10,10 +10,7 @@ import ChronicleFlow from "../../chronicle/components/ChronicleFlow.svelte";
|
|
|
10
10
|
import ChronicleTerminalSummary from "../../chronicle/components/ChronicleTerminalSummary.svelte";
|
|
11
11
|
import ChronicleTurnRail from "../../chronicle/components/ChronicleTurnRail.svelte";
|
|
12
12
|
import CompactActionComposer from "../../chronicle/components/CompactActionComposer.svelte";
|
|
13
|
-
import type {
|
|
14
|
-
ChronicleProjection,
|
|
15
|
-
ChronicleReasoningDetailEntry,
|
|
16
|
-
} from "../../chronicle/lib/chronicle-projection.js";
|
|
13
|
+
import type { ChronicleProjection } from "../../chronicle/lib/chronicle-projection.js";
|
|
17
14
|
import {
|
|
18
15
|
CHRONICLE_ACTION_SECTION_ANCHOR_ID,
|
|
19
16
|
type ChronicleSelectableItem,
|
|
@@ -30,6 +27,7 @@ import ProcessActionsMenu from "../../components/ProcessActionsMenu.svelte";
|
|
|
30
27
|
import type { ProcessDetailData } from "../../lib/api.js";
|
|
31
28
|
import { shouldIgnorePlainShortcut } from "../../lib/keyboard.js";
|
|
32
29
|
import type { ProcessTerminalStatus } from "../../lib/process-terminal-display.js";
|
|
30
|
+
import { historyState, loadEarlierProcessHistory } from "../../lib/processes.svelte.js";
|
|
33
31
|
import type { createProcessDetailActions } from "./process-detail-actions.svelte.js";
|
|
34
32
|
import { fitChronicleToViewport } from "./process-detail-chronicle-dom.js";
|
|
35
33
|
import { createProcessDetailChronicleScroll } from "./process-detail-chronicle-scroll.svelte.js";
|
|
@@ -58,13 +56,13 @@ interface Props {
|
|
|
58
56
|
startupRecovery: ProcessDetailData["startupRecovery"];
|
|
59
57
|
processError: CurrentProcessErrorViewModel | null;
|
|
60
58
|
scheduledActionDetail: ScheduledActionDetail | null;
|
|
61
|
-
|
|
59
|
+
reasoningTurnRecordIds: readonly string[];
|
|
62
60
|
hasBlockingDetailOverlay: boolean;
|
|
63
61
|
launchWarning?: string | null;
|
|
64
62
|
persistedModelSelectionWarning?: string | null;
|
|
65
63
|
jumpToLatestLabel: string;
|
|
66
64
|
onDismissLaunchWarning: () => void;
|
|
67
|
-
onOpenReasoningDetails: (turnRecordId: string) => void;
|
|
65
|
+
onOpenReasoningDetails: (turnRecordId: string, itemId?: string) => void;
|
|
68
66
|
onCloseBlockingDetailOverlays: () => void;
|
|
69
67
|
isProcessInfoOpen: boolean;
|
|
70
68
|
onToggleProcessInfo: () => void;
|
|
@@ -90,7 +88,7 @@ let {
|
|
|
90
88
|
startupRecovery,
|
|
91
89
|
processError,
|
|
92
90
|
scheduledActionDetail,
|
|
93
|
-
|
|
91
|
+
reasoningTurnRecordIds,
|
|
94
92
|
hasBlockingDetailOverlay,
|
|
95
93
|
launchWarning = null,
|
|
96
94
|
persistedModelSelectionWarning = null,
|
|
@@ -105,6 +103,11 @@ let {
|
|
|
105
103
|
|
|
106
104
|
let chronicleViewport: HTMLDivElement | null = $state(null);
|
|
107
105
|
let mobileQuickNavOpen = $state(false);
|
|
106
|
+
let matchingStep = $state<string | null>(null);
|
|
107
|
+
let matchIndex = $state(0);
|
|
108
|
+
const matches = $derived(
|
|
109
|
+
detail?.timeline.turns.filter((turn) => turn.turnId === matchingStep) ?? [],
|
|
110
|
+
);
|
|
108
111
|
let ticketDraft = $state<ChronicleTicketDraftArtifact | null>(null);
|
|
109
112
|
let ticketSelectionDraft = $state<ChronicleTicketDraftArtifact | null>(null);
|
|
110
113
|
|
|
@@ -130,6 +133,9 @@ const processLabel = $derived(
|
|
|
130
133
|
);
|
|
131
134
|
|
|
132
135
|
const chronicleScroll = createProcessDetailChronicleScroll({
|
|
136
|
+
get suspended() {
|
|
137
|
+
return hasBlockingDetailOverlay;
|
|
138
|
+
},
|
|
133
139
|
get instanceId() {
|
|
134
140
|
return instanceId;
|
|
135
141
|
},
|
|
@@ -169,11 +175,10 @@ function openFocusedReasoningDetails() {
|
|
|
169
175
|
chronicleScroll.activeAnchorId,
|
|
170
176
|
);
|
|
171
177
|
const preferredTurnRecordId =
|
|
172
|
-
(activeTurnRecordId &&
|
|
173
|
-
reasoningDetailEntries.some((entry) => entry.turnRecordId === activeTurnRecordId)
|
|
178
|
+
(activeTurnRecordId && reasoningTurnRecordIds.includes(activeTurnRecordId)
|
|
174
179
|
? activeTurnRecordId
|
|
175
180
|
: null) ??
|
|
176
|
-
|
|
181
|
+
reasoningTurnRecordIds.at(-1) ??
|
|
177
182
|
null;
|
|
178
183
|
if (preferredTurnRecordId) {
|
|
179
184
|
onOpenReasoningDetails(preferredTurnRecordId);
|
|
@@ -216,12 +221,36 @@ function openDetailedActionForm(actionId: string) {
|
|
|
216
221
|
void tick().then(() => chronicleScroll.jumpToAnchor(CHRONICLE_ACTION_SECTION_ANCHOR_ID));
|
|
217
222
|
}
|
|
218
223
|
|
|
224
|
+
function revealRecord(recordId?: string) {
|
|
225
|
+
const item = railItems.find((item) => item.kind === "turn" && item.turnRecordId === recordId);
|
|
226
|
+
if (!item) return;
|
|
227
|
+
chronicleScroll.jumpToAnchor(item.anchorId);
|
|
228
|
+
void tick().then(() => {
|
|
229
|
+
const anchor = document.getElementById(item.anchorId);
|
|
230
|
+
if (anchor) {
|
|
231
|
+
anchor.tabIndex = -1;
|
|
232
|
+
anchor.focus({ preventScroll: true });
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
export function reveal(target: { turnRecordId?: string; turnId?: string }) {
|
|
237
|
+
matchingStep = target.turnId ?? null;
|
|
238
|
+
matchIndex = 0;
|
|
239
|
+
revealRecord(
|
|
240
|
+
target.turnRecordId ?? detail?.timeline.turns.find((turn) => turn.turnId === target.turnId)?.id,
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
function moveMatch(direction: number) {
|
|
244
|
+
matchIndex += direction;
|
|
245
|
+
revealRecord(matches[matchIndex]?.id);
|
|
246
|
+
}
|
|
247
|
+
|
|
219
248
|
function handleWindowKeydown(event: KeyboardEvent) {
|
|
220
249
|
if (mobileQuickNavOpen) return;
|
|
221
250
|
if (shouldIgnorePlainShortcut(event) || !detail || hasBlockingDetailOverlay) {
|
|
222
251
|
return;
|
|
223
252
|
}
|
|
224
|
-
if (event.key === "r" &&
|
|
253
|
+
if (event.key === "r" && reasoningTurnRecordIds.length > 0) {
|
|
225
254
|
event.preventDefault();
|
|
226
255
|
openFocusedReasoningDetails();
|
|
227
256
|
return;
|
|
@@ -271,6 +300,7 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
271
300
|
</svg>
|
|
272
301
|
</button>
|
|
273
302
|
|
|
303
|
+
{#if matchingStep}<div class="match-navigation" role="status"><span>{matches.length ? `${matchIndex + 1} of ${matches.length} executions` : "No executions recorded"} for {matchingStep}</span><button class="ui-button" disabled={matchIndex === 0} onclick={() => moveMatch(-1)}>Previous match</button><button class="ui-button" disabled={matchIndex >= matches.length - 1} onclick={() => moveMatch(1)}>Next match</button><button class="ui-button" onclick={() => matchingStep = null}>Clear</button></div>{/if}
|
|
274
304
|
<div class="experience-grid">
|
|
275
305
|
<div class="desktop-turn-rail">
|
|
276
306
|
<ChronicleTurnRail
|
|
@@ -335,7 +365,16 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
335
365
|
<div class="refresh-banner">{error} — showing the last process state we loaded.</div>
|
|
336
366
|
{/if}
|
|
337
367
|
|
|
338
|
-
{#if
|
|
368
|
+
{#if detail.timeline.history?.beforeTurnRecordId}
|
|
369
|
+
<div class="history-loader">
|
|
370
|
+
<button class="secondary-button" disabled={$historyState.loading} onclick={() => void loadEarlierProcessHistory()}>
|
|
371
|
+
{$historyState.loading ? "Loading earlier steps…" : "Load earlier steps"}
|
|
372
|
+
</button>
|
|
373
|
+
{#if $historyState.error}<p role="alert">{$historyState.error}. Try again.</p>{/if}
|
|
374
|
+
</div>
|
|
375
|
+
{/if}
|
|
376
|
+
|
|
377
|
+
{#if projection.timelineItems.length === 0 && startup.attempts.length === 0 && !startupRecovery && !processError && !selectedTurn?.readiness}
|
|
339
378
|
<div class="empty-state" data-section="chronicle-empty-state">
|
|
340
379
|
<p>
|
|
341
380
|
This process has not recorded activity yet. As the worker plans, acts, and saves results, the timeline will fill in here.
|
|
@@ -466,7 +505,7 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
466
505
|
<circle cx="12" cy="12" r="9"></circle>
|
|
467
506
|
<path d="M12 11v6M12 7.5h.01"></path>
|
|
468
507
|
</svg>
|
|
469
|
-
|
|
508
|
+
Inspect process
|
|
470
509
|
</button>
|
|
471
510
|
<ProcessActionsMenu
|
|
472
511
|
{instanceId}
|
|
@@ -483,6 +522,11 @@ function handleWindowKeydown(event: KeyboardEvent) {
|
|
|
483
522
|
</ModalShell>
|
|
484
523
|
|
|
485
524
|
<style>
|
|
525
|
+
.history-loader { padding: var(--space-3, 12px) 0; text-align: center; }
|
|
526
|
+
.history-loader button { min-height: 44px; padding: 0 16px; }
|
|
527
|
+
.history-loader p { color: var(--text-danger, #a83a32); }
|
|
528
|
+
|
|
529
|
+
.match-navigation {display:flex; gap:var(--space-sm); align-items:center; flex-wrap:wrap; font-size:var(--type-body-sm); padding:var(--space-sm); background:var(--chronicle-panel-muted); border-radius:var(--radius-sm);}
|
|
486
530
|
.ticket-selection-action {
|
|
487
531
|
min-height: 44px;
|
|
488
532
|
padding: 0 var(--space-md);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import { asUnknownRecord, type ProcessLifecycleStatus } from "@leitwerk-dev/domain";
|
|
3
3
|
import ExternalLink from "../../components/ExternalLink.svelte";
|
|
4
4
|
import PageHeader from "../../components/PageHeader.svelte";
|
|
5
5
|
import ProcessActionsMenu from "../../components/ProcessActionsMenu.svelte";
|
|
6
6
|
import type { ProcessDetailData } from "../../lib/api.js";
|
|
7
7
|
import { formatDefinition, formatStatus } from "../../lib/format.js";
|
|
8
|
+
import { followLink } from "../../lib/router.svelte.js";
|
|
8
9
|
|
|
9
10
|
interface Props {
|
|
10
11
|
instanceId: string;
|
|
@@ -47,6 +48,8 @@ const status = $derived.by(() => {
|
|
|
47
48
|
: null;
|
|
48
49
|
});
|
|
49
50
|
|
|
51
|
+
const wikiTopicId = $derived(asUnknownRecord(detail?.process.metadata?.wiki)?.topicId);
|
|
52
|
+
|
|
50
53
|
function processStatusMark(status: ProcessLifecycleStatus): string {
|
|
51
54
|
if (status === "completed") {
|
|
52
55
|
return "✓";
|
|
@@ -78,6 +81,9 @@ function processStatusMark(status: ProcessLifecycleStatus): string {
|
|
|
78
81
|
{/snippet}
|
|
79
82
|
|
|
80
83
|
{#snippet actions()}
|
|
84
|
+
{#if typeof wikiTopicId === "string"}
|
|
85
|
+
<a class="ui-button" href={`/wiki/${encodeURIComponent(wikiTopicId)}`} onclick={(event) => followLink(event, `/wiki/${encodeURIComponent(wikiTopicId)}`)}>Solution wiki</a>
|
|
86
|
+
{/if}
|
|
81
87
|
{#if status}
|
|
82
88
|
<span
|
|
83
89
|
class="process-header-status"
|
|
@@ -102,10 +108,10 @@ function processStatusMark(status: ProcessLifecycleStatus): string {
|
|
|
102
108
|
data-pressable="true"
|
|
103
109
|
onclick={onToggleProcessInfo}
|
|
104
110
|
aria-expanded={isProcessInfoOpen}
|
|
105
|
-
aria-controls="
|
|
111
|
+
aria-controls="inspector-heading"
|
|
106
112
|
disabled={!detail}
|
|
107
113
|
>
|
|
108
|
-
|
|
114
|
+
Inspect process
|
|
109
115
|
</button>
|
|
110
116
|
<ProcessActionsMenu
|
|
111
117
|
{instanceId}
|