From 7294763bfef65c47186daa12825546f662cb4294 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 20 May 2026 11:28:25 +0000 Subject: [PATCH] fix: respect EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE in native diff and default unset APP_VARIANT to development - useNativeReviewDiffHighlighting: resolve engine from EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE via the shared resolveReviewHighlighterEnginePreference helper instead of hardcoding 'native' - app.config.ts: default to 'development' when APP_VARIANT is unset so local dev scripts (dev, start) get cleartext HTTP and dev bundle IDs; EAS profiles are unaffected since they always set APP_VARIANT explicitly --- apps/mobile/app.config.ts | 2 +- .../features/review/useNativeReviewDiffHighlighting.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts index e1f0ac431c..b14e6cfd33 100644 --- a/apps/mobile/app.config.ts +++ b/apps/mobile/app.config.ts @@ -44,7 +44,7 @@ function resolveAppVariant(value: string | undefined): AppVariant { case "production": return value; default: - return "production"; + return "development"; } } diff --git a/apps/mobile/src/features/review/useNativeReviewDiffHighlighting.ts b/apps/mobile/src/features/review/useNativeReviewDiffHighlighting.ts index 98df26641a..91a3896511 100644 --- a/apps/mobile/src/features/review/useNativeReviewDiffHighlighting.ts +++ b/apps/mobile/src/features/review/useNativeReviewDiffHighlighting.ts @@ -7,6 +7,12 @@ import { } from "../diffs/nativeReviewDiffHighlighter"; import type { NativeReviewDiffRow } from "../diffs/nativeReviewDiffSurface"; import type { NativeReviewDiffFile } from "../diffs/nativeReviewDiffTypes"; +import { resolveReviewHighlighterEnginePreference } from "./reviewHighlighterEngine"; + +const CONFIGURED_ENGINE: NativeReviewDiffHighlightEngine = resolveReviewHighlighterEnginePreference( + process.env.EXPO_PUBLIC_REVIEW_HIGHLIGHTER_ENGINE ?? + (process.env.NODE_ENV === "test" ? "javascript" : "native"), +); interface NativeReviewVisibleRange { readonly firstRowIndex: number; @@ -68,7 +74,7 @@ export function useNativeReviewDiffHighlighting(input: { const abortController = new AbortController(); const requestRange = visibleRangeRef.current; - const engine: NativeReviewDiffHighlightEngine = "native"; + const engine: NativeReviewDiffHighlightEngine = CONFIGURED_ENGINE; void (async () => { try {