feat(sample-app): no-account default models, Play Store readiness + adaptive multi-device UI prototype#22
Conversation
…it, Play Store readiness Make NativeLM installable and usable from a fresh Play Store install with no Hugging Face account, and add the docs/hardening needed to submit it. Model management - Add NativeLmViewModel.recommendedModelId: pick the largest ungated (Apache-2.0/MIT) LLM whose RAM floor the device clears, plus a downloadRecommended() convenience. - Split the model screen into a "Recommended" section (ungated models, no token, device pick badged) and a collapsible "Advanced - Hugging Face account" section holding the gated Gemma tier and the token field. First-run compliance - Onboarding final slide gains a terms/source gate linking the AGPL source and Google's Gemma Terms, and clarifies models carry their own licenses. - Update onboarding copy: start with a free model, no account needed. Security hardening - Disable cleartext (usesCleartextTraffic=false + network_security_config). Model downloads are HTTPS; local P2P sync uses raw sockets carrying AES-GCM ciphertext and is unaffected. Docs - Add PRIVACY.md (hosted-ready, zero-telemetry privacy policy). - Add PLAY_STORE.md (detailed submission checklist: AAB, signing, Data Safety, permissions, content rating, listing, compliance, follow-ups). - Update CHANGELOG + sample-app README.
- docs/privacy/index.html: standalone HTML privacy policy (light/dark, mobile), faithful to PRIVACY.md. Hosted URL: /litertlm-kmp/privacy/ - docs/index.html: small landing page linking policy + source. - docs/.nojekyll: serve static files as-is (no Jekyll build). - PLAY_STORE.md: exact Pages enablement steps (Settings -> Pages -> main /docs) and the privacy URL to paste into the Play Console. - PRIVACY.md: note the hosted URL. GitHub Pages is free for public repositories; enable after merge to main.
Opens the hosted GitHub Pages policy URL (https://sagar-develop.github.io/litertlm-kmp/privacy/) via a browser intent. Reuses the existing NavRow style; URL mirrors PRIVACY.md / docs/privacy/.
Add a self-contained HTML prototype (docs/prototype/index.html) visualizing the elevated, premium-minimal redesign across phone/foldable/tablet and light/dark, covering every screen: Chat (with list-detail two-pane), Models, Sources, Studio, Settings, PDF viewer, plus the Onboarding/Splash/Lock flows. Keeps the locked sage/warm identity and Inter + JetBrains Mono; formalizes an 8pt spacing scale, elevation/radius tokens, and the adaptive navigation strategy (modal drawer to navigation rail to rail + two-pane). DESIGN.md documents the tokens, breakpoints, per-screen adaptive behavior, and the Compose implementation plan (NavigationSuiteScaffold / ListDetailPaneScaffold).
…icons) Inline SVGs with only a viewBox expand to fill their container; several icon contexts (citation chips, Sources expander, Studio/Sources boxed icons, PDF page bar) had no size rule and rendered oversized. Pin explicit sizes.
Turns the docs-only prototype (docs/prototype/) into shipped Compose: an adaptive shell + two-pane Chat, so NativeLM reflows across phone, foldable, and tablet. Brand unchanged (sage, warm canvas, Inter + JetBrains Mono); colors already matched DESIGN.md. - Adaptive shell (AdaptiveShell.kt): NavigationSuiteScaffold over the five destinations (Chat/Models/Sources/Studio/Settings). Compact = no rail, the existing hamburger + modal drawer (phones unchanged); Medium/Expanded = navigation rail. Flows (splash/onboarding/lock/pdf) stay outside the shell; NativeLmApp collapses the five screen routes into one shell route. - Chat two-pane on Expanded: persistent conversations list (shared ConversationsList) + thread; hamburger hidden when the pane is present. - Empty-chat greeting gains tappable, project-aware suggestion chips (one-tap send). - Theme tokens (Dimens.kt): 8pt spacing, radius scale wired into MaterialTheme.shapes, and WideContent() to cap+center reading columns at 760dp so Models/Sources/Studio/Settings do not stretch on tablets. - Adaptive deps (material3 window-size-class + adaptive*), BOM-managed. Verified on-device: phone (Compact - drawer, chips, one-tap send), tablet portrait (Medium - rail + capped content) and landscape (Expanded - rail + Chat two-pane). No-account model download starts with no token. Deferred (noted): Sources/Studio list+detail two-pane. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Part 2 is now implemented in Compose (no longer docs-only)Per the discussion that a UI-enhancement branch needs shipped code, the adaptive multi-device prototype in What landed (commit
Verified on-device (release build):
Deferred (noted, not in this PR): Sources and Studio list+detail two-pane on Expanded (rail makes them multi-device today; single-pane within the shell is functional). Not yet verified from the Part-1 testing notes: gated-Gemma license reminder dialog and P2P sync with cleartext disabled (raw-socket transfer is unaffected by |
This PR has two parts: (1) the Play Store readiness / no-account model work, and (2) a design prototype for an adaptive multi-device UI redesign. They share this branch; the UI prototype is docs-only (
docs/prototype/) and ships no code changes.Part 1 — No-account default models + Play Store readiness
Why
To put NativeLM on the Play Store, two things had to change: a fresh install needed to reach a working model without forcing every user to create a Hugging Face account first, and the app needed the legal/packaging pieces a submission requires. This PR does both in one pass.
What "no HF token" means
Hugging Face models are either gated (Gemma — needs login + license accept + an
Authorization: Bearerheader) or public (Apache-2.0 / MIT — direct download, no account). The catalog already encodes this viaModelDescriptor.requiresAuth. This PR leans on it so the ungated models become the default path.Changes
Model management — no-account first run
NativeLmViewModel.recommendedModelId— picks the largest ungated LLM whose RAM floor the device clears (Qwen3 0.6B → DeepSeek-R1 1.5B → Phi-4 mini → Qwen3 4B), plus adownloadRecommended()convenience.First-run compliance
Security hardening
usesCleartextTraffic="false"+res/xml/network_security_config.xml. Model downloads are HTTPS; local P2P sync uses raw sockets carrying AES-GCM ciphertext and is unaffected (verified againstsync/SocketTransfer.kt).Docs (the "Play Store ready" deliverable)
PRIVACY.md— hosted-ready, zero-telemetry privacy policy (permission-by-permission).PLAY_STORE.md— detailed submission checklist: AAB build/signing, Data Safety answers, permission justifications, content rating, listing assets, AGPL + Gemma compliance, and recommended follow-ups.CHANGELOG.mdandsample-app/README.md.Deferred (documented, not in this PR)
Per scope decision, foreground-service / WorkManager downloads (so multi-GB downloads survive backgrounding) and model-revision + SHA pinning are written up as follow-ups in
PLAY_STORE.md §9.Testing notes
No Android SDK in the CI/dev sandbox, so this wasn't compiled here — changes are UI/docs/manifest only and were reviewed by hand. Please build the release AAB (
./gradlew :sample-app:bundleRelease) and smoke-test on an internal track: confirm the recommended model downloads with no token, the gated download still shows the license reminder, and P2P sync still works with cleartext disabled.Part 2 — Adaptive multi-device UI redesign (prototype)
A premium-minimal refresh of the existing identity plus a full multi-device adaptive UI (phone / foldable / tablet), delivered as an interactive HTML prototype for sign-off — not shipped Compose yet. The brand is unchanged: sage
#7FA980, warm canvas, Inter + JetBrains Mono (mono reserved for technical metadata). This elevates hierarchy, spacing, surfaces, and empty/loading states on top of what's locked inColor.kt/Type.kt.Files
docs/prototype/index.html— self-contained, offline. Top bar toggles Device (Phone · Foldable · Tablet) and Theme (Light · Dark); the left list jumps between screens. The same screen reflows across breakpoints.docs/prototype/DESIGN.md— tokens (8pt spacing, elevation, radius), breakpoint/navigation table, per-screen adaptive behavior, and the Compose implementation plan.Adaptive system
Destinations are identical across sizes — Chat · Models · Sources · Studio · Settings. Intended Compose mapping:
NavigationSuiteScaffoldfor the shell,ListDetailPaneScaffoldfor two-pane screens.Screens covered
Chat (with two-pane on tablet), Models, Sources, Studio, Settings, PDF viewer, and the Onboarding / Splash / Lock flows — rendered with faithful copy from the current app.
Open questions for review
Next steps (after sign-off)
Iterate on the prototype, then implement in Compose, staged: Chat → Models → Settings → Sources → Studio → PDF → flows.
https://claude.ai/code/session_01GY7vyycq3iQTQxiooMnxJW
Generated by Claude Code