Skip to content
TypeScript

refactor(mobile): remove unused native style constants (#10001)

Julius Marminge3382b26c4f29
diff --git a/apps/mobile/src/features/files/nativeSourceFileAdapter.test.ts b/apps/mobile/src/features/files/nativeSourceFileAdapter.test.ts
index 0e7d478c6bd..937d3a1d3c8 100644
--- a/apps/mobile/src/features/files/nativeSourceFileAdapter.test.ts
+++ b/apps/mobile/src/features/files/nativeSourceFileAdapter.test.ts
@@ -3,30 +3,10 @@ import { describe, expect, it } from "vite-plus/test";
import {
buildNativeSourceRows,
buildNativeSourceTokens,
- NATIVE_SOURCE_ROW_HEIGHT,
- NATIVE_SOURCE_STYLE,
nativeSourceRowId,
} from "./nativeSourceFileAdapter";
-import {
- NATIVE_REVIEW_DIFF_ROW_HEIGHT,
- NATIVE_REVIEW_DIFF_STYLE,
-} from "../review/nativeReviewDiffAdapter";
describe("nativeSourceFileAdapter", () => {
- it("uses the same compact code typography as the diff viewer", () => {
- expect(NATIVE_SOURCE_ROW_HEIGHT).toBe(NATIVE_REVIEW_DIFF_ROW_HEIGHT);
- expect(NATIVE_SOURCE_STYLE).toMatchObject({
- rowHeight: NATIVE_REVIEW_DIFF_STYLE.rowHeight,
- gutterWidth: NATIVE_REVIEW_DIFF_STYLE.gutterWidth,
- codePadding: NATIVE_REVIEW_DIFF_STYLE.codePadding,
- textVerticalInset: NATIVE_REVIEW_DIFF_STYLE.textVerticalInset,
- codeFontSize: NATIVE_REVIEW_DIFF_STYLE.codeFontSize,
- codeFontWeight: NATIVE_REVIEW_DIFF_STYLE.codeFontWeight,
- lineNumberFontSize: NATIVE_REVIEW_DIFF_STYLE.lineNumberFontSize,
- lineNumberFontWeight: NATIVE_REVIEW_DIFF_STYLE.lineNumberFontWeight,
- });
- });
-
it("maps plain source lines onto context rows with stable line numbers", () => {
expect(buildNativeSourceRows(["const value = 1;", "\treturn value;"])).toEqual([
{
diff --git a/apps/mobile/src/features/files/nativeSourceFileAdapter.ts b/apps/mobile/src/features/files/nativeSourceFileAdapter.ts
index 0c83134ea70..f1dbefdc383 100644
--- a/apps/mobile/src/features/files/nativeSourceFileAdapter.ts
+++ b/apps/mobile/src/features/files/nativeSourceFileAdapter.ts
@@ -4,17 +4,11 @@ import type {
NativeReviewDiffToken,
} from "../diffs/nativeReviewDiffSurface";
import type { ResolvedMobileCodeSurface } from "../../lib/appearancePreferences";
-import { resolveMobileCodeSurface } from "../../lib/appearancePreferences";
import { MOBILE_CODE_SURFACE, MOBILE_TYPOGRAPHY } from "../../lib/typography";
import type { SourceHighlightTokens } from "./sourceHighlightingState";
-export const NATIVE_SOURCE_ROW_HEIGHT = MOBILE_CODE_SURFACE.rowHeight;
export const NATIVE_SOURCE_CONTENT_WIDTH = 32_000;
-export const NATIVE_SOURCE_STYLE: NativeReviewDiffStyle = createNativeSourceStyle(
- resolveMobileCodeSurface(MOBILE_CODE_SURFACE.fontSize),
-);
-
export function createNativeSourceStyle(
codeSurface: ResolvedMobileCodeSurface,
): NativeReviewDiffStyle {
diff --git a/apps/mobile/src/features/review/nativeReviewDiffAdapter.ts b/apps/mobile/src/features/review/nativeReviewDiffAdapter.ts
index 3c2eb9016fe..39b9c0cef26 100644
--- a/apps/mobile/src/features/review/nativeReviewDiffAdapter.ts
+++ b/apps/mobile/src/features/review/nativeReviewDiffAdapter.ts
@@ -6,8 +6,6 @@ import type {
import * as Arr from "effect/Array";
import { pipe } from "effect/Function";
import type { ResolvedMobileCodeSurface } from "../../lib/appearancePreferences";
-import { resolveMobileCodeSurface } from "../../lib/appearancePreferences";
-import { MOBILE_CODE_SURFACE } from "../../lib/typography";
import { type MobileThemeId, type MobileThemeVariables } from "../../lib/mobileTheme";
import { getMobileTerminalTheme, type TerminalAppearanceScheme } from "../terminal/terminalTheme";
import { computeWordAltDiffRanges } from "./reviewWordDiffs";
@@ -25,13 +23,8 @@ const NATIVE_HEX_COLOR = /^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i;
const NATIVE_RGBA_COLOR =
/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/;
-export const NATIVE_REVIEW_DIFF_ROW_HEIGHT = MOBILE_CODE_SURFACE.rowHeight;
export const NATIVE_REVIEW_DIFF_CONTENT_WIDTH = 2_800;
-export const NATIVE_REVIEW_DIFF_STYLE = createNativeReviewDiffStyle(
- resolveMobileCodeSurface(MOBILE_CODE_SURFACE.fontSize),
-);
-
function opaqueNativeHexColor(color: string, background: string): string {
const hex = NATIVE_HEX_COLOR.exec(color);
if (hex) return color;