feat(web): MobileAppDownload component on login + settings (#397 follow-up)

Closes the discoverability gap on the in-app update flow — the
/api/client/apk endpoint exists but had no web UI surface to find
it. User asked to be able to "visit the site on my phone and
download the apk from there."

- web/src/lib/components/MobileAppDownload.svelte — fetches
  /api/client/version once on mount; renders a download link with
  version + size when 200; renders nothing on 404 (no APK bundled,
  graceful degradation in dev environments and pre-CI-wiring images).
- Mounted on the login page (below the Register link) so the link
  is discoverable without authentication. The /api/client/* endpoints
  are themselves unauthed, so the flow works end-to-end for any
  visitor on a phone.
- Also mounted in Settings → Mobile app section for logged-in users
  who want to grab the matching APK for sideloading on a different
  device.

Browser handles the download via the server's existing
Content-Disposition: attachment; filename="minstrel.apk" header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 20:23:56 -04:00
parent f6e27cd39a
commit 2435ef7961
3 changed files with 68 additions and 0 deletions
+5
View File
@@ -4,6 +4,7 @@
import { goto } from '$app/navigation';
import { login } from '$lib/auth/store.svelte';
import type { ApiError } from '$lib/api/client';
import MobileAppDownload from '$lib/components/MobileAppDownload.svelte';
let username = $state('');
let password = $state('');
@@ -88,5 +89,9 @@
Don't have an account?
<a href="/register" class="text-accent hover:underline">Register</a>
</p>
<div class="mt-6">
<MobileAppDownload />
</div>
</div>
</main>
+9
View File
@@ -17,6 +17,7 @@
} from '$lib/api/me';
import { errCode } from '$lib/api/errors';
import { pushToast } from '$lib/stores/toast.svelte';
import MobileAppDownload from '$lib/components/MobileAppDownload.svelte';
const queryClient = useQueryClient();
@@ -323,4 +324,12 @@
</li>
</ul>
</section>
<section class="space-y-3 rounded border border-border bg-surface p-4">
<h2 class="text-lg font-semibold">Mobile app</h2>
<p class="text-sm text-text-secondary">
Install the Android app paired to this server. Sign in with the same account.
</p>
<MobileAppDownload />
</section>
</div>