Skip to content

Commit 75bd329

Browse files
committed
fix(mobile): preserve diff scaling and header checks after main merge
1 parent 9247c05 commit 75bd329

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎apps/mobile/src/features/review/nativeReviewDiffAdapter.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import type { NativeReviewDiffRow, NativeReviewDiffTheme } from "../diffs/native
22
import type { NativeReviewDiffFile } from "../diffs/nativeReviewDiffTypes";
33
import * as Arr from "effect/Array";
44
import { pipe } from "effect/Function";
5-
import {
6-
DEFAULT_CODE_FONT_SIZE,
7-
type ResolvedMobileCodeSurface,
8-
} from "../../lib/appearancePreferences";
5+
import type { ResolvedMobileCodeSurface } from "../../lib/appearancePreferences";
6+
import { MOBILE_CODE_SURFACE } from "../../lib/typography";
97
import { resolveHighlightLanguage } from "../../lib/highlightLanguage";
108
import { type MobileThemeId, type MobileThemeVariables } from "../../lib/mobileTheme";
119
import { getMobileTerminalTheme, type TerminalAppearanceScheme } from "../terminal/terminalTheme";
@@ -72,7 +70,7 @@ export function createNativeReviewDiffStyle(
7270
codeSurface: ResolvedMobileCodeSurface,
7371
wordWrap: boolean,
7472
) {
75-
const scale = codeSurface.fontSize / DEFAULT_CODE_FONT_SIZE;
73+
const scale = codeSurface.fontSize / MOBILE_CODE_SURFACE.fontSize;
7674
const scaled = (size: number) => Math.max(8, Math.round(size * scale));
7775
return {
7876
wordWrap,

‎apps/mobile/src/native/V5StackHeader.ios.test.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import { expect, it, vi } from "vite-plus/test";
66

77
const bridge = vi.hoisted(() => ({ ios: undefined as StackHeaderConfigProps["ios"] }));
88

9+
vi.mock("../lib/useSystemFontScale", () => ({ useSystemFontScale: () => (size: number) => size }));
10+
vi.mock("../features/settings/appearance/AppearancePreferencesProvider", () => ({
11+
useAppearancePreferences: () => ({ appearance: { baseFontSize: 15 } }),
12+
}));
13+
914
vi.mock("react-native", () => ({ StyleSheet: { flatten: (style: unknown) => style } }));
1015
vi.mock("react-native-keyboard-controller", () => ({
1116
KeyboardController: { dismiss: vi.fn() },

0 commit comments

Comments
 (0)