Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,22 @@ export function HomeScreen(props: HomeScreenProps) {
listEmpty
);

// T3-CUSTOM(expbkt3): BEGIN — the experimental phase sidebar replaces the
// whole list. This MUST sit above the threadListV2Enabled return below:
// that flag defaults to true, so anything after it is unreachable.
if (phaseSidebarEnabled) {
return (
<View className="flex-1 bg-screen">
<PhaseSidebarPane
onSelectThread={props.onSelectThread}
selectedThreadKey={null}
viewerEnvironmentId={props.selectedEnvironmentId}
/>
</View>
);
}
// T3-CUSTOM(expbkt3): END

if (threadListV2Enabled) {
return (
<View className="flex-1 bg-screen">
Expand Down Expand Up @@ -1186,23 +1202,6 @@ export function HomeScreen(props: HomeScreenProps) {
);
}

// T3-CUSTOM(expbkt3): BEGIN — the experimental phase sidebar replaces this
// list entirely when enabled. It has to be wired here as well as in
// ThreadNavigationSidebar: that pane only renders in split view, so on a
// phone (compact layout) this screen IS the thread list.
if (phaseSidebarEnabled) {
return (
<View className="flex-1 bg-screen">
<PhaseSidebarPane
onSelectThread={props.onSelectThread}
selectedThreadKey={null}
viewerEnvironmentId={props.selectedEnvironmentId}
/>
</View>
);
}
// T3-CUSTOM(expbkt3): END

return (
<View className="flex-1 bg-screen">
{/* Sticky headers are deliberately not wired up: LegendList's JS sticky
Expand Down
16 changes: 16 additions & 0 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,22 @@ function ThreadNavigationSidebarPane(
);
}

// T3-CUSTOM(expbkt3): BEGIN — the experimental sidebar replaces this render
// path too. The nativeChrome branch above has its own copy; both paths render
// a thread list, so gating only one leaves the flag half-wired.
if (phaseSidebarEnabled) {
return (
<View className="flex-1" style={{ width: props.width }}>
<PhaseSidebarPane
onSelectThread={props.onSelectThread}
selectedThreadKey={props.selectedThreadKey}
viewerEnvironmentId={phaseSidebarViewerEnvironmentId}
/>
</View>
);
}
// T3-CUSTOM(expbkt3): END

return (
<View
testID="thread-navigation-sidebar"
Expand Down
31 changes: 10 additions & 21 deletions apps/mobile/src/lib/bkBuildManifest.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
// T3-CUSTOM(expbkt3): The Expo-manifest half of the fork build identity.
//
// Split from bkBuildIdentity.ts so the version-formatting logic stays testable
// without pulling react-native into the unit test environment. That split was
// incomplete: `authClientMetadata` imports this module, so a module-scope
// `expo-constants` import put expo-modules-core on the import graph of every
// test reaching authClientMetadata, and expo-modules-core reads React Native's
// `__DEV__` global as a side effect — which vitest does not define.
// without pulling react-native into the unit test environment.
//
// So the manifest read is both function-scoped and fail-soft. Outside a real
// Expo runtime there is no manifest to read, and "no manifest" already has a
// defined meaning here: no SHA, so `bkAppVersion` returns the plain version.
import { readBkGitSha } from "./bkBuildIdentity";
// The import is static, like every other expo-constants consumer in the app.
// An earlier version made it a fail-soft `require` to keep expo-modules-core off
// the import graph of tests reaching `authClientMetadata` — that silently
// swallowed the real read too, so builds reported a bare `1.0.4` with no
// `+bk.<sha>` suffix and the version-skew check the fork depends on was blind.
// Tests mock this module instead, which is what the rest of the suite does.
import Constants from "expo-constants";

function expoConfigExtra(): unknown {
try {
const loaded = require("expo-constants") as {
readonly default?: { readonly expoConfig?: { readonly extra?: unknown } };
readonly expoConfig?: { readonly extra?: unknown };
};
return (loaded.default ?? loaded).expoConfig?.extra;
} catch {
return null;
}
}
import { readBkGitSha } from "./bkBuildIdentity";

export function bkBuildGitSha(): string | null {
return readBkGitSha(expoConfigExtra());
return readBkGitSha(Constants.expoConfig?.extra);
}
5 changes: 5 additions & 0 deletions apps/mobile/src/lib/connection.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { afterEach, describe, expect, it, vi } from "vite-plus/test";

// T3-CUSTOM(expbkt3): authClientMetadata reads the Expo manifest for the fork
// build SHA, which pulls in expo-modules-core; that reads React Native's
// `__DEV__` global at import time and vitest does not define it.
vi.mock("expo-constants", () => ({ default: { expoConfig: null } }));
import { EnvironmentId } from "@t3tools/contracts";

import {
Expand Down
Loading