summaryrefslogtreecommitdiffhomepage
path: root/src/features/heartbeat
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-27 20:20:02 +0900
committerAdam Malczewski <[email protected]>2026-06-27 20:20:02 +0900
commitc73bac67d85531a999eea5707fa6e4556f057659 (patch)
tree8aa5e23abf035efce87fb91581bad95d98f7ef8c /src/features/heartbeat
parenta842c9178190daa6f942e33bde60e0d6bf026792 (diff)
downloaddispatch-web-c73bac67d85531a999eea5707fa6e4556f057659.tar.gz
dispatch-web-c73bac67d85531a999eea5707fa6e4556f057659.zip
feat(vision): resolve persisted image URLs against the API base
Images are now stored on disk under tmp (not SQLite) and served via GET /images/:conversationId/:imageId. Persisted ImageChunk.url is a compact relative HTTP path (/images/<conv>/<uuid>.png) instead of a base64 data URL. No wire/transport-contract type change (behavior only) — re-mirrored the delta notes. - New pure resolveImageUrl(url, apiBase) helper (core/chunks/image-url.ts, +8 tests): data/absolute URLs pass through; relative paths are prepended with the API base (no double slash; empty base -> root-relative). Exported from core/chunks + re-exported from features/chat. - ChatView: new apiBaseUrl prop; <img src> uses resolveImageUrl. The optimistic echo's data URL passes through; persisted relative paths resolve against the base. +3 tests. - AppStore exposes httpBase (getter); App.svelte passes apiBaseUrl into ChatView and the heartbeat RunModal (also renders image chunks). Verification: svelte-check 0/0; vitest 959/959 (run twice, +11); biome clean; vite build OK. See backend-handoff.md §2j-update-2. Not merged or pushed.
Diffstat (limited to 'src/features/heartbeat')
-rw-r--r--src/features/heartbeat/ui/RunModal.svelte7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/features/heartbeat/ui/RunModal.svelte b/src/features/heartbeat/ui/RunModal.svelte
index a4ed356..92068ae 100644
--- a/src/features/heartbeat/ui/RunModal.svelte
+++ b/src/features/heartbeat/ui/RunModal.svelte
@@ -11,6 +11,7 @@
closeChat,
stopRun,
onClose,
+ apiBaseUrl = "",
}: {
/** The run to display (its conversation's chat is shown live). */
run: HeartbeatRunView;
@@ -26,6 +27,11 @@
/** Stop the heartbeat run (`POST .../runs/:runId/stop`). */
stopRun: StopHeartbeatRun;
onClose: () => void;
+ /**
+ * The HTTP API base URL, to resolve persisted image chunk URLs
+ * (`/images/…`) in the run's transcript. Defaults to "" (root-relative).
+ */
+ apiBaseUrl?: string;
} = $props();
// Open the live watch ONCE on mount (the modal is keyed per run.id, so a run
@@ -153,6 +159,7 @@
onShowEarlier={chat.showEarlier}
thinkingKeyBase={chat.thinkingKeyBase}
providerRetry={chat.providerRetry}
+ apiBaseUrl={apiBaseUrl}
/>
{/if}
</div>