@devries-cameron20 / t3code Mirror · read-only / commits / 3382b26c4f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 10:15 UTC

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

Julius Marminge committed Sep 5, 2026 at 00:26 UTC 3382b26c4f29bcbc709edf135c5486b7f1e0e211
3 files changed -33
apps/mobile/src/features/files/nativeSourceFileAdapter.test.ts
-20
@@ -3,30 +3,10 @@ import { describe, expect, it } from "vite-plus/test";
3 import {
4 buildNativeSourceRows,
5 buildNativeSourceTokens,
6 - NATIVE_SOURCE_ROW_HEIGHT,
7 - NATIVE_SOURCE_STYLE,
6 nativeSourceRowId,
7 } from "./nativeSourceFileAdapter";
10 -import {
11 - NATIVE_REVIEW_DIFF_ROW_HEIGHT,
12 - NATIVE_REVIEW_DIFF_STYLE,
13 -} from "../review/nativeReviewDiffAdapter";
8
9 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 -
10 it("maps plain source lines onto context rows with stable line numbers", () => {
11 expect(buildNativeSourceRows(["const value = 1;", "\treturn value;"])).toEqual([
12 {
apps/mobile/src/features/files/nativeSourceFileAdapter.ts
-6
@@ -4,17 +4,11 @@ import type {
4 NativeReviewDiffToken,
5 } from "../diffs/nativeReviewDiffSurface";
6 import type { ResolvedMobileCodeSurface } from "../../lib/appearancePreferences";
7 -import { resolveMobileCodeSurface } from "../../lib/appearancePreferences";
7 import { MOBILE_CODE_SURFACE, MOBILE_TYPOGRAPHY } from "../../lib/typography";
8 import type { SourceHighlightTokens } from "./sourceHighlightingState";
9
11 -export const NATIVE_SOURCE_ROW_HEIGHT = MOBILE_CODE_SURFACE.rowHeight;
10 export const NATIVE_SOURCE_CONTENT_WIDTH = 32_000;
11
14 -export const NATIVE_SOURCE_STYLE: NativeReviewDiffStyle = createNativeSourceStyle(
15 - resolveMobileCodeSurface(MOBILE_CODE_SURFACE.fontSize),
16 -);
17 -
12 export function createNativeSourceStyle(
13 codeSurface: ResolvedMobileCodeSurface,
14 ): NativeReviewDiffStyle {
apps/mobile/src/features/review/nativeReviewDiffAdapter.ts
-7
@@ -6,8 +6,6 @@ import type {
6 import * as Arr from "effect/Array";
7 import { pipe } from "effect/Function";
8 import type { ResolvedMobileCodeSurface } from "../../lib/appearancePreferences";
9 -import { resolveMobileCodeSurface } from "../../lib/appearancePreferences";
10 -import { MOBILE_CODE_SURFACE } from "../../lib/typography";
9 import { type MobileThemeId, type MobileThemeVariables } from "../../lib/mobileTheme";
10 import { getMobileTerminalTheme, type TerminalAppearanceScheme } from "../terminal/terminalTheme";
11 import { computeWordAltDiffRanges } from "./reviewWordDiffs";
@@ -25,13 +23,8 @@ const NATIVE_HEX_COLOR = /^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i;
23 const NATIVE_RGBA_COLOR =
24 /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/;
25
28 -export const NATIVE_REVIEW_DIFF_ROW_HEIGHT = MOBILE_CODE_SURFACE.rowHeight;
26 export const NATIVE_REVIEW_DIFF_CONTENT_WIDTH = 2_800;
27
31 -export const NATIVE_REVIEW_DIFF_STYLE = createNativeReviewDiffStyle(
32 - resolveMobileCodeSurface(MOBILE_CODE_SURFACE.fontSize),
33 -);
34 -
28 function opaqueNativeHexColor(color: string, background: string): string {
29 const hex = NATIVE_HEX_COLOR.exec(color);
30 if (hex) return color;