From 49ff819cb584caa36cf2988a867bd0f5e2d210c7 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 28 Mar 2026 20:35:26 +0200 Subject: [PATCH] fixed app stuff in frontend --- apps/frontend/src/routes/session/+page.svelte | 18 +++++++++++------- .../domains/device/device-details.vm.svelte.ts | 11 ++++++++++- memory.log.md | 9 +++++++++ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/apps/frontend/src/routes/session/+page.svelte b/apps/frontend/src/routes/session/+page.svelte index b266682..25ca781 100644 --- a/apps/frontend/src/routes/session/+page.svelte +++ b/apps/frontend/src/routes/session/+page.svelte @@ -120,9 +120,9 @@ }); -
+
{#if state === "loading"} -
+
@@ -133,16 +133,20 @@
{:else} -
-
-

{statusText}

+
+
+
+ {statusText} +
-
+
{#if streamUrl} diff --git a/apps/main/src/lib/domains/device/device-details.vm.svelte.ts b/apps/main/src/lib/domains/device/device-details.vm.svelte.ts index 4b8d20f..8b16656 100644 --- a/apps/main/src/lib/domains/device/device-details.vm.svelte.ts +++ b/apps/main/src/lib/domains/device/device-details.vm.svelte.ts @@ -39,6 +39,7 @@ class DeviceDetailsViewModel { device = $state(null); loading = $state(false); currentId = $state(null); + private _deviceQuery: ReturnType | null = null; get streamUrl(): string | null { if (!this.device) return null; @@ -50,7 +51,15 @@ class DeviceDetailsViewModel { this.currentId = id; try { - const result = await getDeviceByIdSQ({ id }); + const query = getDeviceByIdSQ({ id }); + + if (query.ready) { + await query.refresh(); + } + + const result = query.ready ? query.current : await query; + this._deviceQuery = query; + if (result?.error || !result?.data) { this.device = null; toast.error(result?.error?.message || "Failed to fetch device", { diff --git a/memory.log.md b/memory.log.md index 2a9045c..c92dba4 100644 --- a/memory.log.md +++ b/memory.log.md @@ -107,3 +107,12 @@ Update rule: - Updated Android launch flow in orchestrator to resolve launcher activity via `cmd package resolve-activity` and launch with `am start -n `. - Kept `monkey` as fallback only when launcher activity cannot be resolved, reducing redroid/device-specific `monkey` failures during session prepare. + +### 16 — Fixed Device Detail Page Stale Revert After Update + +- Root cause: the dashboard device detail VM reused SvelteKit's cached `getDeviceByIdSQ()` query without refreshing it, so after saving edits the page reloaded stale device data and overwrote the form with old values. +- Fix: in `device-details.vm.svelte.ts`, refresh the cached query before reading `query.current`, matching the earlier remote-query cache fix pattern used for links. + +### 17 — Frontend Session Viewport Rendering Fix + +- Updated `/session` layout to a full `100dvh` stream container, removed reserved top bar space, and moved status text into an overlay so the embedded stream gets maximum visible height on mobile.