fixed app stuff in frontend

This commit is contained in:
user
2026-03-28 20:35:26 +02:00
parent 7c210ffe8f
commit 49ff819cb5
3 changed files with 30 additions and 8 deletions

View File

@@ -120,9 +120,9 @@
}); });
</script> </script>
<main class="bg-background text-foreground min-h-screen"> <main class="bg-background text-foreground min-h-dvh">
{#if state === "loading"} {#if state === "loading"}
<section class="flex min-h-screen items-center justify-center px-6"> <section class="flex min-h-dvh items-center justify-center px-6">
<div <div
class="w-full max-w-sm rounded-xl border border-border bg-card p-6 text-center" class="w-full max-w-sm rounded-xl border border-border bg-card p-6 text-center"
> >
@@ -133,16 +133,20 @@
</div> </div>
</section> </section>
{:else} {:else}
<section class="flex min-h-screen flex-col"> <section class="bg-black relative h-dvh min-h-dvh overflow-hidden">
<div class="flex items-center justify-center border-b border-border px-3 py-2"> <div
<p class="text-xs text-muted-foreground">{statusText}</p> class="pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center px-3 pt-2"
>
<div class="rounded-full bg-black/55 px-3 py-1 text-xs text-white/90">
{statusText}
</div>
</div> </div>
<div class="bg-black flex-1"> <div class="h-full w-full">
{#if streamUrl} {#if streamUrl}
<iframe <iframe
src={streamUrl} src={streamUrl}
title="Android session" title="Android session"
class="h-full w-full border-0" class="block h-full w-full border-0 bg-black"
allow="autoplay; fullscreen" allow="autoplay; fullscreen"
referrerpolicy="no-referrer" referrerpolicy="no-referrer"
></iframe> ></iframe>

View File

@@ -39,6 +39,7 @@ class DeviceDetailsViewModel {
device = $state<DeviceForUI | null>(null); device = $state<DeviceForUI | null>(null);
loading = $state(false); loading = $state(false);
currentId = $state<number | null>(null); currentId = $state<number | null>(null);
private _deviceQuery: ReturnType<typeof getDeviceByIdSQ> | null = null;
get streamUrl(): string | null { get streamUrl(): string | null {
if (!this.device) return null; if (!this.device) return null;
@@ -50,7 +51,15 @@ class DeviceDetailsViewModel {
this.currentId = id; this.currentId = id;
try { 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) { if (result?.error || !result?.data) {
this.device = null; this.device = null;
toast.error(result?.error?.message || "Failed to fetch device", { toast.error(result?.error?.message || "Failed to fetch device", {

View File

@@ -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 <activity>`. - Updated Android launch flow in orchestrator to resolve launcher activity via `cmd package resolve-activity` and launch with `am start -n <activity>`.
- Kept `monkey` as fallback only when launcher activity cannot be resolved, reducing redroid/device-specific `monkey` failures during session prepare. - 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.