Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 5 additions & 147 deletions crates/toolpath-desktop/frontend/bun.lock

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions crates/toolpath-desktop/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
"@tauri-apps/plugin-opener": "^2.5.3"
},
"devDependencies": {
"@dagrejs/dagre": "^1.1.4",
"@sveltejs/vite-plugin-svelte": "^5",
"@tsconfig/svelte": "^5",
"@types/d3": "^7",
"d3": "^7",
"dagre-d3-es": "^7",
"svelte": "^5",
"svelte-check": "^4",
"typescript": "^5",
Expand Down
2 changes: 1 addition & 1 deletion crates/toolpath-desktop/frontend/src/app.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</nav>
</header>

<main class="screen">
<main class={"screen" + (store.m.route === "preview" ? " screen--wide" : "")}>
{#if store.m.error}
<div class="error">
{store.m.error}
Expand Down
6 changes: 4 additions & 2 deletions crates/toolpath-desktop/frontend/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ export interface PreviewSlice {
filename: string;
selectedStep: StepRef | null;
selectedActors: Record<string, ActorDef> | null;
showDead: boolean;
/** HEAD-ancestor node ids whose dead subtrees are expanded. */
expandedBranches: Record<string, true>;
showTs: boolean;
showFiles: boolean;
vizEpoch: number;
Expand Down Expand Up @@ -232,7 +233,8 @@ export type Msg =
| { t: "DeriveFailed"; error: unknown }

// Preview
| { t: "PreviewToggle"; key: "showDead" | "showTs" | "showFiles" }
| { t: "PreviewToggle"; key: "showTs" | "showFiles" }
| { t: "PreviewToggleBranch"; nodeId: string }
| { t: "PreviewSelectStep"; step: StepRef; actors: Record<string, ActorDef> | null }
| { t: "PreviewExport" }
| { t: "PreviewExportDone" }
Expand Down
16 changes: 15 additions & 1 deletion crates/toolpath-desktop/frontend/src/lib/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export function update(msg: Msg, m: Model): [Model, Cmd | null] {
filename: msg.filename,
selectedStep: null,
selectedActors: null,
showDead: true,
expandedBranches: {},
showTs: false,
showFiles: false,
vizEpoch: 0,
Expand Down Expand Up @@ -474,6 +474,20 @@ export function update(msg: Msg, m: Model): [Model, Cmd | null] {
null,
];
}
case "PreviewToggleBranch": {
if (!m.preview) return [m, null];
const cur = m.preview.expandedBranches;
const next = { ...cur };
if (next[msg.nodeId]) delete next[msg.nodeId];
else next[msg.nodeId] = true;
return [
{
...m,
preview: { ...m.preview, expandedBranches: next, vizEpoch: m.preview.vizEpoch + 1 },
},
null,
];
}
case "PreviewSelectStep":
if (!m.preview) return [m, null];
return [
Expand Down
Loading
Loading