@leitwerk-dev/ui 0.3.1 → 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.
- package/dist/assets/ApiTokensPage-DCmYvZdE.js +1 -0
- package/dist/assets/ChronicleMarkdown-CDe1jngc.js +1 -0
- package/dist/assets/DashboardPage-BRxe3uuy.css +1 -0
- package/dist/assets/DashboardPage-LiQ0_72g.js +1 -0
- package/dist/assets/FutureLaunchDetailPage-DvyW_J5d.js +1 -0
- package/dist/assets/GenericLauncher-D1qQy9hq.js +4 -0
- package/dist/assets/GenericLauncher-DRUMMTd7.css +1 -0
- package/dist/assets/HomePage-Cnmp6osB.js +1 -0
- package/dist/assets/ProcessActionsMenu-DEQynjFa.js +1 -0
- package/dist/assets/ProcessDetailPage-DvjQQTDj.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-B4BMXJT7.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-w1RHZ2l6.js +2 -0
- package/dist/assets/SkillsPage-Ber36rAD.js +2 -0
- package/dist/assets/WatchersPage-Btq_SIk3.js +1 -0
- package/dist/assets/WikiPage-BjncVYf1.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-BUgTIHYG.js +1 -0
- package/dist/assets/index-Dz0T5gKc.js +21 -0
- package/dist/assets/index-DzKWCM-z.css +1 -0
- package/dist/assets/{index-client-BYQviCtQ.js → index-client-BSAA7n1a.js} +2 -2
- 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 +22 -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 +438 -259
- package/src/components/NamedSelectionList.svelte +77 -0
- package/src/components/ProcessActionsMenu.svelte +37 -59
- 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 +100 -43
- package/src/lib/dashboard-refresh.ts +47 -0
- 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 +127 -56
- package/src/lib/router.svelte.ts +10 -6
- package/src/lib/settings.ts +114 -0
- package/src/lib/wiki.ts +34 -0
- package/src/pages/DashboardPage.svelte +194 -0
- package/src/pages/FutureLaunchDetailPage.svelte +2 -2
- package/src/pages/HomePage.svelte +4 -4
- 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 +55 -56
- package/src/shell/Sidebar.svelte +136 -232
- package/src/test-support/mount.ts +34 -0
- package/src/test-support/wait.ts +19 -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
|
@@ -32,6 +32,7 @@ export interface ChronicleSelectablePromptItem extends ChronicleSelectableBaseIt
|
|
|
32
32
|
|
|
33
33
|
export interface ChronicleSelectableTurnItem extends ChronicleSelectableBaseItem {
|
|
34
34
|
kind: "turn";
|
|
35
|
+
recoveryAnchorId?: string;
|
|
35
36
|
turnId: string;
|
|
36
37
|
turnRecordId: string;
|
|
37
38
|
status: "completed" | "in_progress" | "waiting";
|
|
@@ -207,7 +208,20 @@ export function buildChronicleSelectableItems(
|
|
|
207
208
|
latestTurn?.status === "completed"
|
|
208
209
|
? latestTurn
|
|
209
210
|
: undefined;
|
|
210
|
-
|
|
211
|
+
const recoveryTurn =
|
|
212
|
+
input.pendingRailItem?.tone === "error_recovery"
|
|
213
|
+
? items.find(
|
|
214
|
+
(item): item is ChronicleSelectableTurnItem =>
|
|
215
|
+
item.kind === "turn" &&
|
|
216
|
+
item.turnRecordId === input.pendingRailItem?.relatedTurnRecordId &&
|
|
217
|
+
item.shape === "square",
|
|
218
|
+
)
|
|
219
|
+
: undefined;
|
|
220
|
+
if (recoveryTurn) {
|
|
221
|
+
recoveryTurn.detail = input.pendingRailItem?.detail ?? null;
|
|
222
|
+
recoveryTurn.recoveryAnchorId =
|
|
223
|
+
input.pendingRailItem?.anchorId ?? CHRONICLE_ACTION_SECTION_ANCHOR_ID;
|
|
224
|
+
} else if (waitingTurn) {
|
|
211
225
|
waitingTurn.status = "waiting";
|
|
212
226
|
waitingTurn.detail = "Waiting for an event";
|
|
213
227
|
waitingTurn.anchorId = input.pendingRailItem?.anchorId ?? CHRONICLE_ACTION_SECTION_ANCHOR_ID;
|
|
@@ -243,7 +257,12 @@ export function findChronicleSelectableItem(
|
|
|
243
257
|
if (!anchorId) {
|
|
244
258
|
return null;
|
|
245
259
|
}
|
|
246
|
-
return
|
|
260
|
+
return (
|
|
261
|
+
items.find(
|
|
262
|
+
(item) =>
|
|
263
|
+
item.anchorId === anchorId || (item.kind === "turn" && item.recoveryAnchorId === anchorId),
|
|
264
|
+
) ?? null
|
|
265
|
+
);
|
|
247
266
|
}
|
|
248
267
|
|
|
249
268
|
export function moveChronicleAnchorByOffset(
|
|
@@ -254,7 +273,8 @@ export function moveChronicleAnchorByOffset(
|
|
|
254
273
|
if (items.length === 0) {
|
|
255
274
|
return null;
|
|
256
275
|
}
|
|
257
|
-
const
|
|
276
|
+
const currentItem = findChronicleSelectableItem(items, currentAnchorId);
|
|
277
|
+
const currentIndex = currentItem ? items.indexOf(currentItem) : -1;
|
|
258
278
|
const safeCurrentIndex = currentIndex >= 0 ? currentIndex : items.length - 1;
|
|
259
279
|
const nextIndex = Math.max(0, Math.min(safeCurrentIndex + offset, items.length - 1));
|
|
260
280
|
return items[nextIndex]?.anchorId ?? null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ModelProfileOptionSummary } from "@leitwerk-dev/protocol";
|
|
2
|
+
|
|
3
|
+
/** @internal */
|
|
4
|
+
export function recoveryModelSelection(
|
|
5
|
+
profiles: readonly ModelProfileOptionSummary[],
|
|
6
|
+
draft: string | null | undefined,
|
|
7
|
+
current: string | null,
|
|
8
|
+
inherited: string | null,
|
|
9
|
+
) {
|
|
10
|
+
const profileId = draft === null ? inherited : (draft ?? current);
|
|
11
|
+
const profile = profiles.find((candidate) => candidate.id === profileId) ?? null;
|
|
12
|
+
return {
|
|
13
|
+
profileId,
|
|
14
|
+
profile,
|
|
15
|
+
usable: profile?.availability === undefined || profile.availability === "available",
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -4,7 +4,8 @@ let nextTreeDiagramId = 0;
|
|
|
4
4
|
|
|
5
5
|
<script lang="ts">
|
|
6
6
|
import type { ProcessInstanceTreeResponseBody } from "@leitwerk-dev/protocol/http-contracts";
|
|
7
|
-
import
|
|
7
|
+
import { edgePath } from "@leitwerk-dev/workflow-graph";
|
|
8
|
+
import { tick } from "svelte";
|
|
8
9
|
import {
|
|
9
10
|
INSTANCE_TREE_COLUMN_GAP,
|
|
10
11
|
layoutInstanceTree,
|
|
@@ -12,33 +13,67 @@ import {
|
|
|
12
13
|
} from "../lib/instance-tree-layout";
|
|
13
14
|
|
|
14
15
|
interface Props {
|
|
16
|
+
onReady?: () => boolean | void;
|
|
17
|
+
onSelectExecution?: (turnRecordId: string) => void;
|
|
18
|
+
selectedTurnRecordId?: string;
|
|
15
19
|
tree: ProcessInstanceTreeResponseBody;
|
|
16
|
-
railItems: readonly ChronicleSelectableItem[];
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
let { tree,
|
|
20
|
-
const railByRecord = $derived(
|
|
21
|
-
new Map(
|
|
22
|
-
railItems
|
|
23
|
-
.filter((item) => item.kind === "turn")
|
|
24
|
-
.map((item) => [item.turnRecordId, item]),
|
|
25
|
-
),
|
|
26
|
-
);
|
|
22
|
+
let { tree, onSelectExecution, selectedTurnRecordId, onReady }: Props = $props();
|
|
27
23
|
const markerId = `tree-arrow-${nextTreeDiagramId++}`;
|
|
28
24
|
const layout = $derived(layoutInstanceTree(tree.nodes, tree.currentLeafId, tree.edges));
|
|
29
25
|
const laneStarts = $derived(layout?.nodes.filter((node) => node.startsLane) ?? []);
|
|
30
26
|
const branchPoints = $derived(
|
|
31
27
|
layout?.nodes.filter((node) => node.childCount > 1).length ?? 0,
|
|
32
28
|
);
|
|
29
|
+
let viewport = $state<HTMLDivElement>();
|
|
30
|
+
let zoom = $state(1);
|
|
31
|
+
const selectedNode = $derived(layout?.nodes.find((node) => node.id === selectedTurnRecordId));
|
|
32
|
+
|
|
33
|
+
function showSelected() {
|
|
34
|
+
if (!viewport || !selectedNode) return;
|
|
35
|
+
viewport.scrollTo({
|
|
36
|
+
left: (selectedNode.x + selectedNode.width / 2) * zoom <= viewport.clientWidth
|
|
37
|
+
? 0 : selectedNode.x * zoom - viewport.clientWidth / 2,
|
|
38
|
+
top: selectedNode.y * zoom - viewport.clientHeight / 2,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
$effect(() => {
|
|
43
|
+
const container = viewport;
|
|
44
|
+
const selected = selectedTurnRecordId;
|
|
45
|
+
if (!container) return;
|
|
46
|
+
let cancelled = false;
|
|
47
|
+
void tick().then(() => {
|
|
48
|
+
if (cancelled || onReady?.()) return;
|
|
49
|
+
if (selected) showSelected();
|
|
50
|
+
});
|
|
51
|
+
return () => { cancelled = true; };
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
async function setZoom(next: number) {
|
|
55
|
+
if (!viewport) return;
|
|
56
|
+
const x = (viewport.scrollLeft + viewport.clientWidth / 2) / zoom;
|
|
57
|
+
const y = (viewport.scrollTop + viewport.clientHeight / 2) / zoom;
|
|
58
|
+
zoom = Math.max(0.05, Math.min(2, next));
|
|
59
|
+
await tick();
|
|
60
|
+
viewport.scrollTo({left: x * zoom - viewport.clientWidth / 2, top: y * zoom - viewport.clientHeight / 2});
|
|
61
|
+
}
|
|
33
62
|
|
|
34
|
-
function
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
async function fitMap() {
|
|
64
|
+
if (!viewport || !layout) return;
|
|
65
|
+
await setZoom(Math.min(1, (viewport.clientWidth - 16) / layout.width, (viewport.clientHeight - 16) / layout.height));
|
|
66
|
+
viewport.scrollTo({left:0, top:0});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function revealSelected() {
|
|
70
|
+
zoom = 1;
|
|
71
|
+
await tick();
|
|
72
|
+
showSelected();
|
|
38
73
|
}
|
|
39
74
|
|
|
40
75
|
function marker(node: NonNullable<typeof layout>["nodes"][number]): string {
|
|
41
|
-
const parts = [
|
|
76
|
+
const parts = [node.label];
|
|
42
77
|
if (node.contextOrigin === "fresh") parts.push("fresh context");
|
|
43
78
|
if (node.contextOrigin === "previous") parts.push("branch with previous context");
|
|
44
79
|
if (node.childCount > 1) parts.push("branch point");
|
|
@@ -96,16 +131,26 @@ const accessibleDescription = $derived.by(() => {
|
|
|
96
131
|
</script>
|
|
97
132
|
|
|
98
133
|
{#if layout}
|
|
134
|
+
<div class="conversation-tree">
|
|
135
|
+
<div class="tree-toolbar">
|
|
99
136
|
<p class="summary-detail">
|
|
100
|
-
{layout.nodes.length}
|
|
137
|
+
{layout.nodes.length} executions · {layout.laneCount} contexts · {branchPoints} branch
|
|
101
138
|
{branchPoints === 1 ? "point" : "points"}
|
|
102
139
|
</p>
|
|
103
|
-
<div class="tree-
|
|
140
|
+
<div class="tree-controls" role="group" aria-label="Map navigation">
|
|
141
|
+
<button class="ui-button" aria-label="Zoom out" disabled={zoom <= 0.05} onclick={() => setZoom(zoom / 1.5)}>−</button>
|
|
142
|
+
<output aria-label="Map zoom">{Math.round(zoom * 100)}%</output>
|
|
143
|
+
<button class="ui-button" aria-label="Zoom in" disabled={zoom >= 2} onclick={() => setZoom(zoom * 1.5)}>+</button>
|
|
144
|
+
<button class="ui-button" onclick={fitMap}>Fit map</button>
|
|
145
|
+
{#if selectedNode}<button class="ui-button" onclick={revealSelected}>Show selected</button>{/if}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="tree-viewport" bind:this={viewport} data-reading-scroll="context-map" data-section="conversation-tree-diagram" role="region" aria-label="Conversation map" tabindex="0">
|
|
104
149
|
<svg
|
|
105
|
-
width={layout.width}
|
|
106
|
-
height={layout.height}
|
|
150
|
+
width={layout.width * zoom}
|
|
151
|
+
height={layout.height * zoom}
|
|
107
152
|
viewBox={`0 0 ${layout.width} ${layout.height}`}
|
|
108
|
-
role="
|
|
153
|
+
role="group"
|
|
109
154
|
aria-labelledby={`${markerId}-title ${markerId}-description`}
|
|
110
155
|
>
|
|
111
156
|
<title id={`${markerId}-title`}>Conversation input lineage</title>
|
|
@@ -139,32 +184,39 @@ const accessibleDescription = $derived.by(() => {
|
|
|
139
184
|
<g class="lane-label" transform={`translate(16 ${node.y - 13})`}>
|
|
140
185
|
<text class="lane-number" y="0">Context {index + 1}</text>
|
|
141
186
|
<text class:previous={node.contextOrigin === "previous"} y="20">
|
|
142
|
-
{node.contextOrigin === "previous" ? "
|
|
187
|
+
{node.contextOrigin === "previous" ? "Inherited context" : node.contextOrigin === "fresh" ? "No inheritance" : node.contextOrigin === "not_applicable" ? "No model context" : "Origin unknown"}
|
|
143
188
|
</text>
|
|
144
189
|
</g>
|
|
145
190
|
{/each}
|
|
146
191
|
|
|
147
192
|
{#each layout.nodes as node (node.id)}
|
|
148
|
-
{@const rail = railByRecord.get(node.id)}
|
|
149
193
|
<g
|
|
150
194
|
class="tree-node"
|
|
195
|
+
role={onSelectExecution ? "button" : undefined}
|
|
196
|
+
tabindex={onSelectExecution ? 0 : undefined}
|
|
197
|
+
aria-label={marker(node)}
|
|
198
|
+
aria-pressed={onSelectExecution ? node.id === selectedTurnRecordId : undefined}
|
|
199
|
+
class:selected={node.id === selectedTurnRecordId}
|
|
200
|
+
onclick={() => onSelectExecution?.(node.id)}
|
|
201
|
+
onkeydown={(event) => {if (event.key === "Enter" || event.key === " ") {event.preventDefault(); onSelectExecution?.(node.id);}}}
|
|
151
202
|
class:branch={node.childCount > 1}
|
|
152
203
|
class:current={node.isCurrent}
|
|
153
204
|
class:failed={node.resultState === "failed"}
|
|
154
205
|
transform={`translate(${node.x - node.width / 2} ${node.y - node.height / 2})`}
|
|
155
206
|
data-tree-node="turn"
|
|
156
207
|
data-context-origin={node.contextOrigin}
|
|
157
|
-
data-rail-tone={rail?.tone}
|
|
158
208
|
>
|
|
159
209
|
<title>{marker(node)}</title>
|
|
160
210
|
<rect width={node.width} height={node.height} rx="9" />
|
|
161
|
-
<text class="node-title" x={node.width / 2} y=
|
|
162
|
-
{
|
|
211
|
+
<text class="node-title" x={node.width / 2} y={node.height / 2 + 4} text-anchor="middle">
|
|
212
|
+
{node.label}
|
|
163
213
|
</text>
|
|
164
214
|
{#if node.childCount > 1}
|
|
165
215
|
<text class="badge branch-badge" x={node.width - 58} y="-8">Branch</text>
|
|
166
216
|
{/if}
|
|
167
|
-
{#if node.
|
|
217
|
+
{#if node.id === selectedTurnRecordId}
|
|
218
|
+
<text class="badge selected-badge" x={node.width / 2} y={node.height + 17} text-anchor="middle">Selected{node.isCurrent ? " · Current" : node.resultState === "failed" ? " · Failed" : ""}</text>
|
|
219
|
+
{:else if node.isCurrent}
|
|
168
220
|
<text class="badge current-badge" x={node.width - 62} y={node.height + 17}>Current</text>
|
|
169
221
|
{:else if node.resultState === "failed"}
|
|
170
222
|
<text class="badge failed-badge" x={node.width - 52} y={node.height + 17}>Failed</text>
|
|
@@ -179,7 +231,7 @@ const accessibleDescription = $derived.by(() => {
|
|
|
179
231
|
class:decision={!edge.hasContext && !edge.productLabels.length}
|
|
180
232
|
class:dead-end={edge.endState === "not_applied"}
|
|
181
233
|
class:completed-end={edge.endState === "completed"}
|
|
182
|
-
d={
|
|
234
|
+
d={edgePath(edge.points)}
|
|
183
235
|
marker-end={edge.endState
|
|
184
236
|
? undefined
|
|
185
237
|
: `url(#${markerId}-${edge.productLabels.length ? "product" : "context"})`}
|
|
@@ -221,9 +273,17 @@ const accessibleDescription = $derived.by(() => {
|
|
|
221
273
|
{/each}
|
|
222
274
|
</svg>
|
|
223
275
|
</div>
|
|
276
|
+
</div>
|
|
224
277
|
{/if}
|
|
225
278
|
|
|
226
279
|
<style>
|
|
280
|
+
.tree-node[role="button"] {cursor:pointer;} .tree-node[role="button"]:focus {outline:none;} .tree-node[role="button"]:focus-visible rect, .tree-node.selected rect {stroke:var(--chronicle-accent); stroke-width:3;}
|
|
281
|
+
.conversation-tree {display:flex; flex-direction:column; flex:1; min-height:0; gap:var(--space-xs);}
|
|
282
|
+
.tree-toolbar {display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:var(--space-xs) var(--space-md);}
|
|
283
|
+
.tree-controls {display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-2xs);}
|
|
284
|
+
.tree-controls output {min-width:3rem; text-align:center; font-size:var(--type-caption); font-variant-numeric:tabular-nums;}
|
|
285
|
+
.tree-controls .ui-button {padding-inline:var(--space-xs);}
|
|
286
|
+
.tree-controls [aria-label="Zoom in"],.tree-controls [aria-label="Zoom out"] {min-width:44px; font-size:var(--type-title-sm);}
|
|
227
287
|
.summary-detail {
|
|
228
288
|
margin: 0;
|
|
229
289
|
color: var(--chronicle-text-muted);
|
|
@@ -233,9 +293,10 @@ const accessibleDescription = $derived.by(() => {
|
|
|
233
293
|
}
|
|
234
294
|
|
|
235
295
|
.tree-viewport {
|
|
296
|
+
flex: 1;
|
|
236
297
|
overflow: auto;
|
|
237
|
-
|
|
238
|
-
|
|
298
|
+
min-height: 160px;
|
|
299
|
+
overscroll-behavior: contain;
|
|
239
300
|
border: 1px solid var(--chronicle-border);
|
|
240
301
|
border-radius: var(--radius-md);
|
|
241
302
|
background: color-mix(in srgb, var(--chronicle-panel-muted) 45%, white);
|
|
@@ -243,8 +304,8 @@ const accessibleDescription = $derived.by(() => {
|
|
|
243
304
|
|
|
244
305
|
svg {
|
|
245
306
|
display: block;
|
|
246
|
-
min-width: 100%;
|
|
247
307
|
}
|
|
308
|
+
.tree-viewport:focus-visible {outline:2px solid var(--chronicle-accent); outline-offset:2px;}
|
|
248
309
|
|
|
249
310
|
.edge {
|
|
250
311
|
fill: none;
|
|
@@ -357,6 +418,7 @@ const accessibleDescription = $derived.by(() => {
|
|
|
357
418
|
stroke: var(--chronicle-danger);
|
|
358
419
|
stroke-width: 2;
|
|
359
420
|
}
|
|
421
|
+
.tree-node.selected rect {stroke:var(--chronicle-accent); stroke-width:3;}
|
|
360
422
|
|
|
361
423
|
.badge {
|
|
362
424
|
font-size: var(--type-label);
|
|
@@ -374,6 +436,7 @@ const accessibleDescription = $derived.by(() => {
|
|
|
374
436
|
.failed-badge {
|
|
375
437
|
fill: var(--chronicle-danger) !important;
|
|
376
438
|
}
|
|
439
|
+
.selected-badge {fill:var(--chronicle-accent) !important;}
|
|
377
440
|
|
|
378
441
|
.lane-label text {
|
|
379
442
|
fill: var(--chronicle-text-muted);
|
|
@@ -18,6 +18,7 @@ interface Props {
|
|
|
18
18
|
marker?: FieldMarker;
|
|
19
19
|
textareaRows?: number;
|
|
20
20
|
options?: readonly FormFieldOptionDefinition[];
|
|
21
|
+
optionDetails?: Readonly<Record<string, string>>;
|
|
21
22
|
selectedOptionDescription?: string | null;
|
|
22
23
|
selectedOptionDescriptionId?: string;
|
|
23
24
|
recentValues?: readonly string[];
|
|
@@ -38,6 +39,7 @@ let {
|
|
|
38
39
|
marker = "launcher",
|
|
39
40
|
textareaRows = 4,
|
|
40
41
|
options = [],
|
|
42
|
+
optionDetails = undefined,
|
|
41
43
|
selectedOptionDescription = null,
|
|
42
44
|
selectedOptionDescriptionId = undefined,
|
|
43
45
|
recentValues = [],
|
|
@@ -51,22 +53,36 @@ const markerAttrs = $derived(
|
|
|
51
53
|
marker === "action" ? { "data-action-form-field": true } : { "data-launcher-form-field": true },
|
|
52
54
|
);
|
|
53
55
|
const invalid = $derived(errors.length > 0);
|
|
56
|
+
const controlAttrs = $derived({
|
|
57
|
+
id,
|
|
58
|
+
...markerAttrs,
|
|
59
|
+
required: field.required ? true : undefined,
|
|
60
|
+
"aria-describedby": describedBy,
|
|
61
|
+
"aria-invalid": invalid,
|
|
62
|
+
"aria-required": field.required ? true : undefined,
|
|
63
|
+
});
|
|
54
64
|
const stringValue = $derived(String(value ?? ""));
|
|
55
65
|
const booleanValue = $derived(value === true);
|
|
66
|
+
let search = $state("");
|
|
67
|
+
const selectedValues = $derived(stringValue.split("\n").filter(Boolean));
|
|
68
|
+
const visibleOptions = $derived(
|
|
69
|
+
field.searchable && search.trim()
|
|
70
|
+
? options.filter((option) =>
|
|
71
|
+
`${option.label} ${option.value}`.toLowerCase().includes(search.trim().toLowerCase()),
|
|
72
|
+
)
|
|
73
|
+
: options,
|
|
74
|
+
);
|
|
56
75
|
</script>
|
|
57
76
|
|
|
58
|
-
<div class="form-field-group" class:
|
|
77
|
+
<div class="form-field-group" class:invalid onfocusout={(event) => {
|
|
78
|
+
if (!event.currentTarget.contains(event.relatedTarget as Node | null) && field.kind !== "text" && field.kind !== "number" && field.kind !== "textarea") onTextBlur?.();
|
|
79
|
+
}} class:multi-select={field.kind === "select" && field.multiple} class:is-split={layout === "split" && field.kind !== "boolean"}>
|
|
59
80
|
{#if field.kind === "boolean"}
|
|
60
81
|
<div class="checkbox-row">
|
|
61
82
|
<input
|
|
62
|
-
|
|
63
|
-
{...markerAttrs}
|
|
83
|
+
{...controlAttrs}
|
|
64
84
|
type="checkbox"
|
|
65
|
-
required={field.required ? true : undefined}
|
|
66
85
|
checked={booleanValue}
|
|
67
|
-
aria-describedby={describedBy}
|
|
68
|
-
aria-invalid={invalid}
|
|
69
|
-
aria-required={field.required ? true : undefined}
|
|
70
86
|
onchange={(event) => onValueChange(field, (event.currentTarget as HTMLInputElement).checked)}
|
|
71
87
|
/>
|
|
72
88
|
<label for={id} class="checkbox-label">
|
|
@@ -76,6 +92,20 @@ const booleanValue = $derived(value === true);
|
|
|
76
92
|
{/if}
|
|
77
93
|
</label>
|
|
78
94
|
</div>
|
|
95
|
+
{:else if field.kind === "select" && field.multiple}
|
|
96
|
+
<div class="multi-select-label">
|
|
97
|
+
<div class="field-label" id={`${id}-label`}>
|
|
98
|
+
{field.label}
|
|
99
|
+
{#if field.required}
|
|
100
|
+
<span class="required-marker" title="This field is required" aria-hidden="true">*</span>
|
|
101
|
+
{:else}
|
|
102
|
+
<span class="optional-marker">Optional</span>
|
|
103
|
+
{/if}
|
|
104
|
+
</div>
|
|
105
|
+
{#if field.description}
|
|
106
|
+
<p class="field-description" id={descriptionId}>{field.description}</p>
|
|
107
|
+
{/if}
|
|
108
|
+
</div>
|
|
79
109
|
{:else}
|
|
80
110
|
<label class="field-label" for={id}>
|
|
81
111
|
{field.label}
|
|
@@ -85,33 +115,47 @@ const booleanValue = $derived(value === true);
|
|
|
85
115
|
</label>
|
|
86
116
|
{/if}
|
|
87
117
|
|
|
88
|
-
{#if field.description}
|
|
118
|
+
{#if field.description && !(field.kind === "select" && field.multiple)}
|
|
89
119
|
<p class="field-description" id={descriptionId}>{field.description}</p>
|
|
90
120
|
{/if}
|
|
91
121
|
|
|
92
122
|
{#if field.kind === "textarea"}
|
|
93
123
|
<textarea
|
|
94
|
-
|
|
95
|
-
{...markerAttrs}
|
|
124
|
+
{...controlAttrs}
|
|
96
125
|
rows={textareaRows}
|
|
97
|
-
required={field.required ? true : undefined}
|
|
98
126
|
value={stringValue}
|
|
99
127
|
placeholder={field.placeholder ?? undefined}
|
|
100
|
-
aria-describedby={describedBy}
|
|
101
|
-
aria-invalid={invalid}
|
|
102
|
-
aria-required={field.required ? true : undefined}
|
|
103
128
|
oninput={(event) => onValueChange(field, (event.currentTarget as HTMLTextAreaElement).value)}
|
|
104
129
|
onblur={onTextBlur}
|
|
105
130
|
></textarea>
|
|
131
|
+
{:else if field.kind === "select" && field.multiple}
|
|
132
|
+
<div class="multi-select-control" id={id} role="group" tabindex="-1" data-invalid={invalid} aria-labelledby={`${id}-label`} aria-describedby={describedBy}>
|
|
133
|
+
{#if field.searchable}
|
|
134
|
+
<p class="selection-count" aria-live="polite">{selectedValues.length} selected</p>
|
|
135
|
+
<div class="selection-search">
|
|
136
|
+
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><circle cx="10.5" cy="10.5" r="6.5"/><path d="m16 16 4.5 4.5"/></svg>
|
|
137
|
+
<input type="search" aria-label={`Search ${field.label.toLowerCase()}`} placeholder={field.placeholder ?? "Search options…"} bind:value={search} />
|
|
138
|
+
</div>
|
|
139
|
+
{/if}
|
|
140
|
+
<div class="selection-options" class:searchable={field.searchable}>
|
|
141
|
+
{#each visibleOptions as option (option.value)}
|
|
142
|
+
<label class="checkbox-row selection-option">
|
|
143
|
+
<input type="checkbox" {...markerAttrs} aria-invalid={invalid} aria-describedby={describedBy} checked={selectedValues.includes(option.value)} onchange={(event) => {
|
|
144
|
+
onValueChange(field, (event.currentTarget.checked ? [...new Set([...selectedValues, option.value])] : selectedValues.filter((value) => value !== option.value)).join("\n"));
|
|
145
|
+
}} />
|
|
146
|
+
<span class="selection-name">{option.label}</span>
|
|
147
|
+
{#if optionDetails?.[option.value]}<span class="selection-detail">{optionDetails[option.value]}</span>{/if}
|
|
148
|
+
</label>
|
|
149
|
+
{:else}
|
|
150
|
+
<p class="selection-empty">{search.trim() ? "No matching options. Try another search." : "No options available."}</p>
|
|
151
|
+
{/each}
|
|
152
|
+
</div>
|
|
153
|
+
{#if field.presetsFrom}<p class="selection-hint">Your manual changes are kept when you change groups.</p>{/if}
|
|
154
|
+
</div>
|
|
106
155
|
{:else if field.kind === "select"}
|
|
107
156
|
<select
|
|
108
|
-
|
|
109
|
-
{...markerAttrs}
|
|
157
|
+
{...controlAttrs}
|
|
110
158
|
value={stringValue}
|
|
111
|
-
required={field.required ? true : undefined}
|
|
112
|
-
aria-describedby={describedBy}
|
|
113
|
-
aria-invalid={invalid}
|
|
114
|
-
aria-required={field.required ? true : undefined}
|
|
115
159
|
onchange={(event) => onValueChange(field, (event.currentTarget as HTMLSelectElement).value)}
|
|
116
160
|
>
|
|
117
161
|
<option value="">Choose an option</option>
|
|
@@ -128,15 +172,10 @@ const booleanValue = $derived(value === true);
|
|
|
128
172
|
<!-- boolean input rendered above -->
|
|
129
173
|
{:else}
|
|
130
174
|
<input
|
|
131
|
-
|
|
132
|
-
{...markerAttrs}
|
|
175
|
+
{...controlAttrs}
|
|
133
176
|
type={field.kind === "number" ? "number" : "text"}
|
|
134
|
-
required={field.required ? true : undefined}
|
|
135
177
|
value={stringValue}
|
|
136
178
|
placeholder={field.placeholder ?? undefined}
|
|
137
|
-
aria-describedby={describedBy}
|
|
138
|
-
aria-invalid={invalid}
|
|
139
|
-
aria-required={field.required ? true : undefined}
|
|
140
179
|
oninput={(event) => onValueChange(field, (event.currentTarget as HTMLInputElement).value)}
|
|
141
180
|
onblur={onTextBlur}
|
|
142
181
|
/>
|
|
@@ -160,7 +199,7 @@ const booleanValue = $derived(value === true);
|
|
|
160
199
|
{/if}
|
|
161
200
|
|
|
162
201
|
{#if errors.length > 0}
|
|
163
|
-
<ul class="field-error-list" id={errorId}
|
|
202
|
+
<ul class="field-error-list" id={errorId} aria-live="polite">
|
|
164
203
|
{#each errors as message (message)}
|
|
165
204
|
<li>{message}</li>
|
|
166
205
|
{/each}
|
|
@@ -169,6 +208,12 @@ const booleanValue = $derived(value === true);
|
|
|
169
208
|
</div>
|
|
170
209
|
|
|
171
210
|
<style>
|
|
211
|
+
.form-field-group.invalid .multi-select-control,
|
|
212
|
+
.form-field-group.invalid > .checkbox-row {
|
|
213
|
+
outline: 1px solid var(--chronicle-danger);
|
|
214
|
+
outline-offset: 3px;
|
|
215
|
+
}
|
|
216
|
+
|
|
172
217
|
.form-field-group {
|
|
173
218
|
display: grid;
|
|
174
219
|
gap: var(--space-xs);
|
|
@@ -203,6 +248,117 @@ const booleanValue = $derived(value === true);
|
|
|
203
248
|
grid-column: 2;
|
|
204
249
|
}
|
|
205
250
|
|
|
251
|
+
.multi-select {
|
|
252
|
+
padding: var(--space-lg) 0;
|
|
253
|
+
border-top: 1px solid var(--chronicle-border);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.form-field-group.is-split .multi-select-control {
|
|
257
|
+
grid-column: 2;
|
|
258
|
+
grid-row: 1;
|
|
259
|
+
}
|
|
260
|
+
.multi-select-label {
|
|
261
|
+
display: grid;
|
|
262
|
+
gap: var(--space-xs);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
.multi-select-control {
|
|
267
|
+
min-width: 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.selection-count {
|
|
271
|
+
margin: 0 0 12px;
|
|
272
|
+
text-align: right;
|
|
273
|
+
color: var(--chronicle-link);
|
|
274
|
+
font-size: 0.875rem;
|
|
275
|
+
font-weight: 620;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.selection-search {
|
|
279
|
+
position: relative;
|
|
280
|
+
margin-bottom: 12px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.selection-search svg {
|
|
284
|
+
position: absolute;
|
|
285
|
+
left: 14px;
|
|
286
|
+
top: 14px;
|
|
287
|
+
width: 18px;
|
|
288
|
+
height: 18px;
|
|
289
|
+
color: var(--chronicle-text-muted);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.form-field-group .selection-search input {
|
|
293
|
+
padding-left: 42px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.selection-options {
|
|
297
|
+
display: flex;
|
|
298
|
+
flex-wrap: wrap;
|
|
299
|
+
gap: 8px 24px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.selection-option {
|
|
303
|
+
min-height: 44px;
|
|
304
|
+
align-items: center;
|
|
305
|
+
cursor: pointer;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.selection-name {
|
|
309
|
+
overflow-wrap: anywhere;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.selection-options.searchable {
|
|
313
|
+
display: block;
|
|
314
|
+
max-height: 400px;
|
|
315
|
+
overflow-y: auto;
|
|
316
|
+
border: 1px solid var(--chronicle-border);
|
|
317
|
+
border-radius: 14px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.searchable .selection-option {
|
|
321
|
+
padding: 12px 14px;
|
|
322
|
+
font-size: 0.875rem;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.searchable .selection-option + .selection-option {
|
|
326
|
+
border-top: 1px solid var(--chronicle-border);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.searchable .selection-option:hover {
|
|
330
|
+
background: var(--chronicle-panel-muted);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.selection-detail {
|
|
334
|
+
margin-left: auto;
|
|
335
|
+
max-width: 40%;
|
|
336
|
+
flex-shrink: 0;
|
|
337
|
+
text-align: right;
|
|
338
|
+
font-size: 0.75rem;
|
|
339
|
+
color: var(--chronicle-text-muted);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.selection-hint, .selection-empty {
|
|
343
|
+
margin: 12px 0 0;
|
|
344
|
+
color: var(--chronicle-text-muted);
|
|
345
|
+
font-size: 0.8125rem;
|
|
346
|
+
line-height: 1.55;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.selection-empty {
|
|
350
|
+
margin: 0;
|
|
351
|
+
padding: 14px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.optional-marker {
|
|
355
|
+
margin-left: 6px;
|
|
356
|
+
color: var(--chronicle-text-muted);
|
|
357
|
+
font-size: 0.75rem;
|
|
358
|
+
font-weight: 400;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
|
|
206
362
|
.field-label,
|
|
207
363
|
.checkbox-label {
|
|
208
364
|
margin: 0;
|
|
@@ -349,6 +505,7 @@ const booleanValue = $derived(value === true);
|
|
|
349
505
|
.form-field-group.is-split textarea,
|
|
350
506
|
.form-field-group.is-split select,
|
|
351
507
|
.form-field-group.is-split .field-option-description,
|
|
508
|
+
.form-field-group.is-split .multi-select-control,
|
|
352
509
|
.form-field-group.is-split .field-recents,
|
|
353
510
|
.form-field-group.is-split .field-error-list {
|
|
354
511
|
grid-column: 1;
|