A light or dark style value can name the content or the background, and a migration that guesses wrong inverts it
Resurfaces when
- replacing a deprecated system bar or status bar styling call with its new API during a framework upgrade
- mapping a dark mode flag to a 'light' or 'dark' style string for a bar, icon set or overlay
- system navigation buttons or status bar icons are invisible in dark mode after an upgrade
- a style enum's documentation and its native implementation disagree about what 'dark' means
The lesson’s retrieval contract, weighted three times heavier than its body. A lesson that states when it applies doesn’t need a semantic search to find it.
The lesson
A style value called light or dark has no fixed meaning. Some APIs use it for the background ("a
dark bar"), others for the content drawn on it ("dark icons"), and the two readings are exact
opposites. When a deprecated call is replaced by a new one, the old call's argument is usually copied
across with a guess about which reading the new API uses. If the guess is wrong the result type-checks,
lints, and passes every test that does not look at pixels, while icons become dark-on-dark.
Do not trust the parameter's doc comment for this either: the documentation and the native code can disagree, and only the native code decides.
The failure that taught it
A framework upgrade replaced a system navigation bar call that took the button colour with a newer
call taking a single style value. The migration wrote dark-mode → dark, with a comment explaining
that dark meant a dark bar with light buttons. The library's native code read dark as dark content
on a light background, and its own JavaScript resolver for auto agreed; only its type declarations
said otherwise. In dark mode the app requested light-bar appearance, so the back, home and recents
buttons were drawn dark on a dark surface. It survived several upgrade steps, a type check and on-device
runs, because the test device used gesture navigation, which draws no buttons to misread.
How to apply it
- When migrating a light/dark style call, read the new API's native implementation (or its
autoresolver) to learn which of content or background the value names. Do not rely on the type docs. - Map from the old call's semantics explicitly: write down "old: button colour = X" and derive the new value from that, rather than copying the ternary.
- Verify on a device configuration that actually shows the affected element (three-button navigation, not gestures), and read the window's appearance flags from the platform's window dump rather than trusting a screenshot, which may not capture system bars.
Where this claim comes from
- Lesson
A light or dark style value can name the content or the background, and a migration that guesses wrong inverts it
- Distillationhand-written
A note migrated from one project before the pipeline existed. No stated mechanism, which is why it ranks low in recall.
- Scar1 occurrence
One recorded failure — weaker evidence, and ranked accordingly rather than presented as settled.
- Evidencenone recorded
No source records recorded — hand-written and migrated lessons predate the pipeline that captures them.
What happened when it was used
- 0
- retrieved
- 0
- acted on
- 0
- held up
- 0
- did not hold up
Never retrieved. A new lesson starts at a neutral 1.0, deliberately — so learning something new cannot bury everything learned next.