authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:26:31-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:26:31-07:00
log3382b26c4f29bcbc709edf135c5486b7f1e0e211
tree27d47b393ee02a6470ec0861df2038d677f46cf5
parent1c59d3b72cbddefa186ce18bea5cd7e6e0ae4874
signature Signed by PGP key B5690EEEBB952194

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


3 files changed, 0 insertions(+), 33 deletions(-)

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