Skip to content

Commit 711843f

Browse files
refactor(mobile): remove unused native style constants
1 parent 32142cf commit 711843f

3 files changed

Lines changed: 0 additions & 33 deletions

File tree

‎apps/mobile/src/features/files/nativeSourceFileAdapter.test.ts‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,10 @@ import { describe, expect, it } from "vite-plus/test";
33
import {
44
buildNativeSourceRows,
55
buildNativeSourceTokens,
6-
NATIVE_SOURCE_ROW_HEIGHT,
7-
NATIVE_SOURCE_STYLE,
86
nativeSourceRowId,
97
} from "./nativeSourceFileAdapter";
10-
import {
11-
NATIVE_REVIEW_DIFF_ROW_HEIGHT,
12-
NATIVE_REVIEW_DIFF_STYLE,
13-
} from "../review/nativeReviewDiffAdapter";
148

159
describe("nativeSourceFileAdapter", () => {
16-
it("uses the same compact code typography as the diff viewer", () => {
17-
expect(NATIVE_SOURCE_ROW_HEIGHT).toBe(NATIVE_REVIEW_DIFF_ROW_HEIGHT);
18-
expect(NATIVE_SOURCE_STYLE).toMatchObject({
19-
rowHeight: NATIVE_REVIEW_DIFF_STYLE.rowHeight,
20-
gutterWidth: NATIVE_REVIEW_DIFF_STYLE.gutterWidth,
21-
codePadding: NATIVE_REVIEW_DIFF_STYLE.codePadding,
22-
textVerticalInset: NATIVE_REVIEW_DIFF_STYLE.textVerticalInset,
23-
codeFontSize: NATIVE_REVIEW_DIFF_STYLE.codeFontSize,
24-
codeFontWeight: NATIVE_REVIEW_DIFF_STYLE.codeFontWeight,
25-
lineNumberFontSize: NATIVE_REVIEW_DIFF_STYLE.lineNumberFontSize,
26-
lineNumberFontWeight: NATIVE_REVIEW_DIFF_STYLE.lineNumberFontWeight,
27-
});
28-
});
29-
3010
it("maps plain source lines onto context rows with stable line numbers", () => {
3111
expect(buildNativeSourceRows(["const value = 1;", "\treturn value;"])).toEqual([
3212
{

‎apps/mobile/src/features/files/nativeSourceFileAdapter.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ import type {
44
NativeReviewDiffToken,
55
} from "../diffs/nativeReviewDiffSurface";
66
import type { ResolvedMobileCodeSurface } from "../../lib/appearancePreferences";
7-
import { resolveMobileCodeSurface } from "../../lib/appearancePreferences";
87
import { MOBILE_CODE_SURFACE, MOBILE_TYPOGRAPHY } from "../../lib/typography";
98
import type { SourceHighlightTokens } from "./sourceHighlightingState";
109

11-
export const NATIVE_SOURCE_ROW_HEIGHT = MOBILE_CODE_SURFACE.rowHeight;
1210
export const NATIVE_SOURCE_CONTENT_WIDTH = 32_000;
1311

14-
export const NATIVE_SOURCE_STYLE: NativeReviewDiffStyle = createNativeSourceStyle(
15-
resolveMobileCodeSurface(MOBILE_CODE_SURFACE.fontSize),
16-
);
17-
1812
export function createNativeSourceStyle(
1913
codeSurface: ResolvedMobileCodeSurface,
2014
): NativeReviewDiffStyle {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import type {
66
import * as Arr from "effect/Array";
77
import { pipe } from "effect/Function";
88
import type { ResolvedMobileCodeSurface } from "../../lib/appearancePreferences";
9-
import { resolveMobileCodeSurface } from "../../lib/appearancePreferences";
10-
import { MOBILE_CODE_SURFACE } from "../../lib/typography";
119
import { type MobileThemeId, type MobileThemeVariables } from "../../lib/mobileTheme";
1210
import { getMobileTerminalTheme, type TerminalAppearanceScheme } from "../terminal/terminalTheme";
1311
import { computeWordAltDiffRanges } from "./reviewWordDiffs";
@@ -25,13 +23,8 @@ const NATIVE_HEX_COLOR = /^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i;
2523
const NATIVE_RGBA_COLOR =
2624
/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/;
2725

28-
export const NATIVE_REVIEW_DIFF_ROW_HEIGHT = MOBILE_CODE_SURFACE.rowHeight;
2926
export const NATIVE_REVIEW_DIFF_CONTENT_WIDTH = 2_800;
3027

31-
export const NATIVE_REVIEW_DIFF_STYLE = createNativeReviewDiffStyle(
32-
resolveMobileCodeSurface(MOBILE_CODE_SURFACE.fontSize),
33-
);
34-
3528
function opaqueNativeHexColor(color: string, background: string): string {
3629
const hex = NATIVE_HEX_COLOR.exec(color);
3730
if (hex) return color;

0 commit comments

Comments
 (0)