Skip to content

feat(firmware): drive event firmware branding from bundled metadata#5929

Merged
jamesarich merged 1 commit into
mainfrom
claude/stoic-dhawan-7aa3b6
Jun 24, 2026
Merged

feat(firmware): drive event firmware branding from bundled metadata#5929
jamesarich merged 1 commit into
mainfrom
claude/stoic-dhawan-7aa3b6

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

Surfaces the offline-first event firmware metadata contract from #5920 in the app: event branding is now driven by the bundled event_firmware.json instead of the hardcoded EventEdition.kt mapping, and the richer fields it carries (location, dates, links, accent color) are shown to the user. Adding a new event becomes a data edit rather than a code change + Crowdin string + recompile. Builds on the BundledAssetReader seam from #5921.

🌟 New Features

  • Event info sheet (EventInfoSheet.kt): tapping the event branding in the app bar opens a Material 3 bottom sheet with the welcome message, location, date range, and tappable links (LocalUriHandler). The header band uses the edition's accent color with a luminance-picked on-color for contrast.
  • Ambient accent theming: when connected to event firmware, the top app bar container is given a faint wash of the edition's accentColor (12% over surface), app-wide.
  • Every event edition is now tappable for its info sheet — editions without a bundled icon reuse the Meshtastic logo (previously only Hamvention, which ships a drawable, was interactive).

🛠️ Refactoring & Architecture

  • core/model: new @Serializable EventFirmwareResponse / EventFirmwareEdition / EventFirmwareLink models matching the bundled asset and schemas/event_firmware.schema.json (all fields defaulted, @JsonIgnoreUnknownKeys).
  • core/repository + core/data: new EventFirmwareRepository (Koin @Single), backed by a decode-once in-memory cache — no DB or network, since this is a handful of static records. A /resource/eventFirmware refresh is a deliberate later follow-up (mirrors DeviceLinkRepository's seed → reconcile when it lands).
  • core/ui: UIViewModel.eventEdition and LocalEventBranding now carry the data model; the bundled Hamvention drawable stays code-mapped via eventIconFor() (the data's iconUrl is null until icons are hosted).
  • feature/node: the firmware-edition display name in the admin section is resolved from the repository.

🧹 Chores

  • Removes the hardcoded EventEdition.kt and the now-unused event_welcome_* string resources. This drops their Crowdin per-language localization in favor of the data's plain-English welcomeMessage — a trade-off documented and sanctioned in feat: offline-first event firmware metadata (JSON schema + bundled asset) #5920. Translation strings.xml files are left for Crowdin to reconcile.
  • Dates render as raw ISO (2026-05-15 – 2026-05-17); core/ui has no kotlinx-datetime, so localized formatting is left as future polish.

🧪 Testing Performed

  • EventFirmwareRepositoryImplTest (new): lookup by enum name, null for unknown editions, absent-asset tolerance, and decode-once caching.
  • EventBrandingTest (new): accentColorOrNull() #RRGGBB parsing, case-insensitivity, and null on malformed/missing input.
  • Full baseline green locally: spotlessCheck detekt assembleDebug test allTests kmpSmokeCompile (1733 tasks, 0 failures).

Replaces the hardcoded EventEdition.kt enum mapping with the offline-first
event_firmware.json contract from #5920, and surfaces the richer metadata it
carries (location, dates, links, accent color) through to the UI. Adding a new
event is now a data edit rather than a code change + Crowdin string + recompile.

- core/model: EventFirmware{Response,Edition,Link} @serializable models matching
  the bundled asset and schema.
- core/repository + core/data: EventFirmwareRepository, backed by a decode-once
  in-memory cache (no DB/network — 4 static records; a /resource/eventFirmware
  refresh is a later follow-up).
- core/ui: data-driven LocalEventBranding; EventInfoSheet opens on app-bar tap
  (welcome, location, date range, links); ambient accent tint on the top app bar
  when connected to event firmware. Every event edition is now tappable.
- feature/node: firmware-edition display name resolved from the repo.
- Removes the hardcoded EventEdition.kt and the now-unused event_welcome_*
  strings (drops their Crowdin localization — sanctioned by #5920).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📄 Docs staleness check — advisory

This PR modifies user-facing UI source files but does not update any page under docs/en/user/ or docs/en/developer/.

⚠️ Doc changes propagate to 3 consumers: in-app docs browser, Jekyll site (GitHub Pages), and meshtastic.org (Docusaurus sync). Updating a page in docs/en/ automatically flows to all three.

Changed source files:

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/EventInfoSheet.kt
core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/MainAppBar.kt
core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/util/LocalEventBranding.kt
core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/viewmodel/UIViewModel.kt
feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/component/AdministrationSection.kt

What to check:

Changed area Likely doc page
feature/messaging/ docs/en/user/messages-and-channels.md
feature/node/ docs/en/user/nodes.md or docs/en/user/node-metrics.md
feature/map/ docs/en/user/map-and-waypoints.md
feature/connections/ docs/en/user/connections.md
feature/settings/ docs/en/user/settings-radio-user.md or docs/en/user/settings-module-admin.md
feature/firmware/ docs/en/user/firmware.md
feature/intro/ docs/en/user/onboarding.md
feature/discovery/ docs/en/user/discovery.md
feature/docs/ Internal docs infrastructure
core/ui/ docs/en/developer/codebase.md or component-specific user pages

New page checklist (if adding a new doc page):

  1. Create the .md file in docs/en/user/ or docs/en/developer/ with last_updated frontmatter
  2. Register in DocBundleLoader.kt with string resources (in-app browser)
  3. Jekyll and Docusaurus sync pick up new pages automatically — no config change needed

If this PR does not require a doc update (e.g., internal refactor, bug fix, test change), add the skip-docs-check label to dismiss this check.

Cross-platform note: This check is advisory while doc coverage matures. Both Android and Apple repos use the same skip-docs-check label and advisory severity. See meshtastic/design standards for shared conventions.

@github-actions

Copy link
Copy Markdown
Contributor

🖼️ Preview staleness check — advisory

This PR modifies UI composables but does not update any *Previews.kt files.

Previews power screenshot tests and in-app docs screenshots. Keeping them current ensures visual regression coverage stays accurate.

Changed UI files:

feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/component/AdministrationSection.kt

What to check:

Pattern Preview file convention
feature/{name}/…/ui/ or component/ feature/{name}/…/*Previews.kt
core/ui/…/ core/ui/…/ (previews colocated)

Adding previews checklist:

  1. Create or update a *Previews.kt file in the same module with @PreviewLightDark
  2. Add @Suppress("PreviewPublic") if the preview is consumed by screenshot-tests
  3. Add corresponding @PreviewTest function in screenshot-tests/src/screenshotTest/
  4. Run ./gradlew :screenshot-tests:updateDebugScreenshotTest to generate reference images

If this PR does not require preview updates (e.g., logic-only change, non-visual refactor), add the skip-preview-check label to dismiss.

@jamesarich jamesarich enabled auto-merge June 24, 2026 01:30
@jamesarich jamesarich added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 828c6a4 Jun 24, 2026
22 checks passed
@jamesarich jamesarich deleted the claude/stoic-dhawan-7aa3b6 branch June 24, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant