Skip to content

Publish the overlay theme for other apps #84

Done

Description

@BrianJr03

Owner: Franklin (suggested)
Linked ticket: Jarn FE: Match the Command Panel theme on the Jarngreipr board. That ticket needs this one shipped first.

Report

Jarn FE should be able to use the same theme as the Command Panel overlay when Command Panel is installed. Today no other app can read the theme.

Verified

Confirmed from code reading, not built or device-tested (Command Panel f408f7b).

  • The companion gets its theme in three steps in ui/settings/CompanionTheme.kt: rememberOverlayLook calls resolveLookPalette (theme mode, LED accent, Theme Studio pinned colors), companionPaletteFrom maps that to 14 color roles, and CompanionTheme provides them.
  • The inputs are private or split: overlay_look and custom_looks are in the app's private prefs (Prefs), tcc_theme_mode is a system setting, and the LED accent comes from ThorRgbController.accentOverride.
  • Step 1 is inside a composable, so a provider can't call it as is.
  • A signature permission can't protect this: Command Panel (8ebd8e6f...) and Jarngreipr (a9a6e462...) use different signing keys.

Fix

  1. Move the non-Compose part of step 1 into a shared function that returns the resolved TccColors. The overlay and companion keep their current behavior.
  2. Add an exported, read-only ThemeProvider at ${applicationId}.theme. Inserts, updates and deletes are refused. Theme colors aren't secret, so it needs no permission.
  3. Return one row: contract version, isDark, and the CompanionPalette roles as ARGB ints (bg, rail, surface, surfaceHigh, border, accent, accentSoft, accentFocused, onAccent, textPrimary, textSecondary, textTertiary, danger, success).
  4. Call notifyChange when the theme mode, active look, custom looks, LED accent sync or LED color changes.
  5. Publish the theme whether or not "Companion follows overlay look" is on. Never publish Theme Studio's unsaved draft.
  6. Document the contract next to docs/PANEL_PLUGINS.md. Never rename or renumber a column; a breaking change means a new version.

Keep in mind: a provider can be created before Application.onCreate, so read prefs lazily in query and don't rely on Hilt injection.

How to verify

  • Unit tests for the shared resolver and the row encoding.
  • On device: content query returns the same colors the companion shows for light, black, a custom look and LED accent sync.
  • Writes through content insert/update/delete are refused.
  • Changing the look fires a change notification.

Out of scope

Shapes, fonts and look renderers. The first version shares colors only.

Activity

  1. added
    enhancement
    area:theme
    on Nov 23, 2026
  2. BrianJr03 commented on Nov 24, 2026

    @BrianJr03
    OwnerAuthor

    Merged in #86 (96d753a, bac347b) and shipped in v0.14.0: https://github.com/BrianJr03/command-panel/releases/tag/v0.14.0
    Verified on the Thor against the release APK: signed by the single release signer (SHA-256 8ebd8e6f...988927), content query on jr.brian.commandpannel.theme/palette returns contract version 1, and insert and delete are refused as read-only. The look checks from #86's test plan were done by hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:themeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions