Skip to content

feat(about): fall back to pinned bundle info; show runtime versions#56

Merged
nmrenyi merged 1 commit into
mainfrom
feat/about-page-version-and-bundle-fallback
May 14, 2026
Merged

feat(about): fall back to pinned bundle info; show runtime versions#56
nmrenyi merged 1 commit into
mainfrom
feat/about-page-version-and-bundle-fallback

Conversation

@nmrenyi
Copy link
Copy Markdown
Owner

@nmrenyi nmrenyi commented May 14, 2026

Summary

About page used to silently show "Bundle metadata is not available on this device yet" whenever the deployment receipt (rag_bundle_deployed.json) was missing — even when the bundle is healthy and retrieval works. This commonly affects tablets provisioned before the receipt-writing code was added to the in-app downloader.

This PR makes the page useful even in that state, and surfaces the runtime versions someone debugging on-device behaviour usually needs.

Changes

Bundle card

  • Try getDeployedRagBundleInfo first; on null, fall back to getPinnedRagBundleInfo (reads rag_assets.lock.json from the APK's assets).
  • Fallback rendering tags itself with an italic note ("Pinned in this build; deployment receipt not found on device.") — explicit so we don't claim the bundle is verifiably deployed when we only have build-time info.

New Runtime card

  • App version (versionName (versionCode))
  • LiteRT-LM version (new BuildConfig.LITERTLM_VERSION, kept in sync with the Gradle dependency via a single litertlmVersion constant)
  • Configured LLM backend (GPU/CPU per BuildConfig.USE_GPU_FOR_LLM)
  • Wired through a new getRuntimeInfo MethodChannel handler in MainActivity.kt.

Backend wiring

  • MainActivity.kt — new getRuntimeInfo case + private method.
  • build.gradle.kts — single litertlmVersion = "0.11.0" constant used both in the dependency declaration and as BuildConfig.LITERTLM_VERSION.

Localization

  • New keys in both app_en.arb and app_sw.arb:
    • aboutKnowledgeBundlePinnedNote
    • aboutRuntimeTitle
    • aboutRuntimeAppLabel
    • aboutRuntimeLitertlmLabel
    • aboutRuntimeBackendLabel
  • ⚠️ Swahili strings are English placeholders — need translation in a follow-up; flagged here so reviewers don't miss it.

Tested on device

  • OPPO Snapdragon 8 Elite, with no rag_bundle_deployed.json on disk.
  • About page renders bundle version from the pinned source with the italic note.
  • Runtime card shows App: 0.1.0 (1), LiteRT-LM: 0.11.0, LLM backend: GPU.
  • Retrieval + generation continue to work normally during/after viewing the page.

Test plan

  • Build APK and install on a tablet that does have a rag_bundle_deployed.json — verify the bundle card shows Deployed: <timestamp> and no italic pinned-note appears (deployed path is preferred).
  • Build APK and install on a tablet without a receipt — verify the italic note is shown.
  • Verify Swahili locale shows the new fields (currently English text) and decide whether to follow up with proper translations.

🤖 Generated with Claude Code

About page now shows useful information even when the device lacks a
rag_bundle_deployed.json receipt (e.g. tablets provisioned before the
receipt-writing code was added in the in-app downloader).

Bundle card:
- Try getDeployedRagBundleInfo first; on null, fall back to
  getPinnedRagBundleInfo (reads rag_assets.lock.json from APK assets).
- Tag fallback source with an italic note so we don't lie about the
  bundle being verifiably deployed.

New Runtime card:
- App version (versionName + versionCode)
- LiteRT-LM version (new BuildConfig.LITERTLM_VERSION, kept in sync with
  the gradle dependency via a single litertlmVersion constant)
- Configured LLM backend (GPU/CPU per BuildConfig.USE_GPU_FOR_LLM)
- Wired through a new getRuntimeInfo MethodChannel handler.

Swahili strings for the new keys are placeholders (English text) — flag
for translation in a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings May 14, 2026 02:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a more useful About page by falling back to pinned RAG bundle metadata when deployment receipt metadata is missing, and adds runtime/build information for on-device debugging.

Changes:

  • Falls back from deployed bundle metadata to pinned APK bundle metadata.
  • Adds a Runtime card showing app, LiteRT-LM, and backend information.
  • Wires Android MethodChannel/runtime BuildConfig fields and localization strings.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/lib/screens/about_page.dart Adds pinned bundle fallback and Runtime info card UI.
app/lib/l10n/app_en.arb Adds English strings for pinned note and Runtime card labels.
app/lib/l10n/app_sw.arb Adds Swahili-locale placeholder strings for new About labels.
app/lib/l10n/app_localizations.dart Adds generated localization getters.
app/lib/l10n/app_localizations_en.dart Adds English localization implementations.
app/lib/l10n/app_localizations_sw.dart Adds Swahili localization implementations.
app/android/app/src/main/kotlin/com/example/app/MainActivity.kt Adds getRuntimeInfo MethodChannel handler.
app/android/app/build.gradle.kts Centralizes LiteRT-LM version and exposes it via BuildConfig.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"appVersionName" to BuildConfig.VERSION_NAME,
"appVersionCode" to BuildConfig.VERSION_CODE,
"litertlmVersion" to BuildConfig.LITERTLM_VERSION,
"llmBackendConfigured" to if (BuildConfig.USE_GPU_FOR_LLM) "GPU" else "CPU",
@nmrenyi nmrenyi merged commit ad73924 into main May 14, 2026
6 checks passed
@nmrenyi nmrenyi deleted the feat/about-page-version-and-bundle-fallback branch May 14, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants