Skip to content

Load the history tiles with a theme, so they render at all - #85

Merged
wanderdev0 merged 1 commit into
mainfrom
fix/history-tiles-need-a-theme
Aug 16, 2026
Merged

wanderdev0 merged 1 commit into
mainfrom
fix/history-tiles-need-a-theme

Conversation

@wanderdev0

Copy link
Copy Markdown
Owner

The history timeline column renders nothing. A regression from the dynamic-colour change, on
main now.

What happened

HistoryItemsAdapter loaded its tiles like this:

ResourcesCompat.getDrawable(resources, R.drawable.pin_drop_tile_empty_filled, null)

That third argument is the theme. It had been fine while the tiles were filled with
@color/md_theme_* literals — a literal colour needs no theme. Converting them to
?attr/colorOutline, so they would follow wallpaper colours, left nothing to resolve the
attribute against, and the paths drew as nothing.

No exception, no failing test, no log line. The tiles were simply absent.

The Resources this adapter is handed carry no theme, so the fix takes the row's own context —
AppCompatResources.getDrawable(viewHolder.itemView.getContext(), id).

Why the existing test missed it

SystemColorsLayoutTest renders those same drawables and asserts they clear 3:1 against the
background. It passes, and it passed throughout the outage — because it loads them through a
themed context
. That proves the drawable can render, which is not the same claim as the app
asking for it correctly. Wrong assertion boundary.

ThemedDrawableLoadingTest checks the call site instead. A source scan, because the defect is in
how the call is written and there is no object left to inspect afterwards. It runs on the JVM in
milliseconds.

The one legitimate exception

The map markers in VectorImageGeneratorUtil also load without a theme, and are fine: they
setTint every fill immediately afterwards, so nothing the theme would have supplied ever shows.

They are marked TINTED_AFTERWARDS at each call site rather than excluded silently — that safety
depends on a line four below the load, which is worth writing down where somebody will read it.
The marker must sit on the call or the line above, so it cannot be dropped at the top of a file
to silence everything beneath.

Scope

52 drawables now use ?attr/. Only the history tiles were affected; everything else either
inflates from a layout (themed) or is explicitly tinted.


🤖 Generated with Claude Code

This pull request description was written by Claude Code.

The timeline column went blank. HistoryItemsAdapter loaded its tiles with
ResourcesCompat.getDrawable(resources, id, null) - a null theme - which
was fine while those vectors were filled with @color/md_theme_* literals.
Converting them to ?attr/colorOutline so they follow wallpaper colours
left nothing to resolve the attribute against, so the paths drew as
nothing.

No exception, no failing test, no log. The tiles were simply not there.

The Resources this adapter is given carry no theme, so the row's own
context supplies one.

My screenshot test did not catch it and could not have: it loads the same
drawables through a themed context, which proves the drawable can render
rather than that the app asks for it correctly. ThemedDrawableLoadingTest
checks the call instead - a source scan, because the defect is in how the
call is written and there is no object left to inspect.

The map markers legitimately load without a theme, since setTint
overwrites every fill immediately afterwards. They are marked at the call
site rather than excluded silently: that safety depends on a line further
down, which is worth writing where somebody will read it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wanderdev0
wanderdev0 merged commit 2c0024b into main Aug 16, 2026
3 checks passed
saamdotexe pushed a commit to saamdotexe/OpenTagViewer that referenced this pull request Oct 22, 2026
…need-a-theme

Load the history tiles with a theme, so they render at all

This branch was previously deployed

1 inactive deployment
Android Build — 64b25eaa Deployed Aug 16, 2026 by wanderdev0 via Instrumented tests (emulator) #82
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.

1 participant