summaryrefslogtreecommitdiff
path: root/feedback_widget_color_theming.md
blob: 5415a4854273e3af05a5dbdf0bf209d70ab89f6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
name: feedback-widget-color-theming
description: "How to iterate on the doot widget's Material You / wallpaper color theming (WidgetPalette.kt, WidgetRows.kt) without re-triggering corrections already made once"
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 647d8c60-e602-440e-b8b3-d8422fcbcb1d
---

When tuning the doot Android widget's color theme (`android/app/src/main/java/org/terst/doot/widget/ui/WidgetPalette.kt` + `WidgetRows.kt`), several corrections landed in one session (2026-07-26) that are easy to re-break on the next pass:

**Structure vs. color are separate complaints -- don't conflate them.** When told "today is over styled," the actual fix was removing color/background chrome (the translucent card background, the per-source colored bars/dots), NOT removing structural elements like the hourly grid's per-hour divider line. That divider got removed anyway, and the correction was blunt: "the grid was fine, just the wrong color." **How to apply:** when a complaint is about styling, don't touch layout/structure unless told to. If unsure which the complaint means, ask, or make the narrowest change (color only) first.

**Don't layer manual alpha on top of system theme colors.** The first wallpaper-palette pass built "muted"/"secondary" text roles by taking a system_neutral resource color and adding `.copy(alpha = 0.7f)` etc. on top. This looked wrong ("the wrong color") because alpha-blending a semi-transparent tint over an arbitrary photo wallpaper composites unpredictably. The fix: pick a different, already-appropriately-toned resource *shade number* instead (e.g. `system_neutral2_500` for muted rather than `system_neutral2_300` + alpha) and use it at full opacity. **How to apply:** when a role needs to look more/less prominent, change which numbered shade resource you reference (0/10/50/100/200/.../1000), don't add `.copy(alpha=)` over a shade picked for a different purpose.

**The background must stay `Color.Transparent`, always** -- the widget sits directly on the home screen wallpaper; a translucent "card" background was explicitly rejected ("the background is awful"). Don't reintroduce a background/cornerRadius on the root `LazyColumn` in `DootWidget.kt`.

**Per-source accent colors (`sourceColor()` bars/dots in AllDayRow/EventBlock/TomorrowEventRow/TaskRow's checkbox+dot) are dropped from the widget grid** -- "chips for sources aren't useful". Those elements now use `palette.textSecondary`/`palette.textMuted` instead of the per-integration hex map. `sourceColor()` itself is still used by `TaskDetailActivity`'s header dot (a different screen, not mentioned in this feedback) -- don't remove the function, just don't call it from `WidgetRows.kt`'s grid rows.

**The Settings "Colors" toggle is a wanted feature, not just an SDK-compat shim.** It was removed once when minSdk was bumped to 36 (reasoning: "no fallback needed"), then explicitly asked back ("give me back the setting"). Keep the Settings chip UI around going forward -- it's a legitimate stylistic picker the user wants to flip between, not dead compatibility code. As of 2026-07-28 `WidgetColorTheme` has **4** values, not 2: `NEUTRAL` (default; mostly grayscale system_neutral1/2, accent1 only on the now-line -- this is what was originally called `WALLPAPER`), `ACCENT` (primary/secondary text itself tinted with system_accent1, now-line in accent2), `TONAL` (primary stays neutral for readability, secondary/muted pick up system_accent2/accent3), and `CLASSIC` (the original fixed white-on-transparent look, no wallpaper derivation at all). If asked for more/different mixes, add to this enum rather than replacing entries -- the user explicitly asked for "three mixes ... plus classic".

**Grid lines (divider, now-line) must never carry alpha, in any theme including CLASSIC.** Fixed once for the wallpaper-derived palettes (see the alpha rule above), but `CLASSIC_PALETTE`'s divider/nowLine were still `Color.White.copy(alpha=...)` and got the same complaint on a later round ("drop the alpha on the grid lines"). They're now solid opaque grays (`Color(0xFF4D4D4D)` / `Color(0xFFD9D9D9)`). Text roles (textSecondary/textMuted) in CLASSIC still legitimately use alpha over white -- the alpha ban is specific to line/divider elements, not all of CLASSIC's styling.

**Glance's `TextStyle` has no shadow parameter -- confirmed by decompiling `androidx.glance.text.TextStyle` through 1.3.0-alpha02 (the latest published build as of 2026-07-28), and RemoteViews doesn't expose `TextView.setShadowLayer` as a remotable action.** There is no version bump that adds this. A "drop shadow on the text" request is implemented instead via `ShadowedText()` in `WidgetRows.kt`: a `Box` stacking a black/alpha=0.35 copy of the text offset by `padding(start=1.dp, top=1.dp)` behind the real, correctly-colored text. Every visible `Text()` call in the widget grid (`WidgetRows.kt` + `DootWidget.kt`'s header) goes through this helper now -- don't add a new bare `Text()` call there without considering whether it should be a `ShadowedText()` instead, and route any *new* one through it too for consistency.

**Workflow note:** each round in this session was build (`./gradlew :app:assembleDebug` + `testDebugUnitTest` on tungsten, toolchain already bootstrapped) → copy to `/site/static.terst.org/public/files/doot-widget.apk` → chown www-data → user reinstalls and reports back. See [[project-doot-widget-build]] for the build bootstrap details.