Skip to content

Commit 0d51b14

Browse files
only21milcodex
andauthored
fix(server): read the smallest iOS simulator text size as small (#22114)
Co-authored-by: GPT-6.1 Sol <[email protected]>
1 parent a2e4524 commit 0d51b14

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
@@ -155,6 +155,18 @@ describe("runDeviceAction", () => {
155155
});
156156

157157
describe("readDeviceDetail", () => {
158+
it.effect("reads the smallest iOS text size as small", () =>
159+
Effect.gen(function* () {
160+
const { ready } = makeReady((call) =>
161+
call.args.join(" ").endsWith("ui SIM-1 content_size")
162+
? { stdout: "extra-small\n" }
163+
: { code: 1 },
164+
);
165+
const detail = yield* readDeviceDetail(ready, "ios", udid);
166+
expect(detail.settings.textSize).toBe("small");
167+
}),
168+
);
169+
158170
it.effect("reads iOS settings from simctl and the accessibility helper", () =>
159171
Effect.gen(function* () {
160172
const { ready } = makeReady((call) => {

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ const textSizeFromIos = (category: string): DeviceTextSize | undefined => {
102102
);
103103
if (entry) return entry[0];
104104
if (category.startsWith("accessibility")) return "extra-large";
105-
if (category.includes("extra")) return "large";
106-
return category === "extra-small" || category === "small" || category === "medium"
107-
? "small"
108-
: "default";
105+
if (category === "extra-small" || category === "small" || category === "medium") return "small";
106+
return category.includes("extra") ? "large" : "default";
109107
};
110108

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

0 commit comments

Comments
 (0)