From 3a249bccbac18cbfc9ff852ed80e41091e6d331a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?=
Date: Wed, 11 Nov 2026 21:43:10 +0100
Subject: [PATCH] fix(settings): keep note and paste fields at 16 px on a phone
On /settings/anamnesis the four note fields were raw textareas styled
by three copies of a class constant with text-sm (14 px), and on
/settings/export the three paste fields used text-xs (12 px) and the
backup passphrase text-sm. iOS zooms the page into such a field on
focus and leaves it zoomed. The notes use the Textarea primitive now
and the export fields keep the small size only under a fine pointer.
The 16 px guard read the five field primitives and could not see a
call site override their size, or a raw field styled from a constant.
It now parses every field call site; four that are still small sit on
a list that only shrinks. The focus guard drops the three records
files, whose fields come from the primitive now.
---
src/__tests__/pwa-mobile-shell-guard.test.ts | 182 +++++++++++++++++-
src/__tests__/text-field-focus-guard.test.ts | 3 -
.../records/about-me-note-manager.tsx | 10 +-
.../records/allergy-free-text-note.tsx | 9 +-
src/components/records/conditions-manager.tsx | 9 +-
src/components/settings/export-section.tsx | 2 +-
.../settings/import-panel/csv-import-card.tsx | 2 +-
.../import-panel/dose-history-import-card.tsx | 2 +-
.../import-panel/json-import-card.tsx | 2 +-
9 files changed, 193 insertions(+), 28 deletions(-)
diff --git a/src/__tests__/pwa-mobile-shell-guard.test.ts b/src/__tests__/pwa-mobile-shell-guard.test.ts
index 74da13d74..ad045d3d8 100644
--- a/src/__tests__/pwa-mobile-shell-guard.test.ts
+++ b/src/__tests__/pwa-mobile-shell-guard.test.ts
@@ -9,17 +9,21 @@
* 5 px content box and pushed the logo across its bottom border).
* 2. The stylesheet carries the rules the shell and the keyboard bridge
* depend on.
- * 3. Every form-field primitive keeps 16 px type on a touch screen: iOS
- * Safari zooms the page into a focused field below 16 px, and a width
+ * 3. Every form field keeps 16 px type on a touch screen: iOS Safari
+ * zooms the page into a focused field below 16 px, and a width
* breakpoint alone (`md:text-sm`) handed 14 px to a phone held sideways
* and to every iPad. The small size is allowed only behind
- * `pointer-fine:`.
+ * `pointer-fine:`. That holds for the primitives and for every call
+ * site, whose `text-sm` replaces the primitive's size, and for a raw
+ * `