authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:12:21-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:12:21-07:00
log5fe29c89456c151529a63ddcbf132b4c518f1838
tree5a11eab0f790268406083e213806935ca71a2fe3
parent044a6e168ad1eb213c2c7c277034e65c638cc937
signature Signed by PGP key B5690EEEBB952194

refactor(mobile): remove unused font size steppers (#9975)


2 files changed, 1 insertions(+), 16 deletions(-)

apps/mobile/src/lib/appearancePreferences.test.ts+1-6
...@@ -13,8 +13,6 @@ import {...@@ -13,8 +13,6 @@ import {
13 resolveMobileCodeSurface,13 resolveMobileCodeSurface,
14 resolveNativeMarkdownTypography,14 resolveNativeMarkdownTypography,
15 resolveTextScaleVariables,15 resolveTextScaleVariables,
16 stepBaseFontSize,
17 stepCodeFontSize,
18 stepTerminalFontSize,16 stepTerminalFontSize,
19} from "./appearancePreferences";17} from "./appearancePreferences";
2018
...@@ -73,11 +71,8 @@ describe("appearancePreferences", () => {...@@ -73,11 +71,8 @@ describe("appearancePreferences", () => {
73 expect(normalizeCodeFontSize(30)).toBe(18);71 expect(normalizeCodeFontSize(30)).toBe(18);
74 });72 });
7573
76 it("steps font sizes within bounds", () => {74 it("steps terminal font size within bounds", () => {
77 expect(stepTerminalFontSize(6, -1)).toBe(6);75 expect(stepTerminalFontSize(6, -1)).toBe(6);
78 expect(stepBaseFontSize(11, -1)).toBe(11);
79 expect(stepCodeFontSize(8, -1)).toBe(8);
80 expect(stepBaseFontSize(15, 1)).toBe(16);
81 });76 });
8277
83 it("scales markdown typography from the base size", () => {78 it("scales markdown typography from the base size", () => {
apps/mobile/src/lib/appearancePreferences.ts-10
...@@ -235,22 +235,12 @@ export function resolveNativeMarkdownTypography(baseFontSize: number): NativeMar...@@ -235,22 +235,12 @@ export function resolveNativeMarkdownTypography(baseFontSize: number): NativeMar
235 };235 };
236}236}
237237
238export function stepBaseFontSize(current: number, direction: -1 | 1): number {
239 const next = direction === -1 ? current - BASE_FONT_SIZE_STEP : current + BASE_FONT_SIZE_STEP;
240 return normalizeBaseFontSize(next);
241}
242
243export function stepTerminalFontSize(current: number, direction: -1 | 1): number {238export function stepTerminalFontSize(current: number, direction: -1 | 1): number {
244 const next =239 const next =
245 direction === -1 ? current - TERMINAL_FONT_SIZE_STEP : current + TERMINAL_FONT_SIZE_STEP;240 direction === -1 ? current - TERMINAL_FONT_SIZE_STEP : current + TERMINAL_FONT_SIZE_STEP;
246 return normalizeTerminalFontSize(next);241 return normalizeTerminalFontSize(next);
247}242}
248243
249export function stepCodeFontSize(current: number, direction: -1 | 1): number {
250 const next = direction === -1 ? current - CODE_FONT_SIZE_STEP : current + CODE_FONT_SIZE_STEP;
251 return normalizeCodeFontSize(next);
252}
253
254export {244export {
255 DEFAULT_TERMINAL_FONT_SIZE,245 DEFAULT_TERMINAL_FONT_SIZE,
256 MAX_TERMINAL_FONT_SIZE,246 MAX_TERMINAL_FONT_SIZE,