Add day and night colors, and default to a Material 3 DayNight theme #137
All Vouch review confidence checks passed
Residual risk 0.10 = Change Risk (0.31) × (1 − Review Confidence (0.68)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.31 · 20 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.35 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.182
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
3 items
These changes all make sense; the only questions relate to bigger picture issues raised on the matching Briefcase PR:
1. Whether the surface color should be customizable
2. Whether material should be promoted to this template
Approved
Following the discussion on the Briefcase ticket, I've reverted some of the proposed changes in favour of explicit configuration on the Briefcase side; otherwise, this looks great - thanks!
freakboy3742
kattni
Toga's Android backend is moving to Material 3, and Briefcase's Toga bootstrap is moving to a
Theme.Material3.DayNighttheme. In dark mode, that theme expects a light primary color, and uses dark text (#381E72) on buttons filled with it. This template always setscolorPrimaryto the app'sprimary_color(#008577by default), so in dark mode those buttons get dark text on a dark fill.This PR:
primary_color,primary_color_darkandaccent_colorbe either a single color, used in both light and dark mode, or a table withdayandnightvalues, such asprimary_color = {day = "#5B2A8C", night = "#D4BBFF"}. Night values are written to a newvalues-night/colors.xml. A table needs both keys. If one is missing,briefcase createfails with a configuration error.primary_text_color, which setscolorOnPrimaryand takes the same forms. It defaults to#FFFFFF, so these buttons are readable in dark mode with no configuration.base_themefromTheme.AppCompat.Light.DarkActionBartoTheme.Material3.DayNight.com.google.android.material:material:1.13.0, next to the AppCompat dependency the template already adds.colorOnPrimaryis defined by the Material library, so including it keeps every app building, whatever its theme.Effect on existing apps, checked on an Android 15 emulator in light and dark mode:
base_themeand uses single colors looks the same. An app withTheme.AppCompat.Light.DarkActionBarand released Toga 0.5 was pixel-identical with the old and new template, in both modes.base_themegetsTheme.Material3.DayNightat its nextbriefcase create. With Toga 0.5 it stays readable in both modes, but it looks different: the app bar no longer uses the primary color, and the app follows dark mode.Generating a full Material 3 color scheme from a seed color is a possible later alternative, tracked in beeware/briefcase#3167.
Note: Briefcase change
beeware/briefcase#3168 documents these settings and updates the Toga bootstrap. Because this template now provides the theme and the Material library, the bootstrap no longer sets
base_themeor lists the Material dependency. beeware/briefcase#3168 must merge together with or after this PR. Otherwise, new Toga apps would get an AppCompat theme without the Material library.PR Checklist:
<!--- Go over all the following points, and put an
xin all the boxes that apply. --><!-- update or delete the next line to reflect your usage -->
Assisted-by: Claude Code (Claude Opus 5.5)