Skip to content

Commit 6c83bce

Browse files
only21milcodex
andcommitted
fix(server): read the smallest iOS simulator text size as small
Co-Authored-By: GPT-6.1 Sol <[email protected]>
1 parent c2fb438 commit 6c83bce

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎apps/server/src/device/DeviceActions.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@ describe("runDeviceAction", () => {
235235
});
236236

237237
describe("readDeviceDetail", () => {
238+
it.effect("reads the smallest iOS text size as small", () =>
239+
Effect.gen(function* () {
240+
const { ready } = makeReady((call) =>
241+
call.args.join(" ").endsWith("ui SIM-1 content_size")
242+
? { stdout: "extra-small\n" }
243+
: { code: 1 },
244+
);
245+
const detail = yield* readDeviceDetail(ready, "ios", udid);
246+
expect(detail.settings.textSize).toBe("small");
247+
}),
248+
);
249+
238250
it.effect("reads iOS settings from simctl and the accessibility helper", () =>
239251
Effect.gen(function* () {
240252
const { ready } = makeReady((call) => {

‎apps/server/src/device/DeviceActions.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ const textSizeFromIos = (category: string): DeviceTextSize | undefined => {
107107
);
108108
if (entry) return entry[0];
109109
if (category.startsWith("accessibility")) return "extra-large";
110-
if (category.includes("extra")) return "large";
111-
return category === "extra-small" || category === "small" || category === "medium"
112-
? "small"
113-
: "default";
110+
if (category === "extra-small" || category === "small" || category === "medium") return "small";
111+
return category.includes("extra") ? "large" : "default";
114112
};
115113

116114
const textSizeFromAndroid = (scale: number): DeviceTextSize => {

0 commit comments

Comments
 (0)