From 19291355afecc5b2068b79497b7bfb82db2dae8a Mon Sep 17 00:00:00 2001 From: S Plotnikov Date: Sun, 12 Jul 2026 21:03:09 +0200 Subject: [PATCH] Record that device settings rewrite on-device type measurements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit font_weight_adjustment is added to every requested FontWeight and then clamps at the family's heaviest weight, so with "Bold text" on, distinct weights collapse and glyph metrics come back identical. That reads exactly like a broken font: it cost a session diagnosing the variable font as ignoring its wght axis and nearly swapping it for five static files, when the axis was fine and the phone simply had the setting on. It is also all of #32 — the tester's two phones differ by that setting, not by build. Write down the two settings to check, the control experiment that catches this (measure FontFamily.Default too; re-measure neutralised), and the reminder to restore the phone owner's accessibility prefs afterwards. Same note covers font_scale, which flow tests inherit from the device and so cannot catch. --- CLAUDE.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 4ada298..2e3ffee 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -71,6 +71,36 @@ live-updates client — see `ROADMAP.md` / `BACKLOG.md`. - Tests cover critical paths: auth/token handling, household scoping, stock actions, error/empty/offline states. No trivial UI tests. +## Measuring type or layout on a device — read the device's settings first +Android rewrites text before your measurement ever sees it. **Check these before trusting +any on-device font/layout number, and state their values alongside the result:** + +```bash +adb shell settings get system font_scale # 1.0 = unscaled +adb shell settings get secure font_weight_adjustment # 0 = none; 300 = "Bold text" ON +``` + +`font_weight_adjustment` is added to *every* requested `FontWeight` (400→700, 500→800, …) +and then clamps at the family's heaviest weight — so with it on, several distinct weights +collapse onto one and glyph metrics come back **identical**. That reads exactly like a +broken font, and in 2026-07 it cost a session: the app's variable font was "diagnosed" as +ignoring its `wght` axis and nearly replaced with five static files, when the axis was fine +and the phone simply had **Bold text** enabled (this is also the whole of issue #32 — the +tester's two phones differ by that setting, not by build). + +Two habits that catch it: +- **Run the control.** Before concluding the app is broken, measure the same thing with + `FontFamily.Default` (does the system font vary by weight here?) and re-measure with the + setting neutralised. A number that only misbehaves under one device config is a device + config finding, not a code finding. +- **Neutralise, then restore.** Set the value for the experiment and put the user's original + back when done — these are the phone owner's accessibility preferences, not test knobs. + +The same applies to `font_scale`: a label that fits at 1.0 can ellipsize at 1.6, and flow +tests run at whatever the device is set to, so they will not catch it. To cover a font scale +the device isn't on, render the composable in isolation and override `LocalDensity` +(see `ProductFilterSortRowTest`). + ## Status Functionally-complete (MVP + Phase 2), CI-green, running against the **production backend at `https://inventory.scuttle.dev/api/v1`**. The single-activity Compose +