mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
fix(ui): keep the last four small fields at 16 px on a phone
The Coach memory editor, the managed profile's handover link, the cycle length fields and the command palette's search set a font size under 16 px on touch screens, so iOS zoomed the page when one took focus. They now read 16 px on a touch screen and keep their smaller size under a fine pointer, like the field primitives. With no field left over, the guard's list of known offenders goes.
This commit is contained in:
1 parent
8f3b640ab6
commit
0a71e8ffa5
5 files changed
+4
-26
No files matched your search
@@ -304,20 +304,6 @@ function smallFields(
|
||||
}
|
||||
|
||||
describe("no field call site goes under 16 px on a touch screen", () => {
|
||||
/**
|
||||
* Call sites still under 16 px, fixed by a change of their own. An entry
|
||||
* that stops matching fails, so the list only shrinks.
|
||||
*/
|
||||
const OPEN: Readonly<Record<string, string>> = {
|
||||
"components/settings/coach-memory-section.tsx":
|
||||
"/settings/coach memory editor",
|
||||
"components/settings/access/managed-profile-handover.tsx":
|
||||
"read-only handover link field",
|
||||
"components/cycle/cycle-settings.tsx": "raw cycle-length number field",
|
||||
"components/command-palette/command-palette.tsx":
|
||||
"search field shrinks at `md:` without `pointer-fine:`",
|
||||
};
|
||||
|
||||
const scan = productionSources()
|
||||
.filter((rel) => rel.endsWith(".tsx"))
|
||||
.map((rel) => ({ rel, ...smallFields(rel, readSrc(rel)) }));
|
||||
@@ -349,13 +335,6 @@ describe("no field call site goes under 16 px on a touch screen", () => {
|
||||
});
|
||||
|
||||
it("no typed-into field sets a size under 16 px outside a fine pointer", () => {
|
||||
const offenders = scan
|
||||
.filter((file) => !(file.rel in OPEN))
|
||||
.flatMap((file) => file.small);
|
||||
expect(offenders).toEqual([]);
|
||||
});
|
||||
|
||||
it.each(Object.keys(OPEN))("%s is still open", (rel) => {
|
||||
expect(scan.find((file) => file.rel === rel)?.small ?? []).not.toEqual([]);
|
||||
expect(scan.flatMap((file) => file.small)).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user