Adopt expo-router for mobile remote navigation
- Rework the mobile app shell into route-based screens - Add connection, new task, and thread routes with shared state - Restore Android cleartext support via config plugin
This commit is contained in:
1 parent
ac0173589a
commit
702c752e3d
46 files changed
+3827
-2524
No files matched your search
@@ -1 +0,0 @@
|
||||
export { default } from "./src/app/App";
|
||||
@@ -35,7 +35,6 @@
|
||||
"android": {
|
||||
"icon": "./assets/icon.png",
|
||||
"package": "com.t3tools.t3code",
|
||||
"usesCleartextTraffic": true,
|
||||
"adaptiveIcon": {
|
||||
"backgroundColor": "#E6F4FE",
|
||||
"foregroundImage": "./assets/android-icon-foreground.png",
|
||||
@@ -64,7 +63,9 @@
|
||||
"imageWidth": 220
|
||||
}
|
||||
],
|
||||
"expo-secure-store"
|
||||
"expo-secure-store",
|
||||
"expo-router",
|
||||
"./plugins/withAndroidCleartextTraffic.cjs"
|
||||
],
|
||||
"extra": {
|
||||
"eas": {
|
||||
|
||||
@@ -1,9 +1,2 @@
|
||||
import "react-native-gesture-handler";
|
||||
import { registerRootComponent } from "expo";
|
||||
|
||||
import App from "./App";
|
||||
|
||||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
||||
// It also ensures that whether you load the app in Expo Go or in a native build,
|
||||
// the environment is set up appropriately
|
||||
registerRootComponent(App);
|
||||
import "expo-router/entry";
|
||||
@@ -23,14 +23,18 @@
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"effect": "catalog:",
|
||||
"expo": "~55.0.8",
|
||||
"expo": "~55.0.14",
|
||||
"expo-camera": "~55.0.15",
|
||||
"expo-clipboard": "~55.0.9",
|
||||
"expo-constants": "^55.0.9",
|
||||
"expo-dev-client": "~55.0.26",
|
||||
"expo-font": "^55.0.4",
|
||||
"expo-glass-effect": "~55.0.8",
|
||||
"expo-haptics": "^55.0.9",
|
||||
"expo-image-picker": "~55.0.14",
|
||||
"expo-linking": "~55.0.12",
|
||||
"expo-paste-input": "^0.1.15",
|
||||
"expo-router": "~55.0.12",
|
||||
"expo-secure-store": "~55.0.9",
|
||||
"expo-splash-screen": "~55.0.13",
|
||||
"expo-symbols": "~55.0.5",
|
||||
@@ -38,12 +42,14 @@
|
||||
"nativewind": "5.0.0-preview.3",
|
||||
"punycode": "^2.3.1",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0",
|
||||
"react-native": "0.83.4",
|
||||
"react-native-css": "3.0.7",
|
||||
"react-native-gesture-handler": "~2.31.1",
|
||||
"react-native-gesture-handler": "~2.30.0",
|
||||
"react-native-markdown-display": "^7.0.2",
|
||||
"react-native-reanimated": "4.2.1",
|
||||
"react-native-safe-area-context": "~5.6.2",
|
||||
"react-native-screens": "~4.23.0",
|
||||
"react-native-svg": "15.15.3",
|
||||
"react-native-worklets": "0.7.2"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
const { withAndroidManifest } = require("expo/config-plugins");
|
||||
|
||||
module.exports = function withAndroidCleartextTraffic(config) {
|
||||
return withAndroidManifest(config, (nextConfig) => {
|
||||
const application = nextConfig.modResults.manifest.application?.[0];
|
||||
|
||||
if (application == null) {
|
||||
throw new Error(
|
||||
"AndroidManifest.xml is missing the application element required for cleartext traffic configuration.",
|
||||
);
|
||||
}
|
||||
|
||||
application.$ ??= {};
|
||||
application.$["android:usesCleartextTraffic"] = "true";
|
||||
|
||||
return nextConfig;
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
import { Link } from "expo-router";
|
||||
import { Pressable, ScrollView, useColorScheme } from "react-native";
|
||||
|
||||
import { AppText as Text } from "../components/AppText";
|
||||
import { makeAppPalette } from "../lib/theme";
|
||||
|
||||
export default function NotFoundRoute() {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
contentContainerStyle={{
|
||||
flexGrow: 1,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 16,
|
||||
paddingHorizontal: 24,
|
||||
paddingVertical: 32,
|
||||
}}
|
||||
style={{ flex: 1, backgroundColor: palette.screenBackground }}
|
||||
>
|
||||
<Text className="text-[28px] font-t3-bold" selectable style={{ color: palette.text }}>
|
||||
Route not found
|
||||
</Text>
|
||||
<Link href="/" asChild>
|
||||
<Pressable
|
||||
style={{
|
||||
backgroundColor: palette.primaryButton,
|
||||
borderRadius: 999,
|
||||
paddingHorizontal: 20,
|
||||
paddingVertical: 14,
|
||||
}}
|
||||
>
|
||||
<Text className="text-[16px] font-t3-bold" style={{ color: palette.primaryButtonText }}>
|
||||
Return home
|
||||
</Text>
|
||||
</Pressable>
|
||||
</Link>
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
import { useColorScheme } from "react-native";
|
||||
import "./../../global.css";
|
||||
|
||||
import {
|
||||
DMSans_400Regular,
|
||||
DMSans_500Medium,
|
||||
DMSans_700Bold,
|
||||
useFonts,
|
||||
} from "@expo-google-fonts/dm-sans";
|
||||
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
|
||||
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||
|
||||
import { LoadingScreen } from "../components/LoadingScreen";
|
||||
import { MobileAppShell } from "./MobileAppShell";
|
||||
import { useRemoteAppState } from "./useRemoteAppState";
|
||||
|
||||
export default function App() {
|
||||
const colorScheme = useColorScheme();
|
||||
const isDarkMode = colorScheme !== "light";
|
||||
const [fontsLoaded] = useFonts({
|
||||
DMSans_400Regular,
|
||||
DMSans_500Medium,
|
||||
DMSans_700Bold,
|
||||
});
|
||||
const app = useRemoteAppState();
|
||||
let content;
|
||||
|
||||
if (!fontsLoaded || app.isLoadingSavedConnection) {
|
||||
content = <LoadingScreen isDarkMode={isDarkMode} message="Loading remote workspace…" />;
|
||||
} else if (app.reconnectingScreenVisible) {
|
||||
content = <LoadingScreen isDarkMode={isDarkMode} message="Reconnecting…" />;
|
||||
} else {
|
||||
content = <MobileAppShell app={app} isDarkMode={isDarkMode} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||
<BottomSheetModalProvider>
|
||||
<SafeAreaProvider>{content}</SafeAreaProvider>
|
||||
</BottomSheetModalProvider>
|
||||
</GestureHandlerRootView>
|
||||
);
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
import { useState } from "react";
|
||||
import { StatusBar, View } from "react-native";
|
||||
|
||||
import { ConnectionSheet } from "../features/connection/ConnectionSheet";
|
||||
import { HomeScreen } from "../features/home/HomeScreen";
|
||||
import { NewTaskSheet } from "../features/threads/NewTaskSheet";
|
||||
import { ThreadDetailScreen } from "../features/threads/ThreadDetailScreen";
|
||||
import { ThreadNavigationDrawer } from "../features/threads/ThreadNavigationDrawer";
|
||||
import { scopedThreadKey } from "../lib/scopedEntities";
|
||||
import type { RemoteAppModel } from "./useRemoteAppState";
|
||||
|
||||
export function MobileAppShell(props: {
|
||||
readonly app: RemoteAppModel;
|
||||
readonly isDarkMode: boolean;
|
||||
}) {
|
||||
const { app } = props;
|
||||
const [threadsSheetVisible, setThreadsSheetVisible] = useState(false);
|
||||
const [newTaskVisible, setNewTaskVisible] = useState(false);
|
||||
const backgroundColor = props.isDarkMode ? "#020617" : "#f6f4ef";
|
||||
|
||||
const selectedThreadKey = app.selectedThread
|
||||
? scopedThreadKey(app.selectedThread.environmentId, app.selectedThread.id)
|
||||
: null;
|
||||
|
||||
const selectedThreadDetailProps = app.selectedThread
|
||||
? {
|
||||
selectedThread: app.selectedThread,
|
||||
screenTone: app.screenTone,
|
||||
connectionError: app.connectionError,
|
||||
httpBaseUrl: app.selectedEnvironmentBaseUrl,
|
||||
bearerToken: app.selectedEnvironmentBearerToken,
|
||||
selectedThreadFeed: app.selectedThreadFeed,
|
||||
activeWorkDurationLabel: app.activeWorkDurationLabel,
|
||||
activePendingApproval: app.activePendingApproval,
|
||||
respondingApprovalId: app.respondingApprovalId,
|
||||
activePendingUserInput: app.activePendingUserInput,
|
||||
activePendingUserInputDrafts: app.activePendingUserInputDrafts,
|
||||
activePendingUserInputAnswers: app.activePendingUserInputAnswers,
|
||||
respondingUserInputId: app.respondingUserInputId,
|
||||
draftMessage: app.draftMessage,
|
||||
draftAttachments: app.draftAttachments,
|
||||
connectionStateLabel: app.connectionState,
|
||||
activeThreadBusy: app.activeThreadBusy,
|
||||
selectedThreadGitStatus: app.selectedThreadGitStatus,
|
||||
gitOperationLabel: app.gitOperationLabel,
|
||||
selectedThreadQueueCount: app.selectedThreadQueueCount,
|
||||
onBack: app.onBackFromThread,
|
||||
onOpenDrawer: () => setThreadsSheetVisible(true),
|
||||
onOpenConnectionEditor: app.onOpenConnectionEditor,
|
||||
onChangeDraftMessage: app.onChangeDraftMessage,
|
||||
onPickDraftImages: app.onPickDraftImages,
|
||||
onPasteIntoDraft: app.onPasteIntoDraft,
|
||||
onRemoveDraftImage: app.onRemoveDraftImage,
|
||||
onRefresh: app.onRefresh,
|
||||
onRefreshSelectedThreadGitStatus: app.onRefreshSelectedThreadGitStatus,
|
||||
onListSelectedThreadBranches: app.onListSelectedThreadBranches,
|
||||
onCheckoutSelectedThreadBranch: app.onCheckoutSelectedThreadBranch,
|
||||
onCreateSelectedThreadBranch: app.onCreateSelectedThreadBranch,
|
||||
onCreateSelectedThreadWorktree: app.onCreateSelectedThreadWorktree,
|
||||
onPullSelectedThreadBranch: app.onPullSelectedThreadBranch,
|
||||
onRunSelectedThreadGitAction: app.onRunSelectedThreadGitAction,
|
||||
onRenameThread: app.onRenameThread,
|
||||
onStopThread: app.onStopThread,
|
||||
onSendMessage: app.onSendMessage,
|
||||
onRespondToApproval: app.onRespondToApproval,
|
||||
onSelectUserInputOption: app.onSelectUserInputOption,
|
||||
onChangeUserInputCustomAnswer: app.onChangeUserInputCustomAnswer,
|
||||
onSubmitUserInput: app.onSubmitUserInput,
|
||||
}
|
||||
: null;
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor }}>
|
||||
<StatusBar
|
||||
barStyle={props.isDarkMode ? "light-content" : "dark-content"}
|
||||
backgroundColor={backgroundColor}
|
||||
translucent
|
||||
/>
|
||||
|
||||
{app.selectedThread && selectedThreadDetailProps ? (
|
||||
<ThreadDetailScreen {...selectedThreadDetailProps} />
|
||||
) : (
|
||||
<HomeScreen
|
||||
projects={app.projects}
|
||||
threads={app.threads}
|
||||
connectionState={app.connectionState}
|
||||
connectionPulse={app.hasRemoteActivity}
|
||||
onOpenConnectionEditor={app.onOpenConnectionEditor}
|
||||
onOpenNewTask={() => setNewTaskVisible(true)}
|
||||
onSelectThread={app.onSelectThread}
|
||||
/>
|
||||
)}
|
||||
|
||||
<ConnectionSheet
|
||||
visible={app.connectionSheetRequired}
|
||||
connectedEnvironments={app.connectedEnvironments}
|
||||
connectionInput={app.connectionInput}
|
||||
connectionState={app.connectionState}
|
||||
connectionError={app.connectionError}
|
||||
onRequestClose={app.onRequestCloseConnectionEditor}
|
||||
onChangePairingUrl={app.onChangeConnectionPairingUrl}
|
||||
onConnect={app.onConnectPress}
|
||||
onUpdateEnvironment={app.onUpdateEnvironment}
|
||||
onRemoveEnvironment={app.onRemoveEnvironmentPress}
|
||||
/>
|
||||
|
||||
<ThreadNavigationDrawer
|
||||
visible={threadsSheetVisible}
|
||||
projects={app.projects}
|
||||
threads={app.threads}
|
||||
selectedThreadKey={selectedThreadKey}
|
||||
onClose={() => setThreadsSheetVisible(false)}
|
||||
onSelectThread={app.onSelectThread}
|
||||
onStartNewTask={() => setNewTaskVisible(true)}
|
||||
/>
|
||||
|
||||
{newTaskVisible ? (
|
||||
<NewTaskSheet
|
||||
visible={newTaskVisible}
|
||||
projects={app.projects}
|
||||
threads={app.threads}
|
||||
serverConfigByEnvironmentId={app.serverConfigByEnvironmentId}
|
||||
onRequestClose={() => setNewTaskVisible(false)}
|
||||
onCreateThreadWithOptions={app.onCreateThreadWithOptions}
|
||||
onListProjectBranches={app.onListProjectBranches}
|
||||
/>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
import "../../global.css";
|
||||
|
||||
import {
|
||||
DMSans_400Regular,
|
||||
DMSans_500Medium,
|
||||
DMSans_700Bold,
|
||||
useFonts,
|
||||
} from "@expo-google-fonts/dm-sans";
|
||||
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
|
||||
import Stack from "expo-router/stack";
|
||||
import { Platform, StatusBar, useColorScheme } from "react-native";
|
||||
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||
|
||||
import { LoadingScreen } from "../components/LoadingScreen";
|
||||
import { makeAppPalette } from "../lib/theme";
|
||||
import { RemoteAppStateProvider, useRemoteApp } from "../state/remote-app-state-provider";
|
||||
|
||||
function AppNavigator() {
|
||||
const app = useRemoteApp();
|
||||
const isDarkMode = useColorScheme() !== "light";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
|
||||
const newTaskScreenOptions = {
|
||||
contentStyle: { backgroundColor: palette.sheetBackground },
|
||||
gestureEnabled: true,
|
||||
headerShown: false,
|
||||
presentation: "formSheet" as const,
|
||||
sheetAllowedDetents: [0.92],
|
||||
sheetGrabberVisible: true,
|
||||
};
|
||||
|
||||
const connectionSheetScreenOptions = {
|
||||
contentStyle: { backgroundColor: palette.sheetBackground },
|
||||
gestureEnabled: true,
|
||||
headerShown: false,
|
||||
presentation: "formSheet" as const,
|
||||
sheetAllowedDetents: [0.55, 0.7],
|
||||
sheetGrabberVisible: true,
|
||||
};
|
||||
|
||||
if (app.isLoadingSavedConnection) {
|
||||
return <LoadingScreen message="Loading remote workspace…" />;
|
||||
}
|
||||
|
||||
if (app.reconnectingScreenVisible) {
|
||||
return <LoadingScreen message="Reconnecting…" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<StatusBar
|
||||
barStyle={palette.statusBarStyle}
|
||||
backgroundColor={palette.statusBarBackground}
|
||||
translucent
|
||||
/>
|
||||
<Stack screenOptions={{ headerShown: false }}>
|
||||
<Stack.Screen
|
||||
name="index"
|
||||
options={{
|
||||
headerShown: Platform.OS === "ios",
|
||||
headerShadowVisible: false,
|
||||
headerTitle: "",
|
||||
headerTransparent: true,
|
||||
headerBlurEffect: "none",
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen name="connections" options={connectionSheetScreenOptions} />
|
||||
<Stack.Screen name="new" options={newTaskScreenOptions} />
|
||||
<Stack.Screen
|
||||
name="threads/[environmentId]/[threadId]"
|
||||
options={{
|
||||
animation: "slide_from_right",
|
||||
gestureEnabled: false,
|
||||
headerShown: false,
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function RootLayout() {
|
||||
const [fontsLoaded] = useFonts({
|
||||
DMSans_400Regular,
|
||||
DMSans_500Medium,
|
||||
DMSans_700Bold,
|
||||
});
|
||||
|
||||
return (
|
||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||
<BottomSheetModalProvider>
|
||||
<SafeAreaProvider>
|
||||
<RemoteAppStateProvider>
|
||||
{fontsLoaded ? (
|
||||
<AppNavigator />
|
||||
) : (
|
||||
<LoadingScreen message="Loading remote workspace…" />
|
||||
)}
|
||||
</RemoteAppStateProvider>
|
||||
</SafeAreaProvider>
|
||||
</BottomSheetModalProvider>
|
||||
</GestureHandlerRootView>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import Stack from "expo-router/stack";
|
||||
|
||||
export const unstable_settings = {
|
||||
anchor: "index",
|
||||
};
|
||||
|
||||
export default function ConnectionsLayout() {
|
||||
return (
|
||||
<Stack
|
||||
screenOptions={{
|
||||
contentStyle: { backgroundColor: "rgba(246,244,239,0.98)" },
|
||||
headerShown: false,
|
||||
}}
|
||||
>
|
||||
<Stack.Screen name="index" options={{ animation: "none" }} />
|
||||
<Stack.Screen name="new" options={{ animation: "slide_from_right" }} />
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { ConnectionsRouteScreen } from "../../features/connection/ConnectionsRouteScreen";
|
||||
|
||||
export default function ConnectionsRoute() {
|
||||
return <ConnectionsRouteScreen />;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { NewConnectionRouteScreen } from "../../features/connection/NewConnectionRouteScreen";
|
||||
|
||||
export default function ConnectionsNewRoute() {
|
||||
return <NewConnectionRouteScreen />;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { HomeRouteScreen } from "../features/home/HomeRouteScreen";
|
||||
|
||||
export default function IndexRoute() {
|
||||
return <HomeRouteScreen />;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import Stack from "expo-router/stack";
|
||||
import { useColorScheme } from "react-native";
|
||||
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { NewTaskFlowProvider } from "../../features/threads/new-task-flow-provider";
|
||||
|
||||
export const unstable_settings = {
|
||||
anchor: "index",
|
||||
};
|
||||
|
||||
export default function NewTaskLayout() {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
|
||||
return (
|
||||
<NewTaskFlowProvider>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
contentStyle: { backgroundColor: palette.sheetBackground },
|
||||
headerShown: false,
|
||||
}}
|
||||
>
|
||||
<Stack.Screen name="index" options={{ animation: "none" }} />
|
||||
<Stack.Screen name="draft" options={{ animation: "slide_from_right" }} />
|
||||
</Stack>
|
||||
</NewTaskFlowProvider>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
|
||||
import { NewTaskDraftScreen } from "../../features/threads/NewTaskDraftScreen";
|
||||
|
||||
export default function NewTaskDraftRoute() {
|
||||
const params = useLocalSearchParams<{
|
||||
environmentId?: string | string[];
|
||||
projectId?: string | string[];
|
||||
}>();
|
||||
|
||||
return (
|
||||
<NewTaskDraftScreen
|
||||
initialProjectRef={{
|
||||
environmentId: Array.isArray(params.environmentId)
|
||||
? params.environmentId[0]
|
||||
: params.environmentId,
|
||||
projectId: Array.isArray(params.projectId) ? params.projectId[0] : params.projectId,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
import { useRouter } from "expo-router";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useMemo } from "react";
|
||||
import { Pressable, ScrollView, useColorScheme, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { AppText as Text } from "../../components/AppText";
|
||||
import { groupProjectsByRepository } from "../../lib/repositoryGroups";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
|
||||
export default function NewTaskRoute() {
|
||||
const app = useRemoteApp();
|
||||
const router = useRouter();
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const repositoryGroups = useMemo(
|
||||
() => groupProjectsByRepository({ projects: app.projects, threads: app.threads }),
|
||||
[app.projects, app.threads],
|
||||
);
|
||||
const items = useMemo(
|
||||
() =>
|
||||
repositoryGroups
|
||||
.map((group) => {
|
||||
const project = group.projects[0]?.project;
|
||||
if (!project) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
environmentId: project.environmentId,
|
||||
id: project.id,
|
||||
key: group.key,
|
||||
title: project.title,
|
||||
};
|
||||
})
|
||||
.filter((entry) => entry !== null),
|
||||
[repositoryGroups],
|
||||
);
|
||||
|
||||
return (
|
||||
<View
|
||||
collapsable={false}
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: palette.sheetBackground,
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 28,
|
||||
paddingBottom: Math.max(insets.bottom, 18) + 18,
|
||||
}}
|
||||
>
|
||||
<View collapsable={false} className="items-center gap-1 pb-4">
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: palette.textMuted, letterSpacing: 1 }}
|
||||
>
|
||||
New task
|
||||
</Text>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Choose project
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<ScrollView
|
||||
showsVerticalScrollIndicator={false}
|
||||
style={{ flex: 1 }}
|
||||
contentContainerStyle={{ paddingBottom: 8 }}
|
||||
>
|
||||
{items.length === 0 ? (
|
||||
<View
|
||||
collapsable={false}
|
||||
className="items-center rounded-[24px] px-6 py-8"
|
||||
style={{ backgroundColor: palette.card }}
|
||||
>
|
||||
<Text className="text-[16px] font-medium" style={{ color: palette.textMuted }}>
|
||||
Loading projects…
|
||||
</Text>
|
||||
</View>
|
||||
) : (
|
||||
<View
|
||||
collapsable={false}
|
||||
className="overflow-hidden rounded-[24px]"
|
||||
style={{ backgroundColor: palette.card }}
|
||||
>
|
||||
{items.map((item, index) => {
|
||||
const isFirst = index === 0;
|
||||
const isLast = index === items.length - 1;
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
key={item.key}
|
||||
onPress={() =>
|
||||
router.push({
|
||||
pathname: "/new/draft",
|
||||
params: {
|
||||
environmentId: item.environmentId,
|
||||
projectId: item.id,
|
||||
title: item.title,
|
||||
},
|
||||
})
|
||||
}
|
||||
style={{
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 18,
|
||||
borderTopWidth: isFirst ? 0 : 1,
|
||||
borderTopColor: palette.borderSubtle,
|
||||
backgroundColor: palette.card,
|
||||
borderTopLeftRadius: isFirst ? 24 : 0,
|
||||
borderTopRightRadius: isFirst ? 24 : 0,
|
||||
borderBottomLeftRadius: isLast ? 24 : 0,
|
||||
borderBottomRightRadius: isLast ? 24 : 0,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-center justify-between gap-3">
|
||||
<View className="flex-1">
|
||||
<Text className="text-[18px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{item.title}
|
||||
</Text>
|
||||
</View>
|
||||
<SymbolView
|
||||
name="chevron.right"
|
||||
size={14}
|
||||
tintColor={palette.chevronColor}
|
||||
type="monochrome"
|
||||
/>
|
||||
</View>
|
||||
</Pressable>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
)}
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { ThreadRouteScreen } from "../../../features/threads/ThreadRouteScreen";
|
||||
|
||||
export default function ThreadRoute() {
|
||||
return <ThreadRouteScreen />;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Image, View } from "react-native";
|
||||
import { Image, View, useColorScheme } from "react-native";
|
||||
|
||||
import { makeAppPalette } from "../lib/theme";
|
||||
import { AppText as Text } from "./AppText";
|
||||
|
||||
const BRAND_MARK_SOURCE = require("../../../../assets/dev/blueprint-ios-1024.png");
|
||||
@@ -7,14 +8,12 @@ const BRAND_MARK_SOURCE = require("../../../../assets/dev/blueprint-ios-1024.png
|
||||
export function BrandMark(props: {
|
||||
readonly compact?: boolean;
|
||||
readonly stageLabel?: string;
|
||||
readonly dark?: boolean;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const compact = props.compact ?? false;
|
||||
const iconSize = compact ? 32 : 44;
|
||||
const stageLabel = props.stageLabel ?? "Alpha";
|
||||
const textColor = props.dark ? "#f5f5f4" : "#171717";
|
||||
const mutedColor = props.dark ? "rgba(245,245,244,0.72)" : "rgba(23,23,23,0.6)";
|
||||
const stageBackground = props.dark ? "rgba(255,255,255,0.08)" : "rgba(23,23,23,0.06)";
|
||||
|
||||
return (
|
||||
<View className="flex-row items-center gap-3">
|
||||
@@ -31,26 +30,26 @@ export function BrandMark(props: {
|
||||
<View className="flex-row items-center gap-2">
|
||||
<Text
|
||||
className="text-[17px] font-t3-bold"
|
||||
style={{ color: textColor, letterSpacing: -0.4 }}
|
||||
style={{ color: palette.text, letterSpacing: -0.4 }}
|
||||
>
|
||||
T3 Code
|
||||
</Text>
|
||||
<View
|
||||
className="rounded-full px-2 py-1"
|
||||
style={{
|
||||
backgroundColor: stageBackground,
|
||||
backgroundColor: palette.subtleBg,
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
className="text-[10px] font-t3-bold uppercase"
|
||||
style={{ color: mutedColor, letterSpacing: 1.1 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 1.1 }}
|
||||
>
|
||||
{stageLabel}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
{!compact ? (
|
||||
<Text className="text-[12px] font-medium" style={{ color: mutedColor }}>
|
||||
<Text className="text-[12px] font-medium" style={{ color: palette.textMuted }}>
|
||||
Mobile control surface for your live coding environments
|
||||
</Text>
|
||||
) : null}
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
import { ActivityIndicator, StatusBar, View } from "react-native";
|
||||
import { ActivityIndicator, StatusBar, View, useColorScheme } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { makeAppPalette } from "../lib/theme";
|
||||
import { AppText as Text } from "./AppText";
|
||||
import { BrandMark } from "./BrandMark";
|
||||
|
||||
export function LoadingScreen(props: { readonly isDarkMode: boolean; readonly message: string }) {
|
||||
export function LoadingScreen(props: { readonly message: string }) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const backgroundColor = props.isDarkMode ? "#020617" : "#f8fafc";
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor, paddingTop: insets.top }}>
|
||||
<View style={{ flex: 1, backgroundColor: palette.screenBackground, paddingTop: insets.top }}>
|
||||
<StatusBar
|
||||
barStyle={props.isDarkMode ? "light-content" : "dark-content"}
|
||||
backgroundColor={backgroundColor}
|
||||
barStyle={palette.statusBarStyle}
|
||||
backgroundColor={palette.screenBackground}
|
||||
translucent
|
||||
/>
|
||||
<View className="flex-1 items-center justify-center gap-5 px-6">
|
||||
<BrandMark compact dark={props.isDarkMode} />
|
||||
<BrandMark compact />
|
||||
<ActivityIndicator size="large" />
|
||||
<Text className="font-t3-bold text-lg text-slate-950 dark:text-slate-50">
|
||||
{props.message}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { useColorScheme } from "react-native";
|
||||
import Svg, { Path } from "react-native-svg";
|
||||
|
||||
type ProviderIconProps = {
|
||||
readonly provider: string | null | undefined;
|
||||
readonly size?: number;
|
||||
};
|
||||
|
||||
export function ProviderIcon(props: ProviderIconProps) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const size = props.size ?? 16;
|
||||
|
||||
if (props.provider === "claudeAgent") {
|
||||
return (
|
||||
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
|
||||
<Path
|
||||
fill="#D97757"
|
||||
d="m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z"
|
||||
/>
|
||||
</Svg>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
|
||||
<Path
|
||||
fill={isDarkMode ? "#e2e8f0" : "#171717"}
|
||||
d="M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z"
|
||||
/>
|
||||
</Svg>
|
||||
);
|
||||
}
|
||||
@@ -1,33 +1,30 @@
|
||||
import {
|
||||
BottomSheetBackdrop,
|
||||
BottomSheetModal,
|
||||
BottomSheetScrollView,
|
||||
BottomSheetView,
|
||||
} from "@gorhom/bottom-sheet";
|
||||
import { MenuView } from "@react-native-menu/menu";
|
||||
import { CameraView, type BarcodeScanningResult, useCameraPermissions } from "expo-camera";
|
||||
import { BottomSheetBackdrop, BottomSheetModal, BottomSheetView } from "@gorhom/bottom-sheet";
|
||||
import { useRouter } from "expo-router";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Linking, Platform, Pressable, View, useColorScheme } from "react-native";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
ActionSheetIOS,
|
||||
Platform,
|
||||
Pressable,
|
||||
ScrollView,
|
||||
View,
|
||||
useColorScheme,
|
||||
} from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import type { ConnectedEnvironmentSummary } from "../../app/useRemoteAppState";
|
||||
import type { ConnectedEnvironmentSummary } from "../../state/use-remote-app-state";
|
||||
import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
|
||||
import { ErrorBanner } from "../../components/ErrorBanner";
|
||||
import type { RemoteConnectionInput } from "../../lib/connection";
|
||||
import { extractPairingUrlFromQrPayload } from "../../lib/pairingQr";
|
||||
import type { RemoteClientConnectionState } from "../../lib/remoteClient";
|
||||
import { ConnectionStatusDot } from "./ConnectionStatusDot";
|
||||
import {
|
||||
ConnectionSheetButton as SheetButton,
|
||||
makeConnectionSheetPalette as makePalette,
|
||||
type ConnectionSheetPalette,
|
||||
} from "./connection-sheet-shared";
|
||||
|
||||
export interface ConnectionSheetProps {
|
||||
readonly visible: boolean;
|
||||
readonly connectedEnvironments: ReadonlyArray<ConnectedEnvironmentSummary>;
|
||||
readonly connectionInput: RemoteConnectionInput;
|
||||
readonly connectionState: RemoteClientConnectionState;
|
||||
readonly connectionError: string | null;
|
||||
readonly onRequestClose: () => void;
|
||||
readonly onChangePairingUrl: (pairingUrl: string) => void;
|
||||
readonly onConnect: () => void;
|
||||
readonly onUpdateEnvironment: (
|
||||
environmentId: string,
|
||||
updates: { readonly label: string; readonly displayUrl: string },
|
||||
@@ -36,202 +33,9 @@ export interface ConnectionSheetProps {
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function parsePairingUrl(url: string): { host: string; code: string } {
|
||||
const trimmed = url.trim();
|
||||
if (!trimmed) return { host: "", code: "" };
|
||||
|
||||
try {
|
||||
const parsed = new URL(trimmed);
|
||||
const hashParams = new URLSearchParams(parsed.hash.slice(1));
|
||||
const hashToken = hashParams.get("token");
|
||||
const queryToken = parsed.searchParams.get("token");
|
||||
const code = hashToken || queryToken || "";
|
||||
|
||||
parsed.hash = "";
|
||||
parsed.search = "";
|
||||
parsed.pathname = "/";
|
||||
return { host: parsed.toString().replace(/\/$/, ""), code };
|
||||
} catch {
|
||||
return { host: trimmed, code: "" };
|
||||
}
|
||||
}
|
||||
|
||||
function buildPairingUrl(host: string, code: string): string {
|
||||
const h = host.trim();
|
||||
const c = code.trim();
|
||||
if (!h) return "";
|
||||
if (!c) return h;
|
||||
|
||||
try {
|
||||
const url = new URL(h.includes("://") ? h : `https://${h}`);
|
||||
url.hash = new URLSearchParams([["token", c]]).toString();
|
||||
return url.toString();
|
||||
} catch {
|
||||
return `${h}#token=${c}`;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Palette
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function makePalette(isDarkMode: boolean) {
|
||||
if (isDarkMode) {
|
||||
return {
|
||||
sheet: "rgba(18,20,23,0.98)",
|
||||
card: "#1f2329",
|
||||
cardAlt: "#242a31",
|
||||
border: "rgba(255,255,255,0.06)",
|
||||
text: "#f8fafc",
|
||||
muted: "#94a3b8",
|
||||
subtle: "#cbd5e1",
|
||||
accent: "#f59e0b",
|
||||
accentSubtle: "rgba(245,158,11,0.12)",
|
||||
iconBg: "rgba(245,158,11,0.10)",
|
||||
inputBackground: "#171b20",
|
||||
inputBorder: "rgba(255,255,255,0.06)",
|
||||
primaryButton: "#f8fafc",
|
||||
primaryButtonText: "#171717",
|
||||
secondaryButton: "rgba(255,255,255,0.05)",
|
||||
secondaryButtonText: "#f8fafc",
|
||||
dangerButton: "rgba(190,24,93,0.14)",
|
||||
dangerBorder: "rgba(244,114,182,0.18)",
|
||||
dangerText: "#fda4af",
|
||||
placeholder: "#64748b",
|
||||
cardShadow: {
|
||||
shadowColor: "#000",
|
||||
shadowOffset: { width: 0, height: 2 },
|
||||
shadowOpacity: 0.18,
|
||||
shadowRadius: 8,
|
||||
elevation: 4,
|
||||
} as const,
|
||||
separator: "rgba(255,255,255,0.04)",
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
sheet: "rgba(246,244,239,0.98)",
|
||||
card: "#fffdf9",
|
||||
cardAlt: "#f8f4ec",
|
||||
border: "rgba(23,23,23,0.06)",
|
||||
text: "#171717",
|
||||
muted: "#78716c",
|
||||
subtle: "#57534e",
|
||||
accent: "#a16207",
|
||||
accentSubtle: "rgba(161,98,7,0.08)",
|
||||
iconBg: "rgba(161,98,7,0.07)",
|
||||
inputBackground: "#ffffff",
|
||||
inputBorder: "rgba(23,23,23,0.06)",
|
||||
primaryButton: "#171717",
|
||||
primaryButtonText: "#fafaf9",
|
||||
secondaryButton: "#f1ece3",
|
||||
secondaryButtonText: "#171717",
|
||||
dangerButton: "#fff1f2",
|
||||
dangerBorder: "rgba(225,29,72,0.10)",
|
||||
dangerText: "#be123c",
|
||||
placeholder: "#94a3b8",
|
||||
cardShadow: {
|
||||
shadowColor: "rgba(23,23,23,0.08)",
|
||||
shadowOffset: { width: 0, height: 4 },
|
||||
shadowOpacity: 1,
|
||||
shadowRadius: 16,
|
||||
elevation: 3,
|
||||
} as const,
|
||||
separator: "rgba(23,23,23,0.04)",
|
||||
};
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Shared button
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function SheetButton(props: {
|
||||
readonly icon: React.ComponentProps<typeof SymbolView>["name"];
|
||||
readonly label: string;
|
||||
readonly disabled?: boolean;
|
||||
readonly tone?: "primary" | "secondary" | "danger";
|
||||
readonly compact?: boolean;
|
||||
readonly palette: ReturnType<typeof makePalette>;
|
||||
readonly onPress: () => void;
|
||||
}) {
|
||||
const tone = props.tone ?? "secondary";
|
||||
const colors =
|
||||
tone === "primary"
|
||||
? {
|
||||
backgroundColor: props.palette.primaryButton,
|
||||
borderColor: "transparent",
|
||||
textColor: props.palette.primaryButtonText,
|
||||
}
|
||||
: tone === "danger"
|
||||
? {
|
||||
backgroundColor: props.palette.dangerButton,
|
||||
borderColor: props.palette.dangerBorder,
|
||||
textColor: props.palette.dangerText,
|
||||
}
|
||||
: {
|
||||
backgroundColor: props.palette.secondaryButton,
|
||||
borderColor: props.palette.border,
|
||||
textColor: props.palette.secondaryButtonText,
|
||||
};
|
||||
|
||||
const primaryShadow =
|
||||
tone === "primary"
|
||||
? Platform.select({
|
||||
ios: {
|
||||
shadowColor: "#000",
|
||||
shadowOffset: { width: 0, height: 3 },
|
||||
shadowOpacity: 0.14,
|
||||
shadowRadius: 6,
|
||||
},
|
||||
android: { elevation: 3 },
|
||||
})
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
className={
|
||||
props.compact
|
||||
? "min-h-[42px] flex-row items-center justify-center gap-1.5 rounded-[14px] px-3.5 py-2.5"
|
||||
: "min-h-[48px] flex-row items-center justify-center gap-2 rounded-[16px] px-4 py-3"
|
||||
}
|
||||
disabled={props.disabled}
|
||||
onPress={props.onPress}
|
||||
style={[
|
||||
{
|
||||
backgroundColor: colors.backgroundColor,
|
||||
borderWidth: tone === "primary" ? 0 : 1,
|
||||
borderColor: colors.borderColor,
|
||||
opacity: props.disabled ? 0.5 : 1,
|
||||
},
|
||||
primaryShadow,
|
||||
]}
|
||||
>
|
||||
<SymbolView
|
||||
name={props.icon}
|
||||
size={props.compact ? 13 : 14}
|
||||
tintColor={colors.textColor}
|
||||
type="monochrome"
|
||||
/>
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: colors.textColor, letterSpacing: 0.8 }}
|
||||
>
|
||||
{props.label}
|
||||
</Text>
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Environment card (compact single row)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function EnvironmentCard(props: {
|
||||
readonly environment: ConnectedEnvironmentSummary;
|
||||
readonly palette: ReturnType<typeof makePalette>;
|
||||
readonly palette: ConnectionSheetPalette;
|
||||
readonly onPress: () => void;
|
||||
readonly onRemove: (environmentId: string) => void;
|
||||
}) {
|
||||
@@ -292,7 +96,7 @@ function EnvironmentCard(props: {
|
||||
|
||||
function EnvironmentDetailSheet(props: {
|
||||
readonly environment: ConnectedEnvironmentSummary | null;
|
||||
readonly palette: ReturnType<typeof makePalette>;
|
||||
readonly palette: ConnectionSheetPalette;
|
||||
readonly bottomInset: number;
|
||||
readonly onDismiss: () => void;
|
||||
readonly onSave: (
|
||||
@@ -332,8 +136,7 @@ function EnvironmentDetailSheet(props: {
|
||||
);
|
||||
|
||||
const hasChanges =
|
||||
env !== null &&
|
||||
(label.trim() !== env.environmentLabel || displayUrl.trim() !== env.displayUrl);
|
||||
env !== null && (label.trim() !== env.environmentLabel || displayUrl.trim() !== env.displayUrl);
|
||||
|
||||
return (
|
||||
<BottomSheetModal
|
||||
@@ -449,452 +252,70 @@ function EnvironmentDetailSheet(props: {
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Add backend (nested sheet — manual entry + optional QR scanner)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function AddBackendSheet(props: {
|
||||
readonly visible: boolean;
|
||||
readonly startWithScanner: boolean;
|
||||
readonly connectionState: RemoteClientConnectionState;
|
||||
readonly connectionError: string | null;
|
||||
readonly palette: ReturnType<typeof makePalette>;
|
||||
readonly bottomInset: number;
|
||||
readonly onDismiss: () => void;
|
||||
readonly onChangePairingUrl: (url: string) => void;
|
||||
readonly onConnect: () => void;
|
||||
}) {
|
||||
const sheetRef = useRef<BottomSheetModal>(null);
|
||||
const [cameraPermission, requestCameraPermission] = useCameraPermissions();
|
||||
const [hostInput, setHostInput] = useState("");
|
||||
const [codeInput, setCodeInput] = useState("");
|
||||
const [scannerVisible, setScannerVisible] = useState(false);
|
||||
const [scannerError, setScannerError] = useState<string | null>(null);
|
||||
const [scannerPaused, setScannerPaused] = useState(false);
|
||||
|
||||
const connectDisabled =
|
||||
props.connectionState === "connecting" || hostInput.trim().length === 0;
|
||||
|
||||
const snapPoints = useMemo<(string | number)[]>(
|
||||
() => [scannerVisible ? "82%" : "54%"],
|
||||
[scannerVisible],
|
||||
);
|
||||
|
||||
// Present / dismiss
|
||||
useEffect(() => {
|
||||
const sheet = sheetRef.current;
|
||||
if (!sheet) return;
|
||||
if (props.visible) {
|
||||
setHostInput("");
|
||||
setCodeInput("");
|
||||
setScannerError(null);
|
||||
setScannerPaused(false);
|
||||
|
||||
if (props.startWithScanner) {
|
||||
setScannerVisible(true);
|
||||
if (!cameraPermission?.granted && cameraPermission?.canAskAgain !== false) {
|
||||
void requestCameraPermission().catch(() => {});
|
||||
}
|
||||
} else {
|
||||
setScannerVisible(false);
|
||||
}
|
||||
|
||||
sheet.present();
|
||||
} else {
|
||||
sheet.dismiss();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [props.visible]);
|
||||
|
||||
// Sync fields → parent
|
||||
const syncUrl = useCallback(
|
||||
(host: string, code: string) => {
|
||||
props.onChangePairingUrl(buildPairingUrl(host, code));
|
||||
},
|
||||
[props.onChangePairingUrl],
|
||||
);
|
||||
|
||||
const handleHostChange = useCallback(
|
||||
(v: string) => {
|
||||
setHostInput(v);
|
||||
syncUrl(v, codeInput);
|
||||
},
|
||||
[codeInput, syncUrl],
|
||||
);
|
||||
|
||||
const handleCodeChange = useCallback(
|
||||
(v: string) => {
|
||||
setCodeInput(v);
|
||||
syncUrl(hostInput, v);
|
||||
},
|
||||
[hostInput, syncUrl],
|
||||
);
|
||||
|
||||
const handleToggleScanner = useCallback(() => {
|
||||
setScannerVisible((v) => {
|
||||
if (!v) {
|
||||
setScannerError(null);
|
||||
setScannerPaused(false);
|
||||
if (!cameraPermission?.granted && cameraPermission?.canAskAgain !== false) {
|
||||
void requestCameraPermission().catch(() => {});
|
||||
}
|
||||
}
|
||||
return !v;
|
||||
});
|
||||
}, [cameraPermission?.canAskAgain, cameraPermission?.granted, requestCameraPermission]);
|
||||
|
||||
const handleBarcodeScanned = useCallback(
|
||||
(result: BarcodeScanningResult) => {
|
||||
if (scannerPaused) return;
|
||||
setScannerPaused(true);
|
||||
try {
|
||||
const url = extractPairingUrlFromQrPayload(result.data);
|
||||
const { host, code } = parsePairingUrl(url);
|
||||
setHostInput(host);
|
||||
setCodeInput(code);
|
||||
props.onChangePairingUrl(url);
|
||||
setScannerVisible(false);
|
||||
} catch (error) {
|
||||
setScannerError(
|
||||
error instanceof Error
|
||||
? error.message
|
||||
: "Could not read a pairing URL from that QR code.",
|
||||
);
|
||||
setScannerPaused(false);
|
||||
}
|
||||
},
|
||||
[props.onChangePairingUrl, scannerPaused],
|
||||
);
|
||||
|
||||
const renderBackdrop = useCallback(
|
||||
(backdropProps: React.ComponentProps<typeof BottomSheetBackdrop>) => (
|
||||
<BottomSheetBackdrop
|
||||
{...backdropProps}
|
||||
appearsOnIndex={0}
|
||||
disappearsOnIndex={-1}
|
||||
opacity={0.24}
|
||||
pressBehavior="close"
|
||||
/>
|
||||
),
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<BottomSheetModal
|
||||
ref={sheetRef}
|
||||
stackBehavior="push"
|
||||
index={0}
|
||||
snapPoints={snapPoints}
|
||||
enableDynamicSizing={false}
|
||||
enablePanDownToClose
|
||||
backdropComponent={renderBackdrop}
|
||||
onDismiss={props.onDismiss}
|
||||
backgroundStyle={{ backgroundColor: props.palette.sheet }}
|
||||
handleIndicatorStyle={{ backgroundColor: "rgba(120,113,108,0.32)" }}
|
||||
>
|
||||
<BottomSheetView style={{ flex: 1 }}>
|
||||
<BottomSheetScrollView
|
||||
keyboardShouldPersistTaps="handled"
|
||||
showsVerticalScrollIndicator={false}
|
||||
contentContainerStyle={{
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 4,
|
||||
paddingBottom: Math.max(props.bottomInset, 16),
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
className="text-[24px] font-t3-bold"
|
||||
style={{ color: props.palette.text, letterSpacing: -0.2 }}
|
||||
>
|
||||
Add backend
|
||||
</Text>
|
||||
|
||||
{/* QR scanner */}
|
||||
{scannerVisible ? (
|
||||
<View
|
||||
className="gap-3 rounded-[18px] p-3"
|
||||
style={{
|
||||
backgroundColor: props.palette.cardAlt,
|
||||
borderWidth: 1,
|
||||
borderColor: props.palette.border,
|
||||
}}
|
||||
>
|
||||
{!cameraPermission ? (
|
||||
<Text
|
||||
className="text-[13px] leading-[18px]"
|
||||
style={{ color: props.palette.subtle }}
|
||||
>
|
||||
Checking camera permission…
|
||||
</Text>
|
||||
) : cameraPermission.granted ? (
|
||||
<>
|
||||
<View
|
||||
className="overflow-hidden rounded-[14px]"
|
||||
style={{
|
||||
height: 200,
|
||||
borderWidth: 1,
|
||||
borderColor: props.palette.border,
|
||||
backgroundColor: "#000000",
|
||||
}}
|
||||
>
|
||||
<CameraView
|
||||
barcodeScannerSettings={{ barcodeTypes: ["qr"] }}
|
||||
facing="back"
|
||||
onBarcodeScanned={scannerPaused ? undefined : handleBarcodeScanned}
|
||||
onMountError={(error) => setScannerError(error.message)}
|
||||
style={{ flex: 1 }}
|
||||
/>
|
||||
</View>
|
||||
<Text
|
||||
className="text-[12px] leading-[17px]"
|
||||
style={{ color: props.palette.subtle }}
|
||||
>
|
||||
Point the camera at a pairing QR code.
|
||||
</Text>
|
||||
{scannerPaused ? (
|
||||
<SheetButton
|
||||
icon="arrow.clockwise"
|
||||
label="Scan again"
|
||||
palette={props.palette}
|
||||
tone="secondary"
|
||||
compact
|
||||
onPress={() => {
|
||||
setScannerError(null);
|
||||
setScannerPaused(false);
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Text
|
||||
className="text-[12px] leading-[17px]"
|
||||
style={{ color: props.palette.subtle }}
|
||||
>
|
||||
Camera access is required to scan a pairing QR code.
|
||||
</Text>
|
||||
{cameraPermission.canAskAgain ? (
|
||||
<SheetButton
|
||||
icon="camera"
|
||||
label="Allow camera"
|
||||
palette={props.palette}
|
||||
tone="secondary"
|
||||
compact
|
||||
onPress={() => void requestCameraPermission().catch(() => {})}
|
||||
/>
|
||||
) : (
|
||||
<SheetButton
|
||||
icon="gear"
|
||||
label="Open settings"
|
||||
palette={props.palette}
|
||||
tone="secondary"
|
||||
compact
|
||||
onPress={() => void Linking.openSettings().catch(() => {})}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{scannerError ? <ErrorBanner message={scannerError} /> : null}
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{/* Host field */}
|
||||
<View className="gap-1.5">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: props.palette.muted, letterSpacing: 0.8 }}
|
||||
>
|
||||
Host
|
||||
</Text>
|
||||
<View className="flex-row items-center gap-2">
|
||||
<View className="flex-1">
|
||||
<TextInput
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
keyboardType="url"
|
||||
placeholder="192.168.1.100:8080"
|
||||
placeholderTextColor={props.palette.placeholder}
|
||||
value={hostInput}
|
||||
onChangeText={handleHostChange}
|
||||
className="rounded-[14px] px-4 py-3.5 text-[15px]"
|
||||
style={{
|
||||
backgroundColor: props.palette.inputBackground,
|
||||
borderWidth: 1,
|
||||
borderColor: props.palette.inputBorder,
|
||||
color: props.palette.text,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<Pressable
|
||||
className="h-[50px] w-[50px] items-center justify-center rounded-[14px]"
|
||||
style={{
|
||||
backgroundColor: scannerVisible
|
||||
? props.palette.accent
|
||||
: props.palette.secondaryButton,
|
||||
borderWidth: scannerVisible ? 0 : 1,
|
||||
borderColor: props.palette.border,
|
||||
}}
|
||||
onPress={handleToggleScanner}
|
||||
>
|
||||
<SymbolView
|
||||
name={scannerVisible ? "xmark" : "qrcode.viewfinder"}
|
||||
size={20}
|
||||
tintColor={
|
||||
scannerVisible
|
||||
? props.palette.primaryButtonText
|
||||
: props.palette.secondaryButtonText
|
||||
}
|
||||
type="monochrome"
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Pairing code field */}
|
||||
<View className="gap-1.5">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: props.palette.muted, letterSpacing: 0.8 }}
|
||||
>
|
||||
Pairing code
|
||||
</Text>
|
||||
<TextInput
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
placeholder="abc-123-xyz"
|
||||
placeholderTextColor={props.palette.placeholder}
|
||||
value={codeInput}
|
||||
onChangeText={handleCodeChange}
|
||||
className="rounded-[14px] px-4 py-3.5 text-[15px]"
|
||||
style={{
|
||||
backgroundColor: props.palette.inputBackground,
|
||||
borderWidth: 1,
|
||||
borderColor: props.palette.inputBorder,
|
||||
color: props.palette.text,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{props.connectionError ? <ErrorBanner message={props.connectionError} /> : null}
|
||||
|
||||
<SheetButton
|
||||
icon="plus"
|
||||
label={props.connectionState === "connecting" ? "Pairing…" : "Add backend"}
|
||||
disabled={connectDisabled}
|
||||
palette={props.palette}
|
||||
tone="primary"
|
||||
onPress={props.onConnect}
|
||||
/>
|
||||
</BottomSheetScrollView>
|
||||
</BottomSheetView>
|
||||
</BottomSheetModal>
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Main connection sheet
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const ADD_MENU_ACTIONS = [
|
||||
{
|
||||
id: "scan_qr",
|
||||
title: "Scan QR Code",
|
||||
image: "qrcode.viewfinder",
|
||||
},
|
||||
{
|
||||
id: "enter_manually",
|
||||
title: "Enter Manually",
|
||||
image: "keyboard",
|
||||
},
|
||||
] as const;
|
||||
|
||||
export function ConnectionSheet(props: ConnectionSheetProps) {
|
||||
const router = useRouter();
|
||||
const insets = useSafeAreaInsets();
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makePalette(isDarkMode);
|
||||
const sheetRef = useRef<BottomSheetModal>(null);
|
||||
|
||||
const [editingEnvironment, setEditingEnvironment] =
|
||||
useState<ConnectedEnvironmentSummary | null>(null);
|
||||
const [addSheetVisible, setAddSheetVisible] = useState(false);
|
||||
const [addSheetStartWithScanner, setAddSheetStartWithScanner] = useState(false);
|
||||
const [editingEnvironment, setEditingEnvironment] = useState<ConnectedEnvironmentSummary | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
const dismissible = props.connectedEnvironments.length > 0;
|
||||
const hasEnvironments = props.connectedEnvironments.length > 0;
|
||||
|
||||
const snapPoints = useMemo<(string | number)[]>(
|
||||
() => [hasEnvironments ? "52%" : "38%"],
|
||||
[hasEnvironments],
|
||||
);
|
||||
|
||||
const renderBackdrop = useCallback(
|
||||
(backdropProps: React.ComponentProps<typeof BottomSheetBackdrop>) => (
|
||||
<BottomSheetBackdrop
|
||||
{...backdropProps}
|
||||
appearsOnIndex={0}
|
||||
disappearsOnIndex={-1}
|
||||
opacity={0.18}
|
||||
pressBehavior={dismissible ? "close" : "none"}
|
||||
/>
|
||||
),
|
||||
[dismissible],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const sheet = sheetRef.current;
|
||||
if (!sheet) return;
|
||||
if (props.visible) {
|
||||
sheet.present();
|
||||
} else {
|
||||
sheet.dismiss();
|
||||
}
|
||||
}, [props.visible]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!props.visible) {
|
||||
setEditingEnvironment(null);
|
||||
setAddSheetVisible(false);
|
||||
}
|
||||
}, [props.visible]);
|
||||
|
||||
// When there are no backends, open the add flow automatically
|
||||
useEffect(() => {
|
||||
if (props.visible && !dismissible) {
|
||||
setAddSheetStartWithScanner(false);
|
||||
setAddSheetVisible(true);
|
||||
}
|
||||
}, [props.visible, dismissible]);
|
||||
const handleAddPress = useCallback(() => {
|
||||
if (Platform.OS === "ios") {
|
||||
ActionSheetIOS.showActionSheetWithOptions(
|
||||
{
|
||||
cancelButtonIndex: 2,
|
||||
options: ["Scan QR Code", "Enter Manually", "Cancel"],
|
||||
title: "Add backend",
|
||||
},
|
||||
(buttonIndex) => {
|
||||
console.log("[connections sheet] add action", buttonIndex);
|
||||
|
||||
const handleMenuAction = useCallback(
|
||||
({ nativeEvent }: { nativeEvent: { event: string } }) => {
|
||||
if (nativeEvent.event === "scan_qr") {
|
||||
setAddSheetStartWithScanner(true);
|
||||
setAddSheetVisible(true);
|
||||
} else if (nativeEvent.event === "enter_manually") {
|
||||
setAddSheetStartWithScanner(false);
|
||||
setAddSheetVisible(true);
|
||||
}
|
||||
},
|
||||
[],
|
||||
);
|
||||
if (buttonIndex === 0) {
|
||||
router.push("/connections/new?mode=scan_qr");
|
||||
return;
|
||||
}
|
||||
|
||||
if (buttonIndex === 1) {
|
||||
router.push("/connections/new");
|
||||
}
|
||||
},
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
router.push("/connections/new");
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<BottomSheetModal
|
||||
ref={sheetRef}
|
||||
stackBehavior="push"
|
||||
index={0}
|
||||
snapPoints={snapPoints}
|
||||
enableDynamicSizing={false}
|
||||
enablePanDownToClose={dismissible}
|
||||
backdropComponent={renderBackdrop}
|
||||
onDismiss={props.onRequestClose}
|
||||
backgroundStyle={{ backgroundColor: palette.sheet }}
|
||||
handleIndicatorStyle={{ backgroundColor: "rgba(120,113,108,0.32)" }}
|
||||
>
|
||||
<BottomSheetView style={{ flex: 1 }}>
|
||||
<View style={{ flex: 1, backgroundColor: palette.sheet }}>
|
||||
<ScrollView
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
keyboardShouldPersistTaps="handled"
|
||||
showsVerticalScrollIndicator={false}
|
||||
contentContainerStyle={{
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 4,
|
||||
paddingBottom: Math.max(insets.bottom, 16) + 12,
|
||||
gap: 10,
|
||||
}}
|
||||
>
|
||||
{/* Header */}
|
||||
<View className="flex-row items-center justify-between px-5 pb-4 pt-1">
|
||||
<View className="flex-row items-center justify-between pb-4 pt-1">
|
||||
<View className="flex-1 gap-1">
|
||||
<Text
|
||||
className="text-[28px] font-t3-bold"
|
||||
@@ -902,110 +323,81 @@ export function ConnectionSheet(props: ConnectionSheetProps) {
|
||||
>
|
||||
Backends
|
||||
</Text>
|
||||
<Text
|
||||
className="text-[14px] leading-[20px]"
|
||||
style={{ color: palette.muted }}
|
||||
>
|
||||
<Text className="text-[14px] leading-[20px]" style={{ color: palette.muted }}>
|
||||
Manage your connected environments.
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{/* + button with native menu */}
|
||||
<MenuView actions={[...ADD_MENU_ACTIONS]} onPressAction={handleMenuAction}>
|
||||
<Pressable
|
||||
className="h-11 w-11 items-center justify-center rounded-full"
|
||||
style={{
|
||||
backgroundColor: palette.primaryButton,
|
||||
...Platform.select({
|
||||
ios: {
|
||||
shadowColor: "#000",
|
||||
shadowOffset: { width: 0, height: 2 },
|
||||
shadowOpacity: 0.12,
|
||||
shadowRadius: 4,
|
||||
},
|
||||
android: { elevation: 3 },
|
||||
}),
|
||||
}}
|
||||
>
|
||||
<SymbolView
|
||||
name="plus"
|
||||
size={18}
|
||||
tintColor={palette.primaryButtonText}
|
||||
type="monochrome"
|
||||
weight="semibold"
|
||||
/>
|
||||
</Pressable>
|
||||
</MenuView>
|
||||
<Pressable
|
||||
className="h-11 w-11 items-center justify-center rounded-full"
|
||||
style={{
|
||||
backgroundColor: palette.primaryButton,
|
||||
...Platform.select({
|
||||
ios: {
|
||||
shadowColor: "#000",
|
||||
shadowOffset: { width: 0, height: 2 },
|
||||
shadowOpacity: 0.12,
|
||||
shadowRadius: 4,
|
||||
},
|
||||
android: { elevation: 3 },
|
||||
}),
|
||||
}}
|
||||
onPress={handleAddPress}
|
||||
>
|
||||
<SymbolView
|
||||
name="plus"
|
||||
size={18}
|
||||
tintColor={palette.primaryButtonText}
|
||||
type="monochrome"
|
||||
weight="semibold"
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
|
||||
{/* Backend list */}
|
||||
<BottomSheetScrollView
|
||||
keyboardShouldPersistTaps="handled"
|
||||
showsVerticalScrollIndicator={false}
|
||||
contentContainerStyle={{
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 4,
|
||||
paddingBottom: Math.max(insets.bottom, 16) + 12,
|
||||
gap: 10,
|
||||
}}
|
||||
>
|
||||
{hasEnvironments ? (
|
||||
props.connectedEnvironments.map((environment) => (
|
||||
<EnvironmentCard
|
||||
key={environment.environmentId}
|
||||
environment={environment}
|
||||
palette={palette}
|
||||
onPress={() => setEditingEnvironment(environment)}
|
||||
onRemove={props.onRemoveEnvironment}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
{hasEnvironments ? (
|
||||
props.connectedEnvironments.map((environment) => (
|
||||
<EnvironmentCard
|
||||
key={environment.environmentId}
|
||||
environment={environment}
|
||||
palette={palette}
|
||||
onPress={() => setEditingEnvironment(environment)}
|
||||
onRemove={props.onRemoveEnvironment}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
<View
|
||||
className="items-center gap-3 rounded-[20px] px-6 py-8"
|
||||
style={{
|
||||
backgroundColor: palette.card,
|
||||
borderWidth: 1,
|
||||
borderColor: palette.border,
|
||||
}}
|
||||
>
|
||||
<View
|
||||
className="items-center gap-3 rounded-[20px] px-6 py-8"
|
||||
style={{
|
||||
backgroundColor: palette.card,
|
||||
borderWidth: 1,
|
||||
borderColor: palette.border,
|
||||
}}
|
||||
className="h-12 w-12 items-center justify-center rounded-[16px]"
|
||||
style={{ backgroundColor: palette.iconBg }}
|
||||
>
|
||||
<View
|
||||
className="h-12 w-12 items-center justify-center rounded-[16px]"
|
||||
style={{ backgroundColor: palette.iconBg }}
|
||||
>
|
||||
<SymbolView
|
||||
name="point.3.connected.trianglepath.dotted"
|
||||
size={20}
|
||||
tintColor={palette.accent}
|
||||
type="monochrome"
|
||||
/>
|
||||
</View>
|
||||
<Text
|
||||
className="text-center text-[14px] leading-[20px]"
|
||||
style={{ color: palette.muted }}
|
||||
>
|
||||
No backends connected yet.{"\n"}Tap{" "}
|
||||
<Text className="font-t3-bold" style={{ color: palette.text }}>
|
||||
+
|
||||
</Text>{" "}
|
||||
to add one.
|
||||
</Text>
|
||||
<SymbolView
|
||||
name="point.3.connected.trianglepath.dotted"
|
||||
size={20}
|
||||
tintColor={palette.accent}
|
||||
type="monochrome"
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
</BottomSheetScrollView>
|
||||
</BottomSheetView>
|
||||
|
||||
{/* Nested: Add backend */}
|
||||
<AddBackendSheet
|
||||
visible={addSheetVisible}
|
||||
startWithScanner={addSheetStartWithScanner}
|
||||
connectionState={props.connectionState}
|
||||
connectionError={props.connectionError}
|
||||
palette={palette}
|
||||
bottomInset={insets.bottom}
|
||||
onDismiss={() => setAddSheetVisible(false)}
|
||||
onChangePairingUrl={props.onChangePairingUrl}
|
||||
onConnect={props.onConnect}
|
||||
/>
|
||||
<Text
|
||||
className="text-center text-[14px] leading-[20px]"
|
||||
style={{ color: palette.muted }}
|
||||
>
|
||||
No backends connected yet.{"\n"}Tap{" "}
|
||||
<Text className="font-t3-bold" style={{ color: palette.text }}>
|
||||
+
|
||||
</Text>{" "}
|
||||
to add one.
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
</ScrollView>
|
||||
|
||||
{/* Nested: Edit backend */}
|
||||
<EnvironmentDetailSheet
|
||||
@@ -1018,6 +410,6 @@ export function ConnectionSheet(props: ConnectionSheetProps) {
|
||||
}}
|
||||
onRemove={props.onRemoveEnvironment}
|
||||
/>
|
||||
</BottomSheetModal>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
import { useRouter } from "expo-router";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useCallback, useState } from "react";
|
||||
import { Pressable, ScrollView, View, useColorScheme } from "react-native";
|
||||
import Animated, { FadeIn, FadeOut, LinearTransition } from "react-native-reanimated";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
import type { ConnectedEnvironmentSummary } from "../../state/use-remote-app-state";
|
||||
import { dismissRoute } from "../../lib/routes";
|
||||
import { ConnectionStatusDot } from "./ConnectionStatusDot";
|
||||
import { makeConnectionSheetPalette as makePalette } from "./connection-sheet-shared";
|
||||
|
||||
function EnvironmentRow(props: {
|
||||
readonly environment: ConnectedEnvironmentSummary;
|
||||
readonly expanded: boolean;
|
||||
readonly onToggle: () => void;
|
||||
readonly onRemove: (environmentId: string) => void;
|
||||
readonly onUpdate: (
|
||||
environmentId: string,
|
||||
updates: { readonly label: string; readonly displayUrl: string },
|
||||
) => void;
|
||||
readonly palette: ReturnType<typeof makePalette>;
|
||||
}) {
|
||||
const [label, setLabel] = useState(props.environment.environmentLabel);
|
||||
const [url, setUrl] = useState(props.environment.displayUrl);
|
||||
|
||||
const handleSave = useCallback(() => {
|
||||
props.onUpdate(props.environment.environmentId, {
|
||||
label: label.trim(),
|
||||
displayUrl: url.trim(),
|
||||
});
|
||||
props.onToggle();
|
||||
}, [label, url, props]);
|
||||
|
||||
return (
|
||||
<Animated.View
|
||||
layout={LinearTransition.duration(250)}
|
||||
style={{ backgroundColor: props.palette.card }}
|
||||
>
|
||||
<Pressable className="flex-row items-center gap-3 px-4 py-3.5" onPress={props.onToggle}>
|
||||
<ConnectionStatusDot state={props.environment.connectionState} pulse={false} size={8} />
|
||||
|
||||
<View className="flex-1 gap-0.5">
|
||||
<Text
|
||||
className="text-[16px] font-t3-bold leading-[21px]"
|
||||
style={{ color: props.palette.text }}
|
||||
numberOfLines={1}
|
||||
>
|
||||
{props.environment.environmentLabel}
|
||||
</Text>
|
||||
<Text
|
||||
className="text-[12px] leading-[16px]"
|
||||
style={{ color: props.palette.muted }}
|
||||
numberOfLines={1}
|
||||
>
|
||||
{props.environment.displayUrl}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<SymbolView
|
||||
name="chevron.down"
|
||||
size={12}
|
||||
tintColor={props.palette.muted}
|
||||
type="monochrome"
|
||||
style={{
|
||||
transform: [{ rotate: props.expanded ? "180deg" : "0deg" }],
|
||||
}}
|
||||
/>
|
||||
</Pressable>
|
||||
|
||||
{props.expanded ? (
|
||||
<Animated.View
|
||||
entering={FadeIn.duration(200)}
|
||||
exiting={FadeOut.duration(150)}
|
||||
className="gap-3 px-4 pb-4"
|
||||
>
|
||||
<View className="gap-1.5">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: props.palette.muted, letterSpacing: 0.8 }}
|
||||
>
|
||||
Label
|
||||
</Text>
|
||||
<TextInput
|
||||
autoCapitalize="words"
|
||||
autoCorrect={false}
|
||||
placeholder="My MacBook"
|
||||
placeholderTextColor={props.palette.placeholder}
|
||||
value={label}
|
||||
onChangeText={setLabel}
|
||||
className="rounded-[14px] px-4 py-3 text-[15px]"
|
||||
style={{
|
||||
backgroundColor: props.palette.inputBackground,
|
||||
borderWidth: 1,
|
||||
borderColor: props.palette.inputBorder,
|
||||
color: props.palette.text,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View className="gap-1.5">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: props.palette.muted, letterSpacing: 0.8 }}
|
||||
>
|
||||
URL
|
||||
</Text>
|
||||
<TextInput
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
keyboardType="url"
|
||||
placeholder="192.168.1.100:8080"
|
||||
placeholderTextColor={props.palette.placeholder}
|
||||
value={url}
|
||||
onChangeText={setUrl}
|
||||
className="rounded-[14px] px-4 py-3 text-[15px]"
|
||||
style={{
|
||||
backgroundColor: props.palette.inputBackground,
|
||||
borderWidth: 1,
|
||||
borderColor: props.palette.inputBorder,
|
||||
color: props.palette.text,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View className="flex-row gap-2">
|
||||
<Pressable
|
||||
className="min-h-[42px] flex-1 flex-row items-center justify-center gap-1.5 rounded-[14px] px-3.5 py-2.5"
|
||||
onPress={handleSave}
|
||||
style={{
|
||||
backgroundColor: props.palette.primaryButton,
|
||||
}}
|
||||
>
|
||||
<SymbolView
|
||||
name="checkmark"
|
||||
size={13}
|
||||
tintColor={props.palette.primaryButtonText}
|
||||
type="monochrome"
|
||||
/>
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{
|
||||
color: props.palette.primaryButtonText,
|
||||
letterSpacing: 0.8,
|
||||
}}
|
||||
>
|
||||
Save
|
||||
</Text>
|
||||
</Pressable>
|
||||
|
||||
<Pressable
|
||||
className="h-[42px] w-[42px] items-center justify-center rounded-[14px]"
|
||||
onPress={() => props.onRemove(props.environment.environmentId)}
|
||||
style={{
|
||||
backgroundColor: props.palette.dangerButton,
|
||||
borderWidth: 1,
|
||||
borderColor: props.palette.dangerBorder,
|
||||
}}
|
||||
>
|
||||
<SymbolView
|
||||
name="trash"
|
||||
size={14}
|
||||
tintColor={props.palette.dangerText}
|
||||
type="monochrome"
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
</Animated.View>
|
||||
) : null}
|
||||
</Animated.View>
|
||||
);
|
||||
}
|
||||
|
||||
export function ConnectionsRouteScreen() {
|
||||
const app = useRemoteApp();
|
||||
const router = useRouter();
|
||||
const insets = useSafeAreaInsets();
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makePalette(isDarkMode);
|
||||
const hasEnvironments = app.connectedEnvironments.length > 0;
|
||||
const [expandedId, setExpandedId] = useState<string | null>(null);
|
||||
|
||||
const handleToggle = useCallback((environmentId: string) => {
|
||||
setExpandedId((prev) => (prev === environmentId ? null : environmentId));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<View
|
||||
collapsable={false}
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: palette.sheet,
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 28,
|
||||
paddingBottom: Math.max(insets.bottom, 18) + 18,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-center justify-between pb-4 pt-1">
|
||||
<View className="flex-1 gap-1">
|
||||
<Text
|
||||
className="text-[28px] font-t3-bold"
|
||||
style={{ color: palette.text, letterSpacing: -0.3 }}
|
||||
>
|
||||
Backends
|
||||
</Text>
|
||||
<Text className="text-[14px] leading-[20px]" style={{ color: palette.muted }}>
|
||||
Manage your connected environments.
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<Pressable
|
||||
className="h-11 w-11 items-center justify-center rounded-full"
|
||||
onPress={() => router.push("/connections/new")}
|
||||
style={{
|
||||
backgroundColor: palette.primaryButton,
|
||||
}}
|
||||
>
|
||||
<SymbolView
|
||||
name="plus"
|
||||
size={18}
|
||||
tintColor={palette.primaryButtonText}
|
||||
type="monochrome"
|
||||
weight="semibold"
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
|
||||
<ScrollView
|
||||
showsVerticalScrollIndicator={false}
|
||||
style={{ flex: 1 }}
|
||||
contentContainerStyle={{ paddingBottom: 8 }}
|
||||
>
|
||||
{hasEnvironments ? (
|
||||
<View
|
||||
collapsable={false}
|
||||
className="overflow-hidden rounded-[24px]"
|
||||
style={{ backgroundColor: palette.card }}
|
||||
>
|
||||
{app.connectedEnvironments.map((environment, index) => (
|
||||
<View
|
||||
key={environment.environmentId}
|
||||
collapsable={false}
|
||||
style={{
|
||||
borderTopWidth: index === 0 ? 0 : 1,
|
||||
borderTopColor: palette.border,
|
||||
}}
|
||||
>
|
||||
<EnvironmentRow
|
||||
environment={environment}
|
||||
expanded={expandedId === environment.environmentId}
|
||||
onToggle={() => handleToggle(environment.environmentId)}
|
||||
onRemove={app.onRemoveEnvironmentPress}
|
||||
onUpdate={app.onUpdateEnvironment}
|
||||
palette={palette}
|
||||
/>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
) : (
|
||||
<View
|
||||
collapsable={false}
|
||||
className="items-center gap-3 rounded-[24px] px-6 py-8"
|
||||
style={{ backgroundColor: palette.card }}
|
||||
>
|
||||
<View
|
||||
className="h-12 w-12 items-center justify-center rounded-[16px]"
|
||||
style={{ backgroundColor: palette.iconBg }}
|
||||
>
|
||||
<SymbolView
|
||||
name="point.3.connected.trianglepath.dotted"
|
||||
size={20}
|
||||
tintColor={palette.accent}
|
||||
type="monochrome"
|
||||
/>
|
||||
</View>
|
||||
<Text
|
||||
className="text-center text-[14px] leading-[20px]"
|
||||
style={{ color: palette.muted }}
|
||||
>
|
||||
No backends connected yet.{"\n"}Tap{" "}
|
||||
<Text className="font-t3-bold" style={{ color: palette.text }}>
|
||||
+
|
||||
</Text>{" "}
|
||||
to add one.
|
||||
</Text>
|
||||
</View>
|
||||
)}
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
import { CameraView, useCameraPermissions } from "expo-camera";
|
||||
import { useLocalSearchParams, useRouter } from "expo-router";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Alert, Pressable, View, useColorScheme } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
|
||||
import { ErrorBanner } from "../../components/ErrorBanner";
|
||||
import { dismissRoute } from "../../lib/routes";
|
||||
import { extractPairingUrlFromQrPayload } from "../../lib/pairingQr";
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
import {
|
||||
buildPairingUrl,
|
||||
ConnectionSheetButton as SheetButton,
|
||||
makeConnectionSheetPalette as makePalette,
|
||||
parsePairingUrl,
|
||||
} from "./connection-sheet-shared";
|
||||
|
||||
export function NewConnectionRouteScreen() {
|
||||
const app = useRemoteApp();
|
||||
const router = useRouter();
|
||||
const params = useLocalSearchParams<{ mode?: string }>();
|
||||
const insets = useSafeAreaInsets();
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makePalette(isDarkMode);
|
||||
const [hostInput, setHostInput] = useState("");
|
||||
const [codeInput, setCodeInput] = useState("");
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const [showScanner, setShowScanner] = useState(params.mode === "scan_qr");
|
||||
const [cameraPermission, requestCameraPermission] = useCameraPermissions();
|
||||
const [scannerLocked, setScannerLocked] = useState(false);
|
||||
|
||||
const connectDisabled =
|
||||
isSubmitting || app.connectionState === "connecting" || hostInput.trim().length === 0;
|
||||
|
||||
useEffect(() => {
|
||||
const { host, code } = parsePairingUrl(app.connectionInput.pairingUrl);
|
||||
setHostInput(host);
|
||||
setCodeInput(code);
|
||||
}, [app.connectionInput.pairingUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
if (app.connectionError) {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
}, [app.connectionError]);
|
||||
|
||||
const handleHostChange = useCallback((value: string) => {
|
||||
setHostInput(value);
|
||||
}, []);
|
||||
|
||||
const handleCodeChange = useCallback((value: string) => {
|
||||
setCodeInput(value);
|
||||
}, []);
|
||||
|
||||
const openScanner = useCallback(async () => {
|
||||
if (cameraPermission?.granted) {
|
||||
setScannerLocked(false);
|
||||
setShowScanner(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const permission = await requestCameraPermission();
|
||||
if (permission.granted) {
|
||||
setScannerLocked(false);
|
||||
setShowScanner(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Alert.alert("Camera access needed", "Allow camera access to scan a backend pairing QR code.");
|
||||
}, [cameraPermission?.granted, requestCameraPermission]);
|
||||
|
||||
const closeScanner = useCallback(() => {
|
||||
setShowScanner(false);
|
||||
setScannerLocked(false);
|
||||
}, []);
|
||||
|
||||
const handleQrScan = useCallback(
|
||||
({ data }: { readonly data: string }) => {
|
||||
if (scannerLocked) {
|
||||
return;
|
||||
}
|
||||
|
||||
setScannerLocked(true);
|
||||
|
||||
try {
|
||||
const pairingUrl = extractPairingUrlFromQrPayload(data);
|
||||
const { host, code } = parsePairingUrl(pairingUrl);
|
||||
setHostInput(host);
|
||||
setCodeInput(code);
|
||||
app.onChangeConnectionPairingUrl(pairingUrl);
|
||||
setShowScanner(false);
|
||||
} catch (error) {
|
||||
Alert.alert(
|
||||
"Invalid QR code",
|
||||
error instanceof Error ? error.message : "Scanned QR code was not recognized.",
|
||||
);
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
setScannerLocked(false);
|
||||
}, 600);
|
||||
}
|
||||
},
|
||||
[app, scannerLocked],
|
||||
);
|
||||
|
||||
const handleSubmit = useCallback(async () => {
|
||||
setIsSubmitting(true);
|
||||
|
||||
try {
|
||||
const pairingUrl = buildPairingUrl(hostInput, codeInput);
|
||||
app.onChangeConnectionPairingUrl(pairingUrl);
|
||||
await app.onConnectPress(pairingUrl);
|
||||
dismissRoute(router);
|
||||
} catch {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
}, [app, codeInput, hostInput, router]);
|
||||
|
||||
return (
|
||||
<View
|
||||
collapsable={false}
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: palette.sheet,
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 28,
|
||||
paddingBottom: Math.max(insets.bottom, 18) + 18,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-3 pb-4">
|
||||
<View className="flex-1">
|
||||
<Text
|
||||
className="text-[24px] font-t3-bold"
|
||||
style={{ color: palette.text, letterSpacing: -0.2 }}
|
||||
>
|
||||
Add backend
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<Pressable
|
||||
className="h-11 w-11 items-center justify-center rounded-full"
|
||||
onPress={() => {
|
||||
if (showScanner) {
|
||||
closeScanner();
|
||||
} else {
|
||||
void openScanner();
|
||||
}
|
||||
}}
|
||||
style={{
|
||||
backgroundColor: palette.secondaryButton,
|
||||
borderWidth: 1,
|
||||
borderColor: palette.border,
|
||||
}}
|
||||
>
|
||||
<SymbolView
|
||||
name={showScanner ? "xmark" : "qrcode.viewfinder"}
|
||||
size={showScanner ? 14 : 18}
|
||||
tintColor={palette.text}
|
||||
type="monochrome"
|
||||
weight="semibold"
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
|
||||
<View
|
||||
collapsable={false}
|
||||
style={{
|
||||
flex: 1,
|
||||
paddingBottom: 8,
|
||||
}}
|
||||
>
|
||||
<View collapsable={false} className="gap-5">
|
||||
{showScanner ? (
|
||||
cameraPermission?.granted ? (
|
||||
<View className="overflow-hidden rounded-[24px]" style={{ borderCurve: "continuous" }}>
|
||||
<CameraView
|
||||
barcodeScannerSettings={{ barcodeTypes: ["qr"] }}
|
||||
onBarcodeScanned={handleQrScan}
|
||||
style={{ aspectRatio: 1, width: "100%" }}
|
||||
/>
|
||||
</View>
|
||||
) : (
|
||||
<View
|
||||
className="items-center gap-3 rounded-[24px] px-5 py-8"
|
||||
style={{ backgroundColor: palette.card, borderCurve: "continuous" }}
|
||||
>
|
||||
<Text
|
||||
className="text-center text-[14px] leading-[20px]"
|
||||
style={{ color: palette.muted }}
|
||||
>
|
||||
Camera permission is required to scan a QR code.
|
||||
</Text>
|
||||
<SheetButton
|
||||
compact
|
||||
icon="camera"
|
||||
label="Allow camera"
|
||||
palette={palette}
|
||||
tone="secondary"
|
||||
onPress={() => {
|
||||
void openScanner();
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
) : (
|
||||
<View
|
||||
collapsable={false}
|
||||
className="gap-4 rounded-[24px] p-4"
|
||||
style={{ backgroundColor: palette.card }}
|
||||
>
|
||||
<View collapsable={false} className="gap-1.5">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: palette.muted, letterSpacing: 0.8 }}
|
||||
>
|
||||
Host
|
||||
</Text>
|
||||
<TextInput
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
keyboardType="url"
|
||||
placeholder="192.168.1.100:8080"
|
||||
placeholderTextColor={palette.placeholder}
|
||||
value={hostInput}
|
||||
onChangeText={handleHostChange}
|
||||
className="rounded-[14px] px-4 py-3.5 text-[15px]"
|
||||
style={{
|
||||
backgroundColor: palette.inputBackground,
|
||||
borderWidth: 1,
|
||||
borderColor: palette.inputBorder,
|
||||
color: palette.text,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View collapsable={false} className="gap-1.5">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: palette.muted, letterSpacing: 0.8 }}
|
||||
>
|
||||
Pairing code
|
||||
</Text>
|
||||
<TextInput
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
placeholder="abc-123-xyz"
|
||||
placeholderTextColor={palette.placeholder}
|
||||
value={codeInput}
|
||||
onChangeText={handleCodeChange}
|
||||
className="rounded-[14px] px-4 py-3.5 text-[15px]"
|
||||
style={{
|
||||
backgroundColor: palette.inputBackground,
|
||||
borderWidth: 1,
|
||||
borderColor: palette.inputBorder,
|
||||
color: palette.text,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{app.connectionError ? <ErrorBanner message={app.connectionError} /> : null}
|
||||
|
||||
<SheetButton
|
||||
icon="plus"
|
||||
label={
|
||||
isSubmitting || app.connectionState === "connecting" ? "Pairing…" : "Add backend"
|
||||
}
|
||||
disabled={connectDisabled}
|
||||
palette={palette}
|
||||
tone="primary"
|
||||
onPress={() => {
|
||||
void handleSubmit();
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { Platform, Pressable } from "react-native";
|
||||
|
||||
import { AppText as Text } from "../../components/AppText";
|
||||
|
||||
export function parsePairingUrl(url: string): { host: string; code: string } {
|
||||
const trimmed = url.trim();
|
||||
if (!trimmed) return { host: "", code: "" };
|
||||
|
||||
try {
|
||||
const parsed = new URL(trimmed);
|
||||
const hashParams = new URLSearchParams(parsed.hash.slice(1));
|
||||
const hashToken = hashParams.get("token");
|
||||
const queryToken = parsed.searchParams.get("token");
|
||||
const code = hashToken || queryToken || "";
|
||||
|
||||
parsed.hash = "";
|
||||
parsed.search = "";
|
||||
parsed.pathname = "/";
|
||||
return { host: parsed.toString().replace(/\/$/, ""), code };
|
||||
} catch {
|
||||
return { host: trimmed, code: "" };
|
||||
}
|
||||
}
|
||||
|
||||
export function buildPairingUrl(host: string, code: string): string {
|
||||
const h = host.trim();
|
||||
const c = code.trim();
|
||||
if (!h) return "";
|
||||
if (!c) return h;
|
||||
|
||||
try {
|
||||
const url = new URL(h.includes("://") ? h : `https://${h}`);
|
||||
url.hash = new URLSearchParams([["token", c]]).toString();
|
||||
return url.toString();
|
||||
} catch {
|
||||
return `${h}#token=${c}`;
|
||||
}
|
||||
}
|
||||
|
||||
export function makeConnectionSheetPalette(isDarkMode: boolean) {
|
||||
if (isDarkMode) {
|
||||
return {
|
||||
sheet: "rgba(18,20,23,0.98)",
|
||||
card: "#1f2329",
|
||||
cardAlt: "#242a31",
|
||||
border: "rgba(255,255,255,0.06)",
|
||||
text: "#f8fafc",
|
||||
muted: "#94a3b8",
|
||||
subtle: "#cbd5e1",
|
||||
accent: "#f59e0b",
|
||||
accentSubtle: "rgba(245,158,11,0.12)",
|
||||
iconBg: "rgba(245,158,11,0.10)",
|
||||
inputBackground: "#171b20",
|
||||
inputBorder: "rgba(255,255,255,0.06)",
|
||||
primaryButton: "#f8fafc",
|
||||
primaryButtonText: "#171717",
|
||||
secondaryButton: "rgba(255,255,255,0.05)",
|
||||
secondaryButtonText: "#f8fafc",
|
||||
dangerButton: "rgba(190,24,93,0.14)",
|
||||
dangerBorder: "rgba(244,114,182,0.18)",
|
||||
dangerText: "#fda4af",
|
||||
placeholder: "#64748b",
|
||||
cardShadow: {
|
||||
shadowColor: "#000",
|
||||
shadowOffset: { width: 0, height: 2 },
|
||||
shadowOpacity: 0.18,
|
||||
shadowRadius: 8,
|
||||
elevation: 4,
|
||||
} as const,
|
||||
separator: "rgba(255,255,255,0.04)",
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
sheet: "rgba(246,244,239,0.98)",
|
||||
card: "#fffdf9",
|
||||
cardAlt: "#f8f4ec",
|
||||
border: "rgba(23,23,23,0.06)",
|
||||
text: "#171717",
|
||||
muted: "#78716c",
|
||||
subtle: "#57534e",
|
||||
accent: "#a16207",
|
||||
accentSubtle: "rgba(161,98,7,0.08)",
|
||||
iconBg: "rgba(161,98,7,0.07)",
|
||||
inputBackground: "#ffffff",
|
||||
inputBorder: "rgba(23,23,23,0.06)",
|
||||
primaryButton: "#171717",
|
||||
primaryButtonText: "#fafaf9",
|
||||
secondaryButton: "#f1ece3",
|
||||
secondaryButtonText: "#171717",
|
||||
dangerButton: "#fff1f2",
|
||||
dangerBorder: "rgba(225,29,72,0.10)",
|
||||
dangerText: "#be123c",
|
||||
placeholder: "#94a3b8",
|
||||
cardShadow: {
|
||||
shadowColor: "rgba(23,23,23,0.08)",
|
||||
shadowOffset: { width: 0, height: 4 },
|
||||
shadowOpacity: 1,
|
||||
shadowRadius: 16,
|
||||
elevation: 3,
|
||||
} as const,
|
||||
separator: "rgba(23,23,23,0.04)",
|
||||
};
|
||||
}
|
||||
|
||||
export type ConnectionSheetPalette = ReturnType<typeof makeConnectionSheetPalette>;
|
||||
|
||||
export function ConnectionSheetButton(props: {
|
||||
readonly icon: React.ComponentProps<typeof SymbolView>["name"];
|
||||
readonly label: string;
|
||||
readonly disabled?: boolean;
|
||||
readonly tone?: "primary" | "secondary" | "danger";
|
||||
readonly compact?: boolean;
|
||||
readonly palette: ConnectionSheetPalette;
|
||||
readonly onPress: () => void;
|
||||
}) {
|
||||
const tone = props.tone ?? "secondary";
|
||||
const colors =
|
||||
tone === "primary"
|
||||
? {
|
||||
backgroundColor: props.palette.primaryButton,
|
||||
borderColor: "transparent",
|
||||
textColor: props.palette.primaryButtonText,
|
||||
}
|
||||
: tone === "danger"
|
||||
? {
|
||||
backgroundColor: props.palette.dangerButton,
|
||||
borderColor: props.palette.dangerBorder,
|
||||
textColor: props.palette.dangerText,
|
||||
}
|
||||
: {
|
||||
backgroundColor: props.palette.secondaryButton,
|
||||
borderColor: props.palette.border,
|
||||
textColor: props.palette.secondaryButtonText,
|
||||
};
|
||||
|
||||
const primaryShadow =
|
||||
tone === "primary"
|
||||
? Platform.select({
|
||||
ios: {
|
||||
shadowColor: "#000",
|
||||
shadowOffset: { width: 0, height: 3 },
|
||||
shadowOpacity: 0.14,
|
||||
shadowRadius: 6,
|
||||
},
|
||||
android: { elevation: 3 },
|
||||
})
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
className={
|
||||
props.compact
|
||||
? "min-h-[42px] flex-row items-center justify-center gap-1.5 rounded-[14px] px-3.5 py-2.5"
|
||||
: "min-h-[48px] flex-row items-center justify-center gap-2 rounded-[16px] px-4 py-3"
|
||||
}
|
||||
disabled={props.disabled}
|
||||
onPress={props.onPress}
|
||||
style={[
|
||||
{
|
||||
backgroundColor: colors.backgroundColor,
|
||||
borderWidth: tone === "primary" ? 0 : 1,
|
||||
borderColor: colors.borderColor,
|
||||
opacity: props.disabled ? 0.5 : 1,
|
||||
},
|
||||
primaryShadow,
|
||||
]}
|
||||
>
|
||||
<SymbolView
|
||||
name={props.icon}
|
||||
size={props.compact ? 13 : 14}
|
||||
tintColor={colors.textColor}
|
||||
type="monochrome"
|
||||
/>
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: colors.textColor, letterSpacing: 0.8 }}
|
||||
>
|
||||
{props.label}
|
||||
</Text>
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import { Stack, useFocusEffect, useRouter } from "expo-router";
|
||||
import { useCallback } from "react";
|
||||
import { Platform, Pressable, useColorScheme } from "react-native";
|
||||
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { ConnectionStatusDot } from "../../features/connection/ConnectionStatusDot";
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
import { buildThreadRoutePath } from "../../lib/routes";
|
||||
import { HomeScreen } from "./HomeScreen";
|
||||
|
||||
export function HomeRouteScreen() {
|
||||
const app = useRemoteApp();
|
||||
const router = useRouter();
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const useNativeToolbar = Platform.OS === "ios";
|
||||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
app.onBackFromThread();
|
||||
}, [app]),
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{useNativeToolbar ? (
|
||||
<>
|
||||
<Stack.Toolbar placement="right">
|
||||
<Stack.Toolbar.View>
|
||||
<Pressable
|
||||
accessibilityLabel="Open backends"
|
||||
accessibilityRole="button"
|
||||
className="h-11 w-11 items-center justify-center rounded-full"
|
||||
onPress={() => router.push("/connections")}
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
>
|
||||
<ConnectionStatusDot state={app.connectionState} pulse={app.hasRemoteActivity} />
|
||||
</Pressable>
|
||||
</Stack.Toolbar.View>
|
||||
</Stack.Toolbar>
|
||||
<Stack.Toolbar>
|
||||
<Stack.Toolbar.Spacer />
|
||||
<Stack.Toolbar.Button icon="square.and.pencil" onPress={() => router.push("/new")}>
|
||||
New task
|
||||
</Stack.Toolbar.Button>
|
||||
</Stack.Toolbar>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<HomeScreen
|
||||
projects={app.projects}
|
||||
threads={app.threads}
|
||||
connectionState={app.connectionState}
|
||||
connectionPulse={app.hasRemoteActivity}
|
||||
onOpenConnectionEditor={() => router.push("/connections")}
|
||||
onOpenNewTask={() => router.push("/new")}
|
||||
onSelectThread={(thread) => {
|
||||
app.onSelectThread(thread);
|
||||
router.push(buildThreadRoutePath(thread));
|
||||
}}
|
||||
showFloatingConnectionButton={!useNativeToolbar}
|
||||
showFloatingNewTaskButton={!useNativeToolbar}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useMemo } from "react";
|
||||
import { Pressable, ScrollView, View } from "react-native";
|
||||
import { Pressable, ScrollView, useColorScheme, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import Svg, { Path } from "react-native-svg";
|
||||
|
||||
import { AppText as Text } from "../../components/AppText";
|
||||
import { EmptyState } from "../../components/EmptyState";
|
||||
@@ -10,9 +11,24 @@ import { groupProjectsByRepository } from "../../lib/repositoryGroups";
|
||||
import type { ScopedMobileProject, ScopedMobileThread } from "../../lib/scopedEntities";
|
||||
import { scopedProjectKey } from "../../lib/scopedEntities";
|
||||
import { relativeTime } from "../../lib/time";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { ConnectionStatusDot } from "../connection/ConnectionStatusDot";
|
||||
import { threadStatusTone } from "../threads/threadPresentation";
|
||||
|
||||
function T3Wordmark(props: { readonly fill: string }) {
|
||||
return (
|
||||
<Svg
|
||||
viewBox="15.5309 37 94.3941 56.96"
|
||||
style={{ height: 16, width: 24 }}
|
||||
>
|
||||
<Path
|
||||
d="M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z"
|
||||
fill={props.fill}
|
||||
/>
|
||||
</Svg>
|
||||
);
|
||||
}
|
||||
|
||||
export function HomeScreen(props: {
|
||||
readonly projects: ReadonlyArray<ScopedMobileProject>;
|
||||
readonly threads: ReadonlyArray<ScopedMobileThread>;
|
||||
@@ -21,7 +37,11 @@ export function HomeScreen(props: {
|
||||
readonly onOpenConnectionEditor: () => void;
|
||||
readonly onOpenNewTask: () => void;
|
||||
readonly onSelectThread: (thread: ScopedMobileThread) => void;
|
||||
readonly showFloatingConnectionButton: boolean;
|
||||
readonly showFloatingNewTaskButton: boolean;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const repositoryGroups = useMemo(
|
||||
() => groupProjectsByRepository({ projects: props.projects, threads: props.threads }),
|
||||
@@ -50,37 +70,63 @@ export function HomeScreen(props: {
|
||||
}, [repositoryGroups]);
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor: "#f6f4ef" }}>
|
||||
<View style={{ flex: 1, backgroundColor: palette.screenBackground }}>
|
||||
<ScrollView
|
||||
showsVerticalScrollIndicator={false}
|
||||
contentContainerStyle={{
|
||||
paddingBottom: Math.max(insets.bottom, 24) + 92,
|
||||
paddingBottom: Math.max(insets.bottom, 24) + (props.showFloatingNewTaskButton ? 92 : 24),
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: insets.top + 6,
|
||||
gap: 16,
|
||||
paddingTop: insets.top + 16,
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-center justify-between">
|
||||
<Text className="text-[34px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
Recents
|
||||
</Text>
|
||||
<View className="flex-row items-center gap-2">
|
||||
<T3Wordmark fill={palette.wordmarkFill} />
|
||||
<Text
|
||||
className="text-[18px] font-medium"
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
Code
|
||||
</Text>
|
||||
<View
|
||||
className="rounded-[6px] px-2 py-0.5"
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: palette.textMuted, letterSpacing: 0.8 }}
|
||||
>
|
||||
Alpha
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<Pressable
|
||||
onPress={props.onOpenConnectionEditor}
|
||||
className="h-14 min-w-[56px] items-center justify-center rounded-full px-4"
|
||||
style={{ backgroundColor: "rgba(255,255,255,0.9)" }}
|
||||
>
|
||||
<ConnectionStatusDot state={props.connectionState} pulse={props.connectionPulse} />
|
||||
</Pressable>
|
||||
{props.showFloatingConnectionButton ? (
|
||||
<Pressable
|
||||
onPress={props.onOpenConnectionEditor}
|
||||
className="h-10 w-10 items-center justify-center rounded-full"
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
>
|
||||
<ConnectionStatusDot state={props.connectionState} pulse={props.connectionPulse} />
|
||||
</Pressable>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
<Text
|
||||
className="text-[28px] font-t3-bold"
|
||||
style={{ color: palette.text, letterSpacing: -0.3 }}
|
||||
>
|
||||
Recents
|
||||
</Text>
|
||||
|
||||
{props.threads.length === 0 ? (
|
||||
<EmptyState
|
||||
title="No threads yet"
|
||||
detail="Create a task to start a new coding session in one of your connected projects."
|
||||
/>
|
||||
) : (
|
||||
<View className="overflow-hidden rounded-[24px]" style={{ backgroundColor: "#ffffff" }}>
|
||||
<View className="overflow-hidden rounded-[24px]" style={{ backgroundColor: palette.card }}>
|
||||
{props.threads.map((thread, index) => {
|
||||
const projectKey = scopedProjectKey(thread.environmentId, thread.projectId);
|
||||
const projectLabel = projectLabelsByKey.get(projectKey);
|
||||
@@ -93,7 +139,7 @@ export function HomeScreen(props: {
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 13,
|
||||
borderTopWidth: index === 0 ? 0 : 1,
|
||||
borderTopColor: "rgba(23,23,23,0.06)",
|
||||
borderTopColor: palette.borderSubtle,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-3">
|
||||
@@ -101,7 +147,7 @@ export function HomeScreen(props: {
|
||||
<Text
|
||||
className="text-[17px] font-t3-bold leading-[24px]"
|
||||
numberOfLines={2}
|
||||
style={{ color: "#171717" }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
{thread.title}
|
||||
</Text>
|
||||
@@ -114,25 +160,25 @@ export function HomeScreen(props: {
|
||||
<Text
|
||||
className="text-[13px] font-medium leading-[18px]"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#57534e", flexShrink: 1 }}
|
||||
style={{ color: palette.textSecondary, flexShrink: 1 }}
|
||||
>
|
||||
{projectLabel?.projectTitle ?? thread.title}
|
||||
</Text>
|
||||
<View
|
||||
className="h-1 w-1 rounded-full"
|
||||
style={{ backgroundColor: "rgba(120,113,108,0.45)" }}
|
||||
style={{ backgroundColor: palette.dotSeparator }}
|
||||
/>
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase tracking-[0.4px]"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#78716c", flexShrink: 1 }}
|
||||
style={{ color: palette.textMuted, flexShrink: 1 }}
|
||||
>
|
||||
{projectLabel?.environmentLabel ?? "Local"}
|
||||
</Text>
|
||||
</View>
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold"
|
||||
style={{ color: "#78716c", fontVariant: ["tabular-nums"] }}
|
||||
style={{ color: palette.textMuted, fontVariant: ["tabular-nums"] }}
|
||||
>
|
||||
{relativeTime(thread.updatedAt ?? thread.createdAt)}
|
||||
</Text>
|
||||
@@ -144,28 +190,30 @@ export function HomeScreen(props: {
|
||||
)}
|
||||
</ScrollView>
|
||||
|
||||
<View
|
||||
pointerEvents="box-none"
|
||||
style={{
|
||||
position: "absolute",
|
||||
right: 20,
|
||||
bottom: Math.max(insets.bottom, 18),
|
||||
}}
|
||||
>
|
||||
<Pressable
|
||||
onPress={props.onOpenNewTask}
|
||||
className="flex-row items-center gap-3 rounded-full px-6 py-4"
|
||||
{props.showFloatingNewTaskButton ? (
|
||||
<View
|
||||
pointerEvents="box-none"
|
||||
style={{
|
||||
backgroundColor: "#171717",
|
||||
boxShadow: "0 20px 36px rgba(23,23,23,0.18)",
|
||||
position: "absolute",
|
||||
right: 20,
|
||||
bottom: Math.max(insets.bottom, 18),
|
||||
}}
|
||||
>
|
||||
<SymbolView name="square.and.pencil" size={20} tintColor="#fafaf9" type="monochrome" />
|
||||
<Text className="text-[18px] font-t3-bold" style={{ color: "#fafaf9" }}>
|
||||
New task
|
||||
</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
<Pressable
|
||||
onPress={props.onOpenNewTask}
|
||||
className="flex-row items-center gap-3 rounded-full px-6 py-4"
|
||||
style={{
|
||||
backgroundColor: palette.primaryButton,
|
||||
boxShadow: `0 20px 36px ${palette.primaryButtonShadow}`,
|
||||
}}
|
||||
>
|
||||
<SymbolView name="square.and.pencil" size={20} tintColor={palette.primaryButtonText} type="monochrome" />
|
||||
<Text className="text-[18px] font-t3-bold" style={{ color: palette.primaryButtonText }}>
|
||||
New task
|
||||
</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,600 @@
|
||||
import type { ComponentProps, ReactNode } from "react";
|
||||
import { MenuView } from "@react-native-menu/menu";
|
||||
import { useRouter } from "expo-router";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { Image, Pressable, ScrollView, useColorScheme, View } from "react-native";
|
||||
import Animated, { useAnimatedKeyboard, useAnimatedStyle } from "react-native-reanimated";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import type { ModelSelection } from "@t3tools/contracts";
|
||||
import { CLAUDE_CODE_EFFORT_OPTIONS } from "@t3tools/contracts";
|
||||
|
||||
import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
|
||||
import { ProviderIcon } from "../../components/ProviderIcon";
|
||||
|
||||
import {
|
||||
type DraftComposerImageAttachment,
|
||||
convertPastedImagesToAttachments,
|
||||
pickComposerImages,
|
||||
} from "../../lib/composerImages";
|
||||
import { buildThreadRoutePath } from "../../lib/routes";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
import { branchBadgeLabel } from "./new-task-flow-provider";
|
||||
import { useNewTaskFlow } from "./new-task-flow-provider";
|
||||
import { PasteEventPayload, TextInputWrapper } from "expo-paste-input";
|
||||
|
||||
function ControlPill(props: {
|
||||
readonly icon?: ComponentProps<typeof SymbolView>["name"];
|
||||
readonly iconNode?: ReactNode;
|
||||
readonly label?: string;
|
||||
readonly onPress?: () => void;
|
||||
readonly variant?: "circle" | "pill" | "primary";
|
||||
readonly disabled?: boolean;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const variant = props.variant ?? "circle";
|
||||
const backgroundColor =
|
||||
variant === "primary"
|
||||
? props.disabled
|
||||
? palette.subtleBgStrong
|
||||
: palette.primaryButton
|
||||
: palette.subtleBg;
|
||||
const iconTintColor = variant === "primary" ? palette.primaryButtonText : palette.icon;
|
||||
const textColor = variant === "primary" ? palette.primaryButtonText : palette.text;
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
onPress={props.onPress}
|
||||
disabled={props.disabled}
|
||||
className={
|
||||
variant === "circle"
|
||||
? "h-11 w-11 items-center justify-center rounded-full"
|
||||
: variant === "primary"
|
||||
? "h-11 flex-row items-center justify-center gap-2 rounded-full px-5"
|
||||
: "h-11 flex-row items-center justify-center gap-2 rounded-full px-3.5"
|
||||
}
|
||||
style={{ backgroundColor }}
|
||||
>
|
||||
{props.iconNode ? (
|
||||
<View className="h-4 w-4 items-center justify-center">{props.iconNode}</View>
|
||||
) : props.icon ? (
|
||||
<SymbolView name={props.icon} size={16} tintColor={iconTintColor} type="monochrome" />
|
||||
) : null}
|
||||
{props.label ? (
|
||||
<Text className="text-center text-[12px] font-t3-bold" style={{ color: textColor }}>
|
||||
{props.label}
|
||||
</Text>
|
||||
) : null}
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
|
||||
export function NewTaskDraftScreen(props: {
|
||||
readonly initialProjectRef?: {
|
||||
readonly environmentId?: string;
|
||||
readonly projectId?: string;
|
||||
};
|
||||
}) {
|
||||
const app = useRemoteApp();
|
||||
const flow = useNewTaskFlow();
|
||||
const router = useRouter();
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const keyboard = useAnimatedKeyboard();
|
||||
const containerAnimatedStyle = useAnimatedStyle(() => ({
|
||||
paddingBottom: keyboard.height.value,
|
||||
}));
|
||||
const controlsBottomPadding = useAnimatedStyle(() => ({
|
||||
paddingBottom: keyboard.height.value > 0 ? 4 : Math.max(insets.bottom, 10),
|
||||
}));
|
||||
const { logicalProjects, selectedProject, setProject } = flow;
|
||||
|
||||
useEffect(() => {
|
||||
if (props.initialProjectRef?.environmentId && props.initialProjectRef?.projectId) {
|
||||
const directProject =
|
||||
app.projects.find(
|
||||
(project) =>
|
||||
project.environmentId === props.initialProjectRef?.environmentId &&
|
||||
project.id === props.initialProjectRef?.projectId,
|
||||
) ?? null;
|
||||
|
||||
if (directProject) {
|
||||
setProject(directProject);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedProject) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (logicalProjects.length === 1) {
|
||||
setProject(logicalProjects[0]!.project);
|
||||
return;
|
||||
}
|
||||
|
||||
router.replace("/new");
|
||||
}, [
|
||||
app.projects,
|
||||
logicalProjects,
|
||||
props.initialProjectRef?.environmentId,
|
||||
props.initialProjectRef?.projectId,
|
||||
router,
|
||||
selectedProject,
|
||||
setProject,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!selectedProject) {
|
||||
return;
|
||||
}
|
||||
void flow.loadBranches();
|
||||
}, [flow, selectedProject]);
|
||||
|
||||
const environmentMenuActions = useMemo(
|
||||
() =>
|
||||
flow.environments.map((environment) => ({
|
||||
id: `environment:${environment.environmentId}`,
|
||||
title: environment.environmentLabel,
|
||||
state:
|
||||
flow.selectedEnvironmentId === environment.environmentId ? ("on" as const) : undefined,
|
||||
})),
|
||||
[flow.environments, flow.selectedEnvironmentId],
|
||||
);
|
||||
|
||||
const modelMenuActions = useMemo(
|
||||
() =>
|
||||
flow.providerGroups.map((group) => ({
|
||||
id: `provider:${group.providerKey}`,
|
||||
title: group.providerLabel,
|
||||
subtitle: group.models.find(
|
||||
(model) =>
|
||||
flow.selectedModel &&
|
||||
model.selection.provider === flow.selectedModel.provider &&
|
||||
model.selection.model === flow.selectedModel.model,
|
||||
)?.label,
|
||||
subactions: group.models.map((option) => ({
|
||||
id: `model:${option.key}`,
|
||||
title: option.label,
|
||||
state:
|
||||
flow.selectedModel &&
|
||||
option.selection.provider === flow.selectedModel.provider &&
|
||||
option.selection.model === flow.selectedModel.model
|
||||
? ("on" as const)
|
||||
: undefined,
|
||||
})),
|
||||
})),
|
||||
[flow.providerGroups, flow.selectedModel],
|
||||
);
|
||||
|
||||
const optionsMenuActions = useMemo(
|
||||
() => [
|
||||
{
|
||||
id: "options-effort",
|
||||
title: "Effort",
|
||||
subtitle: `${flow.effort.charAt(0).toUpperCase()}${flow.effort.slice(1)}`,
|
||||
subactions: CLAUDE_CODE_EFFORT_OPTIONS.map((level) => ({
|
||||
id: `options:effort:${level}`,
|
||||
title: `${level}${level === "high" ? " (default)" : ""}`,
|
||||
state: flow.effort === level ? ("on" as const) : undefined,
|
||||
})),
|
||||
},
|
||||
{
|
||||
id: "options-fast-mode",
|
||||
title: "Fast Mode",
|
||||
subtitle: flow.fastMode ? "On" : "Off",
|
||||
subactions: ([false, true] as const).map((value) => ({
|
||||
id: `options:fast-mode:${value ? "on" : "off"}`,
|
||||
title: value ? "On" : "Off",
|
||||
state: flow.fastMode === value ? ("on" as const) : undefined,
|
||||
})),
|
||||
},
|
||||
{
|
||||
id: "options-context-window",
|
||||
title: "Context Window",
|
||||
subtitle: flow.contextWindow,
|
||||
subactions: (["200k", "1M"] as const).map((value) => ({
|
||||
id: `options:context-window:${value}`,
|
||||
title: `${value}${value === "1M" ? " (default)" : ""}`,
|
||||
state: flow.contextWindow === value ? ("on" as const) : undefined,
|
||||
})),
|
||||
},
|
||||
{
|
||||
id: "options-runtime",
|
||||
title: "Runtime",
|
||||
subtitle:
|
||||
flow.runtimeMode === "approval-required"
|
||||
? "Approve actions"
|
||||
: flow.runtimeMode === "auto-accept-edits"
|
||||
? "Auto-accept edits"
|
||||
: "Full access",
|
||||
subactions: [
|
||||
{ id: "options:runtime:approval-required", title: "Approve actions" },
|
||||
{ id: "options:runtime:auto-accept-edits", title: "Auto-accept edits" },
|
||||
{ id: "options:runtime:full-access", title: "Full access" },
|
||||
].map((option) => {
|
||||
const value = option.id.replace("options:runtime:", "");
|
||||
return {
|
||||
id: option.id,
|
||||
title: option.title,
|
||||
state: flow.runtimeMode === value ? ("on" as const) : undefined,
|
||||
};
|
||||
}),
|
||||
},
|
||||
{
|
||||
id: "options-interaction",
|
||||
title: "Interaction",
|
||||
subtitle: flow.interactionMode === "plan" ? "Plan" : "Default",
|
||||
subactions: [
|
||||
{ id: "options:interaction:default", title: "Default" },
|
||||
{ id: "options:interaction:plan", title: "Plan" },
|
||||
].map((option) => {
|
||||
const value = option.id.replace("options:interaction:", "");
|
||||
return {
|
||||
id: option.id,
|
||||
title: option.title,
|
||||
state: flow.interactionMode === value ? ("on" as const) : undefined,
|
||||
};
|
||||
}),
|
||||
},
|
||||
],
|
||||
[flow.contextWindow, flow.effort, flow.fastMode, flow.interactionMode, flow.runtimeMode],
|
||||
);
|
||||
|
||||
const workspaceMenuActions = useMemo(() => {
|
||||
const branchActions =
|
||||
flow.availableBranches.length === 0
|
||||
? [
|
||||
{
|
||||
id: "workspace:branch:none",
|
||||
title: flow.branchesLoading ? "Loading branches…" : "No branches available",
|
||||
attributes: { disabled: true },
|
||||
},
|
||||
]
|
||||
: flow.availableBranches.slice(0, 12).map((branch) => {
|
||||
const badge = branchBadgeLabel({
|
||||
branch,
|
||||
project: flow.selectedProject,
|
||||
});
|
||||
|
||||
return {
|
||||
id: `workspace:branch:${branch.name}`,
|
||||
title: branch.name,
|
||||
subtitle: badge ? badge.toUpperCase() : undefined,
|
||||
state: flow.selectedBranchName === branch.name ? ("on" as const) : undefined,
|
||||
};
|
||||
});
|
||||
|
||||
return [
|
||||
{
|
||||
id: "workspace:mode",
|
||||
title: "Mode",
|
||||
subtitle: flow.workspaceMode === "local" ? "Local" : "Worktree",
|
||||
subactions: (["local", "worktree"] as const).map((value) => ({
|
||||
id: `workspace:mode:${value}`,
|
||||
title: value === "local" ? "Local" : "Worktree",
|
||||
state: flow.workspaceMode === value ? ("on" as const) : undefined,
|
||||
})),
|
||||
},
|
||||
{
|
||||
id: "workspace:branch",
|
||||
title: "Branch",
|
||||
subtitle: flow.selectedBranchName ?? "Choose branch",
|
||||
subactions: branchActions,
|
||||
},
|
||||
];
|
||||
}, [
|
||||
flow.availableBranches,
|
||||
flow.branchesLoading,
|
||||
flow.selectedBranchName,
|
||||
flow.selectedProject,
|
||||
flow.workspaceMode,
|
||||
]);
|
||||
|
||||
function handleModelMenuAction(event: string) {
|
||||
if (!event.startsWith("model:")) {
|
||||
return;
|
||||
}
|
||||
// Defer state update so the native menu dismiss animation completes
|
||||
// before re-rendering the menu actions (prevents submenu jump).
|
||||
setTimeout(() => {
|
||||
flow.setSelectedModelKey(event.slice("model:".length));
|
||||
}, 150);
|
||||
}
|
||||
|
||||
function handleEnvironmentMenuAction(event: string) {
|
||||
if (!event.startsWith("environment:")) {
|
||||
return;
|
||||
}
|
||||
flow.selectEnvironment(event.slice("environment:".length));
|
||||
}
|
||||
|
||||
function handleOptionsMenuAction(event: string) {
|
||||
if (event.startsWith("options:effort:")) {
|
||||
flow.setEffort(event.slice("options:effort:".length) as typeof flow.effort);
|
||||
return;
|
||||
}
|
||||
if (event.startsWith("options:fast-mode:")) {
|
||||
flow.setFastMode(event.endsWith(":on"));
|
||||
return;
|
||||
}
|
||||
if (event.startsWith("options:context-window:")) {
|
||||
flow.setContextWindow(event.slice("options:context-window:".length));
|
||||
return;
|
||||
}
|
||||
if (event.startsWith("options:runtime:")) {
|
||||
flow.setRuntimeMode(
|
||||
event.slice("options:runtime:".length) as Parameters<typeof flow.setRuntimeMode>[0],
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (event.startsWith("options:interaction:")) {
|
||||
flow.setInteractionMode(
|
||||
event.slice("options:interaction:".length) as Parameters<typeof flow.setInteractionMode>[0],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function handleWorkspaceMenuAction(event: string) {
|
||||
if (event.startsWith("workspace:mode:")) {
|
||||
flow.setWorkspaceMode(
|
||||
event.slice("workspace:mode:".length) as Parameters<typeof flow.setWorkspaceMode>[0],
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (event.startsWith("workspace:branch:")) {
|
||||
const branchName = event.slice("workspace:branch:".length);
|
||||
const branch = flow.availableBranches.find((candidate) => candidate.name === branchName);
|
||||
if (branch) {
|
||||
flow.selectBranch(branch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function handlePickImages(): Promise<void> {
|
||||
const result = await pickComposerImages({ existingCount: flow.attachments.length });
|
||||
if (result.images.length > 0) {
|
||||
flow.setAttachments((current) => [...current, ...result.images]);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleNativePaste(payload: PasteEventPayload): Promise<void> {
|
||||
console.log("handleNativePaste", payload);
|
||||
if (payload.type === "images" && payload.uris && payload.uris.length > 0) {
|
||||
try {
|
||||
const images = await convertPastedImagesToAttachments({
|
||||
uris: payload.uris,
|
||||
existingCount: flow.attachments.length,
|
||||
});
|
||||
console.log("convertPastedImagesToAttachments returned", images.length, "images");
|
||||
if (images.length > 0) {
|
||||
flow.setAttachments((current) => [...current, ...images]);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("handleNativePaste error", error);
|
||||
}
|
||||
}
|
||||
// Text paste is handled natively by the TextInput — no action needed
|
||||
}
|
||||
|
||||
async function handleStart(): Promise<void> {
|
||||
if (
|
||||
!flow.selectedProject ||
|
||||
!flow.selectedModel ||
|
||||
flow.prompt.trim().length === 0 ||
|
||||
flow.submitting ||
|
||||
(flow.workspaceMode === "worktree" && !flow.selectedBranchName)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
flow.setSubmitting(true);
|
||||
try {
|
||||
const modelWithOptions: ModelSelection =
|
||||
flow.selectedModel.provider === "claudeAgent"
|
||||
? {
|
||||
...flow.selectedModel,
|
||||
options: {
|
||||
effort: flow.effort,
|
||||
fastMode: flow.fastMode || undefined,
|
||||
contextWindow: flow.contextWindow,
|
||||
},
|
||||
}
|
||||
: flow.selectedModel.provider === "codex"
|
||||
? { ...flow.selectedModel, options: { fastMode: flow.fastMode || undefined } }
|
||||
: flow.selectedModel;
|
||||
|
||||
const createdThread = await app.onCreateThreadWithOptions({
|
||||
project: flow.selectedProject,
|
||||
modelSelection: modelWithOptions,
|
||||
envMode: flow.workspaceMode,
|
||||
branch: flow.selectedBranchName,
|
||||
worktreePath: flow.workspaceMode === "worktree" ? null : flow.selectedWorktreePath,
|
||||
runtimeMode: flow.runtimeMode,
|
||||
interactionMode: flow.interactionMode,
|
||||
initialMessageText: flow.prompt.trim(),
|
||||
initialAttachments: flow.attachments,
|
||||
});
|
||||
|
||||
if (createdThread) {
|
||||
router.replace(buildThreadRoutePath(createdThread));
|
||||
}
|
||||
} finally {
|
||||
flow.setSubmitting(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (!selectedProject) {
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor: palette.sheetBackground }}>
|
||||
<View style={{ minHeight: 16, paddingTop: 8 }} />
|
||||
<View className="items-center gap-1 px-5 pb-3 pt-4">
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: palette.textMuted, letterSpacing: 1 }}
|
||||
>
|
||||
New task
|
||||
</Text>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Loading task
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Animated.View
|
||||
style={[{ flex: 1, backgroundColor: palette.sheetBackground }, containerAnimatedStyle]}
|
||||
>
|
||||
<View style={{ minHeight: 16, paddingTop: 8 }} />
|
||||
|
||||
<View className="items-center gap-1 px-5 pb-3 pt-4">
|
||||
{flow.logicalProjects.length > 1 ? (
|
||||
<Pressable
|
||||
className="absolute left-3 top-4 h-9 w-9 items-center justify-center rounded-full"
|
||||
style={{ backgroundColor: palette.subtleBg, zIndex: 1 }}
|
||||
onPress={() => router.back()}
|
||||
>
|
||||
<SymbolView
|
||||
name="chevron.left"
|
||||
size={16}
|
||||
tintColor={palette.icon}
|
||||
type="monochrome"
|
||||
weight="medium"
|
||||
/>
|
||||
</Pressable>
|
||||
) : null}
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: palette.textMuted, letterSpacing: 1 }}
|
||||
>
|
||||
New task
|
||||
</Text>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{selectedProject.title}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ flex: 1, paddingHorizontal: 20, paddingTop: 8 }}>
|
||||
<TextInputWrapper onPaste={(payload) => void handleNativePaste(payload)}>
|
||||
<TextInput
|
||||
multiline
|
||||
value={flow.prompt}
|
||||
onChangeText={flow.setPrompt}
|
||||
placeholderTextColor={palette.placeholder}
|
||||
placeholder={`Describe a coding task in ${selectedProject.title}`}
|
||||
textAlignVertical="top"
|
||||
style={{
|
||||
flex: 1,
|
||||
borderWidth: 0,
|
||||
backgroundColor: "transparent",
|
||||
color: palette.text,
|
||||
fontSize: 18,
|
||||
lineHeight: 28,
|
||||
}}
|
||||
/>
|
||||
</TextInputWrapper>
|
||||
</View>
|
||||
|
||||
<Animated.View
|
||||
style={[
|
||||
{
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: palette.border,
|
||||
},
|
||||
controlsBottomPadding,
|
||||
]}
|
||||
>
|
||||
{flow.attachments.length > 0 ? (
|
||||
<ScrollView
|
||||
horizontal
|
||||
showsHorizontalScrollIndicator={false}
|
||||
style={{ flexGrow: 0, paddingHorizontal: 16, paddingTop: 12 }}
|
||||
>
|
||||
<View className="flex-row gap-3">
|
||||
{flow.attachments.map((attachment: DraftComposerImageAttachment) => (
|
||||
<View key={attachment.id} style={{ position: "relative" }}>
|
||||
<Image
|
||||
source={{ uri: attachment.previewUri }}
|
||||
className="h-[88px] w-[88px] rounded-[20px]"
|
||||
resizeMode="cover"
|
||||
/>
|
||||
<Pressable
|
||||
className="h-6 w-6 items-center justify-center rounded-full"
|
||||
hitSlop={6}
|
||||
onPress={() =>
|
||||
flow.setAttachments((current) =>
|
||||
current.filter((candidate) => candidate.id !== attachment.id),
|
||||
)
|
||||
}
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 4,
|
||||
right: 4,
|
||||
backgroundColor: "rgba(0,0,0,0.55)",
|
||||
}}
|
||||
>
|
||||
<SymbolView
|
||||
name="xmark"
|
||||
size={10}
|
||||
tintColor="#ffffff"
|
||||
type="monochrome"
|
||||
weight="bold"
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</ScrollView>
|
||||
) : null}
|
||||
<View className="flex-row items-center justify-between gap-2 px-4 pb-1 pt-4">
|
||||
<ControlPill icon="plus" onPress={() => void handlePickImages()} />
|
||||
<MenuView
|
||||
actions={modelMenuActions}
|
||||
onPressAction={({ nativeEvent }) => handleModelMenuAction(nativeEvent.event)}
|
||||
>
|
||||
<ControlPill
|
||||
iconNode={<ProviderIcon provider={flow.selectedModel?.provider} size={16} />}
|
||||
/>
|
||||
</MenuView>
|
||||
<MenuView
|
||||
actions={optionsMenuActions}
|
||||
onPressAction={({ nativeEvent }) => handleOptionsMenuAction(nativeEvent.event)}
|
||||
>
|
||||
<ControlPill icon="slider.horizontal.3" />
|
||||
</MenuView>
|
||||
<MenuView
|
||||
actions={environmentMenuActions}
|
||||
onPressAction={({ nativeEvent }) => handleEnvironmentMenuAction(nativeEvent.event)}
|
||||
>
|
||||
<ControlPill icon="desktopcomputer" />
|
||||
</MenuView>
|
||||
<MenuView
|
||||
actions={workspaceMenuActions}
|
||||
onPressAction={({ nativeEvent }) => handleWorkspaceMenuAction(nativeEvent.event)}
|
||||
>
|
||||
<ControlPill icon="point.topleft.down.curvedto.point.bottomright.up" />
|
||||
</MenuView>
|
||||
<ControlPill
|
||||
icon="arrow.up"
|
||||
label={flow.submitting ? "Starting" : "Start"}
|
||||
onPress={() => void handleStart()}
|
||||
variant="primary"
|
||||
disabled={
|
||||
!flow.selectedProject ||
|
||||
!flow.selectedModel ||
|
||||
flow.prompt.trim().length === 0 ||
|
||||
flow.submitting ||
|
||||
(flow.workspaceMode === "worktree" && !flow.selectedBranchName)
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
</Animated.View>
|
||||
</Animated.View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
import { useFocusEffect, useRouter } from "expo-router";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useCallback, useEffect, useMemo, useRef } from "react";
|
||||
import { FlatList, Pressable, useColorScheme, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { AppText as Text } from "../../components/AppText";
|
||||
import { groupProjectsByRepository } from "../../lib/repositoryGroups";
|
||||
import { buildNewTaskDraftRoutePath } from "../../lib/routes";
|
||||
import type { ScopedMobileProject } from "../../lib/scopedEntities";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
import { useNewTaskFlow } from "./new-task-flow-provider";
|
||||
|
||||
const DEV_FAKE_PROJECT_COUNT = 15;
|
||||
|
||||
type PickerEntry = {
|
||||
readonly key: string;
|
||||
readonly project: ScopedMobileProject;
|
||||
};
|
||||
|
||||
export function NewTaskProjectRouteScreen() {
|
||||
const app = useRemoteApp();
|
||||
const router = useRouter();
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const { reset } = useNewTaskFlow();
|
||||
const listRef = useRef<FlatList<PickerEntry> | null>(null);
|
||||
const repositoryGroups = useMemo(
|
||||
() => groupProjectsByRepository({ projects: app.projects, threads: app.threads }),
|
||||
[app.projects, app.threads],
|
||||
);
|
||||
const logicalProjects = useMemo(
|
||||
() =>
|
||||
repositoryGroups
|
||||
.map((group) => {
|
||||
const primaryProject = group.projects[0]?.project;
|
||||
if (!primaryProject) {
|
||||
return null;
|
||||
}
|
||||
return { key: group.key, project: primaryProject };
|
||||
})
|
||||
.filter((entry) => entry !== null),
|
||||
[repositoryGroups],
|
||||
);
|
||||
const pickerEntries = useMemo(() => {
|
||||
if (!__DEV__ || logicalProjects.length === 0) {
|
||||
return logicalProjects;
|
||||
}
|
||||
|
||||
const fakeEntries = Array.from({ length: DEV_FAKE_PROJECT_COUNT }, (_, index) => {
|
||||
const source = logicalProjects[index % logicalProjects.length]!;
|
||||
|
||||
return {
|
||||
key: `dev-preview-${index + 1}`,
|
||||
project: {
|
||||
...source.project,
|
||||
title: `${source.project.title} preview ${index + 1}`,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
return [...logicalProjects, ...fakeEntries];
|
||||
}, [logicalProjects]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("[new task project screen] render", {
|
||||
logicalProjects: pickerEntries.map((entry) => ({
|
||||
key: entry.key,
|
||||
title: entry.project.title,
|
||||
})),
|
||||
pathnameTarget: "/new",
|
||||
projectCount: app.projects.length,
|
||||
threadCount: app.threads.length,
|
||||
});
|
||||
}, [app.projects.length, app.threads.length, pickerEntries]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("[new task project screen] reset flow");
|
||||
reset();
|
||||
}, [reset]);
|
||||
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
requestAnimationFrame(() => {
|
||||
listRef.current?.scrollToOffset({ animated: false, offset: 0 });
|
||||
});
|
||||
}, []),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (logicalProjects.length !== 1) {
|
||||
console.log("[new task project screen] staying on picker", {
|
||||
logicalProjectCount: logicalProjects.length,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("[new task project screen] auto-forward to draft", {
|
||||
environmentId: logicalProjects[0]!.project.environmentId,
|
||||
projectId: logicalProjects[0]!.project.id,
|
||||
title: logicalProjects[0]!.project.title,
|
||||
});
|
||||
router.replace(buildNewTaskDraftRoutePath(logicalProjects[0]!.project));
|
||||
}, [logicalProjects, router]);
|
||||
|
||||
if (app.projects.length === 0) {
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor: palette.sheetBackground }}>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
paddingTop: 28,
|
||||
paddingBottom: Math.max(insets.bottom, 18) + 18,
|
||||
}}
|
||||
>
|
||||
<View className="items-center gap-1 px-5 pb-4">
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: palette.textMuted, letterSpacing: 1 }}
|
||||
>
|
||||
New task
|
||||
</Text>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Choose project
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View
|
||||
className="mx-5 items-center rounded-[24px] px-6 py-8"
|
||||
style={{ backgroundColor: palette.card }}
|
||||
>
|
||||
<Text className="text-[16px] font-medium" style={{ color: palette.textMuted }}>
|
||||
Loading projects…
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1, backgroundColor: palette.sheetBackground }}>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
paddingTop: 28,
|
||||
paddingBottom: Math.max(insets.bottom, 18) + 18,
|
||||
}}
|
||||
>
|
||||
<View style={{ flex: 1 }}>
|
||||
<FlatList
|
||||
ref={listRef}
|
||||
data={pickerEntries}
|
||||
keyExtractor={(entry) => entry.key}
|
||||
showsVerticalScrollIndicator={false}
|
||||
contentContainerStyle={{
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 28,
|
||||
paddingBottom: Math.max(insets.bottom, 18) + 18,
|
||||
}}
|
||||
ListHeaderComponent={
|
||||
<View className="items-center gap-1 pb-4">
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: palette.textMuted, letterSpacing: 1 }}
|
||||
>
|
||||
New task
|
||||
</Text>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Choose project
|
||||
</Text>
|
||||
</View>
|
||||
}
|
||||
renderItem={({ item, index }) => {
|
||||
const isFirst = index === 0;
|
||||
const isLast = index === pickerEntries.length - 1;
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
onPress={() => router.push(buildNewTaskDraftRoutePath(item.project))}
|
||||
style={{
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 18,
|
||||
borderTopWidth: isFirst ? 0 : 1,
|
||||
borderTopColor: palette.borderSubtle,
|
||||
backgroundColor: palette.card,
|
||||
borderTopLeftRadius: isFirst ? 24 : 0,
|
||||
borderTopRightRadius: isFirst ? 24 : 0,
|
||||
borderBottomLeftRadius: isLast ? 24 : 0,
|
||||
borderBottomRightRadius: isLast ? 24 : 0,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-center justify-between gap-3">
|
||||
<View className="flex-1">
|
||||
<Text className="text-[18px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{item.project.title}
|
||||
</Text>
|
||||
</View>
|
||||
<SymbolView
|
||||
name="chevron.right"
|
||||
size={14}
|
||||
tintColor={palette.chevronColor}
|
||||
type="monochrome"
|
||||
/>
|
||||
</View>
|
||||
</Pressable>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,11 +5,12 @@ import {
|
||||
BottomSheetView,
|
||||
} from "@gorhom/bottom-sheet";
|
||||
import { useCallback, useEffect, useMemo, useRef } from "react";
|
||||
import { Pressable, View } from "react-native";
|
||||
import { Pressable, useColorScheme, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { AppText as Text } from "../../components/AppText";
|
||||
import { groupProjectsByRepository } from "../../lib/repositoryGroups";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import type { ScopedMobileProject, ScopedMobileThread } from "../../lib/scopedEntities";
|
||||
|
||||
export function ProjectPickerSheet(props: {
|
||||
@@ -19,6 +20,8 @@ export function ProjectPickerSheet(props: {
|
||||
readonly onClose: () => void;
|
||||
readonly onSelectProject: (project: ScopedMobileProject) => void;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const sheetRef = useRef<BottomSheetModal>(null);
|
||||
const repositoryGroups = useMemo(
|
||||
@@ -78,18 +81,18 @@ export function ProjectPickerSheet(props: {
|
||||
enablePanDownToClose
|
||||
backdropComponent={renderBackdrop}
|
||||
onDismiss={props.onClose}
|
||||
backgroundStyle={{ backgroundColor: "rgba(250,248,242,0.98)" }}
|
||||
handleIndicatorStyle={{ backgroundColor: "rgba(120,113,108,0.35)" }}
|
||||
backgroundStyle={{ backgroundColor: palette.sheetBackground }}
|
||||
handleIndicatorStyle={{ backgroundColor: palette.dotSeparator }}
|
||||
>
|
||||
<BottomSheetView className="px-4 pt-1">
|
||||
<View className="mb-4 items-center gap-1">
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold uppercase"
|
||||
style={{ color: "#78716c", letterSpacing: 1 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 1 }}
|
||||
>
|
||||
New task
|
||||
</Text>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Choose project
|
||||
</Text>
|
||||
</View>
|
||||
@@ -100,7 +103,7 @@ export function ProjectPickerSheet(props: {
|
||||
paddingBottom: Math.max(insets.bottom, 18) + 18,
|
||||
}}
|
||||
>
|
||||
<View className="overflow-hidden rounded-[24px]" style={{ backgroundColor: "#ffffff" }}>
|
||||
<View className="overflow-hidden rounded-[24px]" style={{ backgroundColor: palette.card }}>
|
||||
{logicalProjects.map((entry, index) => (
|
||||
<Pressable
|
||||
key={entry.key}
|
||||
@@ -109,12 +112,12 @@ export function ProjectPickerSheet(props: {
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 18,
|
||||
borderTopWidth: index === 0 ? 0 : 1,
|
||||
borderTopColor: "rgba(23,23,23,0.06)",
|
||||
borderTopColor: palette.borderSubtle,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-center justify-between gap-3">
|
||||
<View className="flex-1">
|
||||
<Text className="text-[18px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[18px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{entry.project.title}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { OrchestrationThread } from "@t3tools/contracts";
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { memo } from "react";
|
||||
import { Image, Pressable, ScrollView, View } from "react-native";
|
||||
import { Image, Pressable, ScrollView, useColorScheme, View } from "react-native";
|
||||
|
||||
import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
|
||||
import { cx } from "../../lib/classNames";
|
||||
@@ -59,6 +59,8 @@ export interface ThreadComposerProps {
|
||||
}
|
||||
|
||||
export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposerProps) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const actionIconTint = isDarkMode ? "#e2e8f0" : "#0f172a";
|
||||
const canSend =
|
||||
props.connectionState === "ready" &&
|
||||
(props.draftMessage.trim().length > 0 || props.draftAttachments.length > 0);
|
||||
@@ -91,19 +93,19 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
|
||||
<ComposerAction
|
||||
icon="photo.on.rectangle"
|
||||
backgroundClassName="bg-stone-200 dark:bg-slate-800"
|
||||
iconTintColor="#0f172a"
|
||||
iconTintColor={actionIconTint}
|
||||
onPress={() => void props.onPickDraftImages()}
|
||||
/>
|
||||
<ComposerAction
|
||||
icon="doc.on.clipboard"
|
||||
backgroundClassName="bg-stone-200 dark:bg-slate-800"
|
||||
iconTintColor="#0f172a"
|
||||
iconTintColor={actionIconTint}
|
||||
onPress={() => void props.onPasteIntoDraft()}
|
||||
/>
|
||||
<ComposerAction
|
||||
icon="arrow.clockwise"
|
||||
backgroundClassName="bg-stone-200 dark:bg-slate-800"
|
||||
iconTintColor="#0f172a"
|
||||
iconTintColor={actionIconTint}
|
||||
onPress={() => void props.onRefresh()}
|
||||
/>
|
||||
</View>
|
||||
@@ -112,7 +114,7 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
|
||||
<ComposerAction
|
||||
icon="stop.fill"
|
||||
backgroundClassName="bg-rose-100 dark:bg-rose-500/18"
|
||||
iconTintColor="#be123c"
|
||||
iconTintColor={isDarkMode ? "#fda4af" : "#be123c"}
|
||||
onPress={() => void props.onStopThread()}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -35,6 +35,7 @@ import type { StatusTone } from "../../components/StatusPill";
|
||||
import type { DraftComposerImageAttachment } from "../../lib/composerImages";
|
||||
import type { MobileLayoutVariant } from "../../lib/mobileLayout";
|
||||
import type { ScopedMobileThread } from "../../lib/scopedEntities";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import type {
|
||||
PendingApproval,
|
||||
PendingUserInput,
|
||||
@@ -182,17 +183,12 @@ function useStreamingHaptics(threadId: string, feed: ReadonlyArray<ThreadFeedEnt
|
||||
export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
const { onBack, onOpenDrawer, onRefresh, onRefreshSelectedThreadGitStatus } = props;
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const { width } = useWindowDimensions();
|
||||
const agentLabel = `${props.selectedThread.modelSelection.provider} agent`;
|
||||
const headerOverlayHeight = insets.top + 118;
|
||||
const composerBottomInset = Math.max(insets.bottom, 12);
|
||||
const screenBackgroundColor = isDarkMode ? "#0c1118" : "#f7f7f5";
|
||||
const modalBackdropColor = isDarkMode ? "rgba(2,6,23,0.68)" : "rgba(15,23,42,0.22)";
|
||||
const modalPanelColor = isDarkMode ? "#111827" : "#ffffff";
|
||||
const modalBorderColor = isDarkMode ? "rgba(255,255,255,0.08)" : "#e2e8f0";
|
||||
const modalMutedColor = isDarkMode ? "#94a3b8" : "#64748b";
|
||||
const modalPrimaryColor = isDarkMode ? "#f8fafc" : "#020617";
|
||||
const [renameVisible, setRenameVisible] = useState(false);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
const [renameDraft, setRenameDraft] = useState(props.selectedThread.title);
|
||||
@@ -306,15 +302,15 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
<Animated.View style={edgeSwipeStyle}>
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||
style={{ flex: 1, backgroundColor: screenBackgroundColor }}
|
||||
style={{ flex: 1, backgroundColor: palette.screenBackground }}
|
||||
>
|
||||
{showHeader ? (
|
||||
<View className="absolute inset-x-0 top-0 z-20">
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: isDarkMode ? "rgba(12,17,24,0.94)" : "rgba(247,247,245,0.94)",
|
||||
backgroundColor: palette.headerBackground,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: isDarkMode ? "rgba(255,255,255,0.08)" : "rgba(23,23,23,0.06)",
|
||||
borderBottomColor: palette.headerBorder,
|
||||
}}
|
||||
>
|
||||
<GlassSafeAreaView
|
||||
@@ -323,16 +319,14 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
<Pressable
|
||||
className="h-11 w-11 items-center justify-center rounded-full"
|
||||
style={{
|
||||
backgroundColor: isDarkMode
|
||||
? "rgba(255,255,255,0.06)"
|
||||
: "rgba(23,23,23,0.05)",
|
||||
backgroundColor: palette.subtleBg,
|
||||
}}
|
||||
onPress={props.onBack}
|
||||
>
|
||||
<SymbolView
|
||||
name="chevron.left"
|
||||
size={18}
|
||||
tintColor={isDarkMode ? "#fafaf9" : "#171717"}
|
||||
tintColor={palette.icon}
|
||||
type="monochrome"
|
||||
/>
|
||||
</Pressable>
|
||||
@@ -349,7 +343,7 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
<Animated.Text
|
||||
numberOfLines={1}
|
||||
style={{
|
||||
color: isDarkMode ? "#f8fafc" : "#020617",
|
||||
color: palette.text,
|
||||
fontSize: 18,
|
||||
fontWeight: "800",
|
||||
lineHeight: 22,
|
||||
@@ -360,7 +354,7 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
</Pressable>
|
||||
<Text
|
||||
className="text-[11px] font-bold uppercase"
|
||||
style={{ color: modalMutedColor, letterSpacing: 1.05 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 1.05 }}
|
||||
>
|
||||
{props.activeWorkDurationLabel ? props.activeWorkDurationLabel : ""}
|
||||
</Text>
|
||||
@@ -457,27 +451,27 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
>
|
||||
<View
|
||||
className="flex-1 items-center justify-center px-5"
|
||||
style={{ backgroundColor: modalBackdropColor }}
|
||||
style={{ backgroundColor: palette.backdrop }}
|
||||
>
|
||||
<View
|
||||
className="w-full gap-4 px-4 py-4"
|
||||
style={{
|
||||
maxWidth: 420,
|
||||
borderWidth: 1,
|
||||
borderColor: modalBorderColor,
|
||||
backgroundColor: modalPanelColor,
|
||||
borderColor: palette.border,
|
||||
backgroundColor: palette.card,
|
||||
}}
|
||||
>
|
||||
<View className="gap-2">
|
||||
<Text
|
||||
className="text-[11px] font-bold uppercase"
|
||||
style={{ color: modalMutedColor, letterSpacing: 1.2 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 1.2 }}
|
||||
>
|
||||
Thread name
|
||||
</Text>
|
||||
<Text
|
||||
className="text-[20px] font-extrabold leading-[24px]"
|
||||
style={{ color: modalPrimaryColor }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
Rename thread
|
||||
</Text>
|
||||
@@ -490,9 +484,9 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
className="min-h-[56px] px-4 py-3 text-[15px]"
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
borderColor: modalBorderColor,
|
||||
backgroundColor: isDarkMode ? "#0f172a" : "#ffffff",
|
||||
color: modalPrimaryColor,
|
||||
borderColor: palette.border,
|
||||
backgroundColor: palette.inputBackground,
|
||||
color: palette.text,
|
||||
}}
|
||||
onSubmitEditing={() => {
|
||||
void handleSubmitRename();
|
||||
@@ -504,8 +498,8 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
className="min-h-[48px] flex-1 items-center justify-center px-4 py-3"
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
borderColor: modalBorderColor,
|
||||
backgroundColor: isDarkMode ? "#1f2937" : "#f8fafc",
|
||||
borderColor: palette.border,
|
||||
backgroundColor: palette.secondaryButton,
|
||||
}}
|
||||
onPress={() => {
|
||||
setRenameDraft(props.selectedThread.title);
|
||||
@@ -514,21 +508,21 @@ export function ThreadDetailScreen(props: ThreadDetailScreenProps) {
|
||||
>
|
||||
<Text
|
||||
className="text-sm font-extrabold uppercase"
|
||||
style={{ color: modalPrimaryColor, letterSpacing: 1 }}
|
||||
style={{ color: palette.text, letterSpacing: 1 }}
|
||||
>
|
||||
Cancel
|
||||
</Text>
|
||||
</Pressable>
|
||||
<Pressable
|
||||
className="min-h-[48px] flex-1 items-center justify-center px-4 py-3"
|
||||
style={{ backgroundColor: modalPrimaryColor }}
|
||||
style={{ backgroundColor: palette.primaryButton }}
|
||||
onPress={() => {
|
||||
void handleSubmitRename();
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
className="text-sm font-extrabold uppercase"
|
||||
style={{ color: isDarkMode ? "#020617" : "#f8fafc", letterSpacing: 1 }}
|
||||
style={{ color: palette.primaryButtonText, letterSpacing: 1 }}
|
||||
>
|
||||
Save
|
||||
</Text>
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
ScrollView,
|
||||
type NativeScrollEvent,
|
||||
type NativeSyntheticEvent,
|
||||
useColorScheme,
|
||||
View,
|
||||
} from "react-native";
|
||||
|
||||
@@ -18,6 +19,7 @@ import { AppText as Text } from "../../components/AppText";
|
||||
import { EmptyState } from "../../components/EmptyState";
|
||||
import { cx } from "../../lib/classNames";
|
||||
import type { MobileLayoutVariant } from "../../lib/mobileLayout";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import type { ThreadFeedEntry } from "../../lib/threadActivity";
|
||||
import { relativeTime } from "../../lib/time";
|
||||
import { messageImageUrl } from "./threadPresentation";
|
||||
@@ -99,72 +101,88 @@ function buildActivityRows(
|
||||
|
||||
const MAX_VISIBLE_WORK_LOG_ENTRIES = 6;
|
||||
|
||||
const MARKDOWN_BASE = {
|
||||
body: {
|
||||
color: "#020617",
|
||||
fontSize: 15,
|
||||
lineHeight: 22,
|
||||
},
|
||||
paragraph: { marginTop: 0, marginBottom: 0 },
|
||||
bullet_list: { marginTop: 0, marginBottom: 0 },
|
||||
ordered_list: { marginTop: 0, marginBottom: 0 },
|
||||
list_item: { marginTop: 0, marginBottom: 2 },
|
||||
strong: { fontWeight: "800" as const, color: "#020617" },
|
||||
em: { fontStyle: "italic" as const },
|
||||
link: { color: "#0369a1" },
|
||||
blockquote: {
|
||||
borderLeftWidth: 3,
|
||||
borderLeftColor: "rgba(100,116,139,0.35)",
|
||||
paddingLeft: 12,
|
||||
marginLeft: 0,
|
||||
},
|
||||
};
|
||||
function makeMarkdownStyles(isDarkMode: boolean) {
|
||||
const bodyColor = isDarkMode ? "#e2e8f0" : "#020617";
|
||||
const strongColor = isDarkMode ? "#f8fafc" : "#020617";
|
||||
const linkColor = isDarkMode ? "#7dd3fc" : "#0369a1";
|
||||
const blockquoteBorder = isDarkMode
|
||||
? "rgba(148,163,184,0.35)"
|
||||
: "rgba(100,116,139,0.35)";
|
||||
const codeBg = isDarkMode ? "rgba(255,255,255,0.08)" : "rgba(15,23,42,0.08)";
|
||||
const codeText = isDarkMode ? "#e2e8f0" : "#0f172a";
|
||||
const userCodeBg = isDarkMode ? "rgba(255,255,255,0.10)" : "rgba(255,255,255,0.55)";
|
||||
const userCodeText = isDarkMode ? "#e2e8f0" : "#0f172a";
|
||||
const userFenceBg = isDarkMode ? "rgba(255,255,255,0.10)" : "rgba(255,255,255,0.6)";
|
||||
|
||||
const USER_MARKDOWN_STYLES = {
|
||||
...MARKDOWN_BASE,
|
||||
code_inline: {
|
||||
backgroundColor: "rgba(255,255,255,0.55)",
|
||||
color: "#0f172a",
|
||||
borderRadius: 6,
|
||||
paddingHorizontal: 6,
|
||||
paddingVertical: 2,
|
||||
},
|
||||
code_block: {
|
||||
backgroundColor: "rgba(255,255,255,0.6)",
|
||||
color: "#0f172a",
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
fence: {
|
||||
backgroundColor: "rgba(255,255,255,0.6)",
|
||||
color: "#0f172a",
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
};
|
||||
const base = {
|
||||
body: {
|
||||
color: bodyColor,
|
||||
fontSize: 15,
|
||||
lineHeight: 22,
|
||||
},
|
||||
paragraph: { marginTop: 0, marginBottom: 0 },
|
||||
bullet_list: { marginTop: 0, marginBottom: 0 },
|
||||
ordered_list: { marginTop: 0, marginBottom: 0 },
|
||||
list_item: { marginTop: 0, marginBottom: 2 },
|
||||
strong: { fontWeight: "800" as const, color: strongColor },
|
||||
em: { fontStyle: "italic" as const },
|
||||
link: { color: linkColor },
|
||||
blockquote: {
|
||||
borderLeftWidth: 3,
|
||||
borderLeftColor: blockquoteBorder,
|
||||
paddingLeft: 12,
|
||||
marginLeft: 0,
|
||||
},
|
||||
};
|
||||
|
||||
const ASSISTANT_MARKDOWN_STYLES = {
|
||||
...MARKDOWN_BASE,
|
||||
code_inline: {
|
||||
backgroundColor: "rgba(15,23,42,0.08)",
|
||||
color: "#0f172a",
|
||||
borderRadius: 6,
|
||||
paddingHorizontal: 6,
|
||||
paddingVertical: 2,
|
||||
},
|
||||
code_block: {
|
||||
backgroundColor: "rgba(15,23,42,0.08)",
|
||||
color: "#0f172a",
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
fence: {
|
||||
backgroundColor: "rgba(15,23,42,0.08)",
|
||||
color: "#0f172a",
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
};
|
||||
const user = {
|
||||
...base,
|
||||
code_inline: {
|
||||
backgroundColor: userCodeBg,
|
||||
color: userCodeText,
|
||||
borderRadius: 6,
|
||||
paddingHorizontal: 6,
|
||||
paddingVertical: 2,
|
||||
},
|
||||
code_block: {
|
||||
backgroundColor: userFenceBg,
|
||||
color: userCodeText,
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
fence: {
|
||||
backgroundColor: userFenceBg,
|
||||
color: userCodeText,
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
};
|
||||
|
||||
const assistant = {
|
||||
...base,
|
||||
code_inline: {
|
||||
backgroundColor: codeBg,
|
||||
color: codeText,
|
||||
borderRadius: 6,
|
||||
paddingHorizontal: 6,
|
||||
paddingVertical: 2,
|
||||
},
|
||||
code_block: {
|
||||
backgroundColor: codeBg,
|
||||
color: codeText,
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
fence: {
|
||||
backgroundColor: codeBg,
|
||||
color: codeText,
|
||||
borderRadius: 14,
|
||||
padding: 12,
|
||||
},
|
||||
};
|
||||
|
||||
return { user, assistant };
|
||||
}
|
||||
|
||||
function renderFeedEntry(
|
||||
info: ListRenderItemInfo<ThreadFeedEntry>,
|
||||
@@ -173,14 +191,17 @@ function renderFeedEntry(
|
||||
readonly expandedWorkGroups: Record<string, boolean>;
|
||||
readonly onCopyWorkRow: (rowId: string, value: string) => void;
|
||||
readonly onToggleWorkGroup: (groupId: string) => void;
|
||||
readonly isDarkMode: boolean;
|
||||
},
|
||||
) {
|
||||
const entry = info.item;
|
||||
const markdownStyles = makeMarkdownStyles(props.isDarkMode);
|
||||
const palette = makeAppPalette(props.isDarkMode);
|
||||
|
||||
if (entry.type === "message") {
|
||||
const { message } = entry;
|
||||
const isUser = message.role === "user";
|
||||
const markdownStyles = isUser ? USER_MARKDOWN_STYLES : ASSISTANT_MARKDOWN_STYLES;
|
||||
const styles = isUser ? markdownStyles.user : markdownStyles.assistant;
|
||||
const timestampLabel = `${relativeTime(message.createdAt)}${message.streaming ? " • live" : ""}`;
|
||||
const attachments = message.attachments ?? [];
|
||||
|
||||
@@ -189,7 +210,7 @@ function renderFeedEntry(
|
||||
<View className="mb-3.5 items-end gap-1.5">
|
||||
<View className="max-w-[85%] gap-2 rounded-[22px] rounded-br-[10px] border border-orange-300/60 bg-orange-100/70 px-4 py-4 dark:border-orange-300/22 dark:bg-orange-300/14">
|
||||
{message.text.trim().length > 0 ? (
|
||||
<Markdown style={markdownStyles}>{message.text}</Markdown>
|
||||
<Markdown style={styles}>{message.text}</Markdown>
|
||||
) : null}
|
||||
{attachments.map((attachment) => {
|
||||
const uri = messageImageUrl(props.httpBaseUrl, attachment.id);
|
||||
@@ -226,7 +247,7 @@ function renderFeedEntry(
|
||||
return (
|
||||
<View className="mb-3.5 gap-1.5 px-1">
|
||||
{message.text.trim().length > 0 ? (
|
||||
<Markdown style={markdownStyles}>{message.text}</Markdown>
|
||||
<Markdown style={styles}>{message.text}</Markdown>
|
||||
) : null}
|
||||
{attachments.map((attachment) => {
|
||||
const uri = messageImageUrl(props.httpBaseUrl, attachment.id);
|
||||
@@ -310,7 +331,7 @@ function renderFeedEntry(
|
||||
)}
|
||||
>
|
||||
<View className="items-center justify-center pt-0.5">
|
||||
<SymbolView name="terminal" size={13} tintColor="#64748b" type="monochrome" />
|
||||
<SymbolView name="terminal" size={13} tintColor={palette.iconSubtle} type="monochrome" />
|
||||
</View>
|
||||
<ScrollView
|
||||
horizontal
|
||||
@@ -389,6 +410,7 @@ function useAutoScrollToLatest(
|
||||
}
|
||||
|
||||
export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const listRef = useRef<FlashListRef<ThreadFeedEntry>>(null);
|
||||
const copyFeedbackTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
const [copiedRowId, setCopiedRowId] = useState<string | null>(null);
|
||||
@@ -437,10 +459,12 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
|
||||
expandedWorkGroups,
|
||||
onCopyWorkRow,
|
||||
onToggleWorkGroup,
|
||||
isDarkMode,
|
||||
}),
|
||||
[
|
||||
copiedRowId,
|
||||
expandedWorkGroups,
|
||||
isDarkMode,
|
||||
onCopyWorkRow,
|
||||
onToggleWorkGroup,
|
||||
props.bearerToken,
|
||||
|
||||
@@ -18,11 +18,12 @@ import { resolveAutoFeatureBranchName, sanitizeFeatureBranchName } from "@t3tool
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import type { ComponentProps, RefObject } from "react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Alert, Linking, Pressable, View } from "react-native";
|
||||
import { Alert, Linking, Pressable, useColorScheme, View } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
|
||||
import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText";
|
||||
import { StatusPill } from "../../components/StatusPill";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
|
||||
type PendingDefaultBranchAction = {
|
||||
readonly action: Extract<
|
||||
@@ -172,24 +173,26 @@ function SheetActionButton(props: {
|
||||
readonly tone?: "primary" | "secondary" | "danger";
|
||||
readonly onPress: () => void;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const tone = props.tone ?? "secondary";
|
||||
const colors =
|
||||
tone === "primary"
|
||||
? {
|
||||
backgroundColor: "#171717",
|
||||
backgroundColor: palette.primaryButton,
|
||||
borderColor: "transparent",
|
||||
textColor: "#fafaf9",
|
||||
textColor: palette.primaryButtonText,
|
||||
}
|
||||
: tone === "danger"
|
||||
? {
|
||||
backgroundColor: "#fff1f2",
|
||||
borderColor: "rgba(225,29,72,0.12)",
|
||||
textColor: "#be123c",
|
||||
backgroundColor: palette.dangerButton,
|
||||
borderColor: palette.dangerBorder,
|
||||
textColor: palette.dangerText,
|
||||
}
|
||||
: {
|
||||
backgroundColor: "#ffffff",
|
||||
borderColor: "rgba(23,23,23,0.08)",
|
||||
textColor: "#171717",
|
||||
backgroundColor: palette.secondaryButton,
|
||||
borderColor: palette.secondaryButtonBorder,
|
||||
textColor: palette.secondaryButtonText,
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -216,14 +219,16 @@ function SheetActionButton(props: {
|
||||
}
|
||||
|
||||
function MetaCard(props: { readonly label: string; readonly value: string }) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
return (
|
||||
<View
|
||||
className="rounded-[18px] border px-4 py-3"
|
||||
style={{ backgroundColor: "#ffffff", borderColor: "rgba(23,23,23,0.08)" }}
|
||||
style={{ backgroundColor: palette.card, borderColor: palette.border }}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#78716c", letterSpacing: 0.9 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 0.9 }}
|
||||
>
|
||||
{props.label}
|
||||
</Text>
|
||||
@@ -231,7 +236,7 @@ function MetaCard(props: { readonly label: string; readonly value: string }) {
|
||||
selectable
|
||||
className="text-[13px] font-medium"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#292524" }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
{props.value}
|
||||
</Text>
|
||||
@@ -246,6 +251,8 @@ function SheetListRow(props: {
|
||||
readonly disabled?: boolean;
|
||||
readonly onPress: () => void;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
return (
|
||||
<Pressable
|
||||
className="flex-row items-center gap-3 px-1 py-3"
|
||||
@@ -255,21 +262,21 @@ function SheetListRow(props: {
|
||||
>
|
||||
<View
|
||||
className="h-9 w-9 items-center justify-center rounded-full"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.05)" }}
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
>
|
||||
<SymbolView name={props.icon} size={16} tintColor="#171717" type="monochrome" />
|
||||
<SymbolView name={props.icon} size={16} tintColor={palette.icon} type="monochrome" />
|
||||
</View>
|
||||
<View className="flex-1 gap-0.5">
|
||||
<Text className="text-[16px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[16px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{props.title}
|
||||
</Text>
|
||||
{props.subtitle ? (
|
||||
<Text className="text-[12px] leading-[17px]" style={{ color: "#78716c" }}>
|
||||
<Text className="text-[12px] leading-[17px]" style={{ color: palette.textMuted }}>
|
||||
{props.subtitle}
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
<SymbolView name="chevron.right" size={13} tintColor="#a8a29e" type="monochrome" />
|
||||
<SymbolView name="chevron.right" size={13} tintColor={palette.iconSubtle} type="monochrome" />
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
@@ -290,6 +297,8 @@ export function ThreadGitControls(props: {
|
||||
readonly onPull: () => Promise<void>;
|
||||
readonly onRunAction: (input: GitActionRequestInput) => Promise<GitRunStackedActionResult | null>;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const {
|
||||
currentWorktreePath,
|
||||
@@ -659,26 +668,26 @@ export function ThreadGitControls(props: {
|
||||
<MenuView actions={nativeMenuActions} onPressAction={onPressNativeMenuAction}>
|
||||
<Pressable
|
||||
className="flex-row items-center gap-2 rounded-full px-3 py-2"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.05)" }}
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
>
|
||||
<SymbolView
|
||||
name="point.topleft.down.curvedto.point.bottomright.up"
|
||||
size={14}
|
||||
tintColor="#171717"
|
||||
tintColor={palette.icon}
|
||||
type="monochrome"
|
||||
/>
|
||||
<View className="shrink">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#78716c", letterSpacing: 0.8 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 0.8 }}
|
||||
>
|
||||
Git
|
||||
</Text>
|
||||
<Text
|
||||
className="text-[12px] font-t3-bold"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#171717" }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
{triggerStatus}
|
||||
</Text>
|
||||
@@ -686,7 +695,7 @@ export function ThreadGitControls(props: {
|
||||
<SymbolView
|
||||
name="chevron.down"
|
||||
size={11}
|
||||
tintColor="#78716c"
|
||||
tintColor={palette.textMuted}
|
||||
type="monochrome"
|
||||
weight="medium"
|
||||
/>
|
||||
@@ -701,8 +710,8 @@ export function ThreadGitControls(props: {
|
||||
enablePanDownToClose
|
||||
backdropComponent={renderBackdrop}
|
||||
onDismiss={() => setGitSheetVisible(false)}
|
||||
backgroundStyle={{ backgroundColor: "rgba(247,247,245,0.98)" }}
|
||||
handleIndicatorStyle={{ backgroundColor: "rgba(120,113,108,0.32)" }}
|
||||
backgroundStyle={{ backgroundColor: palette.sheetBackground }}
|
||||
handleIndicatorStyle={{ backgroundColor: palette.dotSeparator }}
|
||||
>
|
||||
<BottomSheetView style={{ flex: 1 }}>
|
||||
<BottomSheetScrollView
|
||||
@@ -718,16 +727,16 @@ export function ThreadGitControls(props: {
|
||||
<View className="flex-1 gap-1">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#78716c", letterSpacing: 1 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 1 }}
|
||||
>
|
||||
Branch
|
||||
</Text>
|
||||
<Text className="text-[24px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[24px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{currentBranchLabel}
|
||||
</Text>
|
||||
<Text
|
||||
className="text-[13px] font-medium leading-[19px]"
|
||||
style={{ color: "#57534e" }}
|
||||
style={{ color: palette.textSecondary }}
|
||||
>
|
||||
{statusSummary(gitStatus)}
|
||||
</Text>
|
||||
@@ -735,13 +744,13 @@ export function ThreadGitControls(props: {
|
||||
<Pressable
|
||||
className="rounded-full p-2"
|
||||
disabled={busy}
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.05)", opacity: busy ? 0.45 : 1 }}
|
||||
style={{ backgroundColor: palette.subtleBg, opacity: busy ? 0.45 : 1 }}
|
||||
onPress={() => void onRefreshStatus()}
|
||||
>
|
||||
<SymbolView
|
||||
name="arrow.clockwise"
|
||||
size={16}
|
||||
tintColor="#171717"
|
||||
tintColor={palette.icon}
|
||||
type="monochrome"
|
||||
weight="medium"
|
||||
/>
|
||||
@@ -751,14 +760,14 @@ export function ThreadGitControls(props: {
|
||||
<View className="gap-3">
|
||||
<View
|
||||
className="overflow-hidden rounded-[22px] border px-4 py-1"
|
||||
style={{ backgroundColor: "#ffffff", borderColor: "rgba(23,23,23,0.08)" }}
|
||||
style={{ backgroundColor: palette.card, borderColor: palette.border }}
|
||||
>
|
||||
{sheetMenuItems.map(({ item, disabledReason }, index) => (
|
||||
<View key={`${item.id}-${item.label}`}>
|
||||
{index > 0 ? (
|
||||
<View
|
||||
className="ml-12 h-px"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.08)" }}
|
||||
style={{ backgroundColor: palette.border }}
|
||||
/>
|
||||
) : null}
|
||||
<SheetListRow
|
||||
@@ -776,7 +785,7 @@ export function ThreadGitControls(props: {
|
||||
<>
|
||||
<View
|
||||
className="ml-12 h-px"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.08)" }}
|
||||
style={{ backgroundColor: palette.border }}
|
||||
/>
|
||||
<SheetListRow
|
||||
icon="arrow.down.circle"
|
||||
@@ -789,7 +798,7 @@ export function ThreadGitControls(props: {
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
<View className="ml-12 h-px" style={{ backgroundColor: "rgba(23,23,23,0.08)" }} />
|
||||
<View className="ml-12 h-px" style={{ backgroundColor: palette.border }} />
|
||||
<SheetListRow
|
||||
icon="point.topleft.down.curvedto.point.bottomright.up"
|
||||
title="Branches & worktrees"
|
||||
@@ -825,8 +834,8 @@ export function ThreadGitControls(props: {
|
||||
enablePanDownToClose
|
||||
backdropComponent={renderBackdrop}
|
||||
onDismiss={() => setCommitSheetVisible(false)}
|
||||
backgroundStyle={{ backgroundColor: "rgba(247,247,245,0.98)" }}
|
||||
handleIndicatorStyle={{ backgroundColor: "rgba(120,113,108,0.32)" }}
|
||||
backgroundStyle={{ backgroundColor: palette.sheetBackground }}
|
||||
handleIndicatorStyle={{ backgroundColor: palette.dotSeparator }}
|
||||
>
|
||||
<BottomSheetView style={{ flex: 1 }}>
|
||||
<BottomSheetScrollView
|
||||
@@ -840,10 +849,10 @@ export function ThreadGitControls(props: {
|
||||
}}
|
||||
>
|
||||
<View className="gap-1">
|
||||
<Text className="text-[24px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[24px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Commit changes
|
||||
</Text>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: palette.textSecondary }}>
|
||||
Review the file set, optionally write a message, then commit here or on a new
|
||||
feature branch.
|
||||
</Text>
|
||||
@@ -851,18 +860,18 @@ export function ThreadGitControls(props: {
|
||||
|
||||
<View
|
||||
className="gap-3 rounded-[22px] border px-4 py-4"
|
||||
style={{ backgroundColor: "#ffffff", borderColor: "rgba(23,23,23,0.08)" }}
|
||||
style={{ backgroundColor: palette.card, borderColor: palette.border }}
|
||||
>
|
||||
<View className="flex-row items-center justify-between gap-3">
|
||||
<Text className="text-[13px] font-medium" style={{ color: "#78716c" }}>
|
||||
<Text className="text-[13px] font-medium" style={{ color: palette.textMuted }}>
|
||||
Branch
|
||||
</Text>
|
||||
<Text className="text-[15px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[15px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{gitStatus?.branch ?? "(detached HEAD)"}
|
||||
</Text>
|
||||
</View>
|
||||
{isDefaultBranch ? (
|
||||
<Text className="text-[12px] leading-[18px]" style={{ color: "#b45309" }}>
|
||||
<Text className="text-[12px] leading-[18px]" style={{ color: isDarkMode ? "#fbbf24" : "#b45309" }}>
|
||||
Warning: this is the default branch.
|
||||
</Text>
|
||||
) : null}
|
||||
@@ -870,14 +879,14 @@ export function ThreadGitControls(props: {
|
||||
|
||||
<View
|
||||
className="gap-3 rounded-[22px] border px-4 py-4"
|
||||
style={{ backgroundColor: "#ffffff", borderColor: "rgba(23,23,23,0.08)" }}
|
||||
style={{ backgroundColor: palette.card, borderColor: palette.border }}
|
||||
>
|
||||
<View className="flex-row items-center justify-between gap-3">
|
||||
<View className="gap-1">
|
||||
<Text className="text-[16px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[16px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Files
|
||||
</Text>
|
||||
<Text className="text-[12px] leading-[18px]" style={{ color: "#78716c" }}>
|
||||
<Text className="text-[12px] leading-[18px]" style={{ color: palette.textMuted }}>
|
||||
{selectedFiles.length} selected · +{selectedInsertions} / -{selectedDeletions}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -885,12 +894,12 @@ export function ThreadGitControls(props: {
|
||||
{!allSelected && isEditingFiles ? (
|
||||
<Pressable
|
||||
className="rounded-full px-3 py-2"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.05)" }}
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
onPress={() => setExcludedFiles(new Set())}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#171717" }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
Reset
|
||||
</Text>
|
||||
@@ -898,12 +907,12 @@ export function ThreadGitControls(props: {
|
||||
) : null}
|
||||
<Pressable
|
||||
className="rounded-full px-3 py-2"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.05)" }}
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
onPress={() => setIsEditingFiles((current) => !current)}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#171717" }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
{isEditingFiles ? "Done" : "Edit"}
|
||||
</Text>
|
||||
@@ -912,7 +921,7 @@ export function ThreadGitControls(props: {
|
||||
</View>
|
||||
|
||||
{allFiles.length === 0 ? (
|
||||
<Text className="text-[13px] leading-[19px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] leading-[19px]" style={{ color: palette.textSecondary }}>
|
||||
No changed files are available to commit.
|
||||
</Text>
|
||||
) : !isEditingFiles ? (
|
||||
@@ -922,7 +931,7 @@ export function ThreadGitControls(props: {
|
||||
<Text
|
||||
className="flex-1 text-[13px] font-medium"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#292524" }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
{file.path}
|
||||
</Text>
|
||||
@@ -935,7 +944,7 @@ export function ThreadGitControls(props: {
|
||||
</View>
|
||||
))}
|
||||
{selectedFiles.length > selectedFilePreview.length ? (
|
||||
<Text className="text-[12px] leading-[17px]" style={{ color: "#78716c" }}>
|
||||
<Text className="text-[12px] leading-[17px]" style={{ color: palette.textMuted }}>
|
||||
+{selectedFiles.length - selectedFilePreview.length} more files
|
||||
</Text>
|
||||
) : null}
|
||||
@@ -949,8 +958,8 @@ export function ThreadGitControls(props: {
|
||||
key={file.path}
|
||||
className="rounded-[18px] border px-4 py-3"
|
||||
style={{
|
||||
backgroundColor: included ? "#fcfbf8" : "rgba(120,113,108,0.08)",
|
||||
borderColor: included ? "rgba(23,23,23,0.08)" : "rgba(120,113,108,0.15)",
|
||||
backgroundColor: included ? palette.card : palette.subtleBg,
|
||||
borderColor: included ? palette.border : palette.borderSubtle,
|
||||
}}
|
||||
onPress={() => {
|
||||
setExcludedFiles((current) => {
|
||||
@@ -969,14 +978,14 @@ export function ThreadGitControls(props: {
|
||||
<Text
|
||||
selectable
|
||||
className="text-[13px] font-t3-bold"
|
||||
style={{ color: included ? "#171717" : "#78716c" }}
|
||||
style={{ color: included ? palette.text : palette.textMuted }}
|
||||
>
|
||||
{file.path}
|
||||
</Text>
|
||||
{!included ? (
|
||||
<Text
|
||||
className="text-[11px] leading-[16px]"
|
||||
style={{ color: "#78716c" }}
|
||||
style={{ color: palette.textMuted }}
|
||||
>
|
||||
Excluded from this commit
|
||||
</Text>
|
||||
@@ -999,7 +1008,7 @@ export function ThreadGitControls(props: {
|
||||
</View>
|
||||
|
||||
<View className="gap-2">
|
||||
<Text className="text-[13px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[13px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Commit message
|
||||
</Text>
|
||||
<TextInput
|
||||
@@ -1008,13 +1017,13 @@ export function ThreadGitControls(props: {
|
||||
onChangeText={setDialogCommitMessage}
|
||||
placeholder="Leave empty to auto-generate"
|
||||
textAlignVertical="top"
|
||||
className="min-h-[128px] rounded-[20px] border border-slate-200 bg-white px-4 py-3.5 font-sans text-[15px] text-slate-950"
|
||||
className="min-h-[128px] rounded-[20px] px-4 py-3.5 font-sans text-[15px]"
|
||||
style={{
|
||||
minHeight: 128,
|
||||
borderWidth: 1,
|
||||
borderColor: "rgba(23,23,23,0.08)",
|
||||
backgroundColor: "#ffffff",
|
||||
color: "#171717",
|
||||
borderColor: palette.inputBorder,
|
||||
backgroundColor: palette.inputBackground,
|
||||
color: palette.text,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
@@ -1055,18 +1064,18 @@ export function ThreadGitControls(props: {
|
||||
enablePanDownToClose
|
||||
backdropComponent={renderBackdrop}
|
||||
onDismiss={() => setDefaultBranchSheetVisible(false)}
|
||||
backgroundStyle={{ backgroundColor: "rgba(247,247,245,0.98)" }}
|
||||
handleIndicatorStyle={{ backgroundColor: "rgba(120,113,108,0.32)" }}
|
||||
backgroundStyle={{ backgroundColor: palette.sheetBackground }}
|
||||
handleIndicatorStyle={{ backgroundColor: palette.dotSeparator }}
|
||||
>
|
||||
<BottomSheetView
|
||||
className="gap-4 px-5 pt-2"
|
||||
style={{ paddingBottom: Math.max(insets.bottom, 18) + 8 }}
|
||||
>
|
||||
<View className="gap-1">
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{pendingDefaultBranchActionCopy?.title ?? "Run action on default branch?"}
|
||||
</Text>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: palette.textSecondary }}>
|
||||
{pendingDefaultBranchActionCopy?.description ?? "Choose how to continue."}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -1100,8 +1109,8 @@ export function ThreadGitControls(props: {
|
||||
enablePanDownToClose
|
||||
backdropComponent={renderBackdrop}
|
||||
onDismiss={() => setBranchSheetVisible(false)}
|
||||
backgroundStyle={{ backgroundColor: "rgba(247,247,245,0.98)" }}
|
||||
handleIndicatorStyle={{ backgroundColor: "rgba(120,113,108,0.32)" }}
|
||||
backgroundStyle={{ backgroundColor: palette.sheetBackground }}
|
||||
handleIndicatorStyle={{ backgroundColor: palette.dotSeparator }}
|
||||
>
|
||||
<BottomSheetView style={{ flex: 1 }}>
|
||||
<BottomSheetScrollView
|
||||
@@ -1114,18 +1123,21 @@ export function ThreadGitControls(props: {
|
||||
}}
|
||||
>
|
||||
<View className="gap-1">
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Branches & worktrees
|
||||
</Text>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: palette.textSecondary }}>
|
||||
Switch this thread, create a branch, or move work onto its own worktree.
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View className="gap-2 rounded-[18px] border border-black/8 bg-white px-4 py-4">
|
||||
<View
|
||||
className="gap-2 rounded-[18px] border px-4 py-4"
|
||||
style={{ backgroundColor: palette.card, borderColor: palette.border }}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#57534e", letterSpacing: 1 }}
|
||||
style={{ color: palette.textSecondary, letterSpacing: 1 }}
|
||||
>
|
||||
New branch
|
||||
</Text>
|
||||
@@ -1133,7 +1145,13 @@ export function ThreadGitControls(props: {
|
||||
value={newBranchName}
|
||||
onChangeText={setNewBranchName}
|
||||
placeholder="feature/mobile-polish"
|
||||
className="rounded-[18px] border border-slate-200 bg-white px-3.5 py-3 font-sans text-[15px] text-slate-950"
|
||||
className="rounded-[18px] px-3.5 py-3 font-sans text-[15px]"
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
borderColor: palette.inputBorder,
|
||||
backgroundColor: palette.inputBackground,
|
||||
color: palette.text,
|
||||
}}
|
||||
/>
|
||||
<SheetActionButton
|
||||
icon="plus"
|
||||
@@ -1153,10 +1171,13 @@ export function ThreadGitControls(props: {
|
||||
/>
|
||||
</View>
|
||||
|
||||
<View className="gap-2 rounded-[18px] border border-black/8 bg-white px-4 py-4">
|
||||
<View
|
||||
className="gap-2 rounded-[18px] border px-4 py-4"
|
||||
style={{ backgroundColor: palette.card, borderColor: palette.border }}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#57534e", letterSpacing: 1 }}
|
||||
style={{ color: palette.textSecondary, letterSpacing: 1 }}
|
||||
>
|
||||
New worktree
|
||||
</Text>
|
||||
@@ -1164,13 +1185,25 @@ export function ThreadGitControls(props: {
|
||||
value={worktreeBaseBranch}
|
||||
onChangeText={setWorktreeBaseBranch}
|
||||
placeholder="main"
|
||||
className="rounded-[18px] border border-slate-200 bg-white px-3.5 py-3 font-sans text-[15px] text-slate-950"
|
||||
className="rounded-[18px] px-3.5 py-3 font-sans text-[15px]"
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
borderColor: palette.inputBorder,
|
||||
backgroundColor: palette.inputBackground,
|
||||
color: palette.text,
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
value={worktreeBranchName}
|
||||
onChangeText={setWorktreeBranchName}
|
||||
placeholder="feature/mobile-thread"
|
||||
className="rounded-[18px] border border-slate-200 bg-white px-3.5 py-3 font-sans text-[15px] text-slate-950"
|
||||
className="rounded-[18px] px-3.5 py-3 font-sans text-[15px]"
|
||||
style={{
|
||||
borderWidth: 1,
|
||||
borderColor: palette.inputBorder,
|
||||
backgroundColor: palette.inputBackground,
|
||||
color: palette.text,
|
||||
}}
|
||||
/>
|
||||
<SheetActionButton
|
||||
icon="square.split.2x1"
|
||||
@@ -1201,17 +1234,17 @@ export function ThreadGitControls(props: {
|
||||
<View className="gap-2">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#57534e", letterSpacing: 1 }}
|
||||
style={{ color: palette.textSecondary, letterSpacing: 1 }}
|
||||
>
|
||||
Existing branches
|
||||
</Text>
|
||||
{branchesLoading ? (
|
||||
<Text className="text-[13px] font-medium" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium" style={{ color: palette.textSecondary }}>
|
||||
Loading branches…
|
||||
</Text>
|
||||
) : null}
|
||||
{!branchesLoading && availableBranches.length === 0 ? (
|
||||
<Text className="text-[13px] font-medium" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium" style={{ color: palette.textSecondary }}>
|
||||
No local branches found.
|
||||
</Text>
|
||||
) : null}
|
||||
@@ -1231,8 +1264,8 @@ export function ThreadGitControls(props: {
|
||||
className="gap-1 rounded-[18px] border px-4 py-3"
|
||||
disabled={busy || disabled}
|
||||
style={{
|
||||
backgroundColor: "#ffffff",
|
||||
borderColor: branch.current ? "rgba(23,23,23,0.25)" : "rgba(23,23,23,0.08)",
|
||||
backgroundColor: palette.card,
|
||||
borderColor: branch.current ? palette.subtleBgStrong : palette.border,
|
||||
opacity: busy || disabled ? 0.45 : 1,
|
||||
}}
|
||||
onPress={() => {
|
||||
@@ -1241,10 +1274,10 @@ export function ThreadGitControls(props: {
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Text className="text-[15px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[15px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{branch.name}
|
||||
</Text>
|
||||
<Text className="text-[12px] font-medium" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[12px] font-medium" style={{ color: palette.textSecondary }}>
|
||||
{subtitle}
|
||||
</Text>
|
||||
</Pressable>
|
||||
|
||||
@@ -17,6 +17,7 @@ import { EmptyState } from "../../components/EmptyState";
|
||||
import { GlassSafeAreaView } from "../../components/GlassSafeAreaView";
|
||||
import { StatusPill } from "../../components/StatusPill";
|
||||
import type { MobileLayout } from "../../lib/mobileLayout";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import {
|
||||
scopedThreadKey,
|
||||
type ScopedMobileProject,
|
||||
@@ -69,27 +70,30 @@ function ActionButton(props: {
|
||||
readonly primary?: boolean;
|
||||
readonly onPress: () => void;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
className="min-h-[50px] flex-1 flex-row items-center justify-center gap-2 rounded-[16px] px-3 py-3"
|
||||
style={{
|
||||
backgroundColor: props.primary ? "#171717" : "#ffffff",
|
||||
backgroundColor: props.primary ? palette.primaryButton : palette.secondaryButton,
|
||||
borderWidth: props.primary ? 0 : 1,
|
||||
borderColor: props.primary ? "transparent" : "rgba(23,23,23,0.08)",
|
||||
borderColor: props.primary ? "transparent" : palette.secondaryButtonBorder,
|
||||
}}
|
||||
onPress={props.onPress}
|
||||
>
|
||||
<SymbolView
|
||||
name={props.icon}
|
||||
size={18}
|
||||
tintColor={props.primary ? "#fafaf9" : "#171717"}
|
||||
tintColor={props.primary ? palette.primaryButtonText : palette.secondaryButtonText}
|
||||
type="monochrome"
|
||||
weight="medium"
|
||||
/>
|
||||
<Text
|
||||
className="text-[13px] font-t3-bold uppercase"
|
||||
style={{
|
||||
color: props.primary ? "#fafaf9" : "#171717",
|
||||
color: props.primary ? palette.primaryButtonText : palette.secondaryButtonText,
|
||||
letterSpacing: 0.9,
|
||||
}}
|
||||
>
|
||||
@@ -104,25 +108,28 @@ function StatCard(props: {
|
||||
readonly value: string;
|
||||
readonly icon: React.ComponentProps<typeof SymbolView>["name"];
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
|
||||
return (
|
||||
<View
|
||||
className="flex-1 gap-2 rounded-[18px] px-4 py-4"
|
||||
style={{
|
||||
backgroundColor: "#ffffff",
|
||||
backgroundColor: palette.card,
|
||||
borderWidth: 1,
|
||||
borderColor: "rgba(23,23,23,0.08)",
|
||||
borderColor: palette.border,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-center gap-2">
|
||||
<SymbolView name={props.icon} size={15} tintColor="#57534e" type="monochrome" />
|
||||
<SymbolView name={props.icon} size={15} tintColor={palette.textSecondary} type="monochrome" />
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#57534e", letterSpacing: 1 }}
|
||||
style={{ color: palette.textSecondary, letterSpacing: 1 }}
|
||||
>
|
||||
{props.label}
|
||||
</Text>
|
||||
</View>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[28px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{props.value}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -135,10 +142,20 @@ function ThreadRow(props: {
|
||||
readonly selected?: boolean;
|
||||
readonly onPress: (sourceFrame: TransitionSourceFrame | null) => void;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const containerRef = useRef<RNView>(null);
|
||||
const tone = threadStatusTone(props.thread);
|
||||
const backgroundColor = props.selected ? "rgba(249,115,22,0.09)" : "#ffffff";
|
||||
const borderColor = props.selected ? "rgba(249,115,22,0.28)" : "rgba(23,23,23,0.08)";
|
||||
const backgroundColor = props.selected
|
||||
? isDarkMode
|
||||
? "rgba(249,115,22,0.12)"
|
||||
: "rgba(249,115,22,0.09)"
|
||||
: palette.card;
|
||||
const borderColor = props.selected
|
||||
? isDarkMode
|
||||
? "rgba(249,115,22,0.32)"
|
||||
: "rgba(249,115,22,0.28)"
|
||||
: palette.border;
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
@@ -161,10 +178,10 @@ function ThreadRow(props: {
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-3">
|
||||
<View className="flex-1 gap-2">
|
||||
<Text className="text-[17px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[17px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{props.thread.title}
|
||||
</Text>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: palette.textSecondary }}>
|
||||
{lastConversationLine(props.thread)}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -173,7 +190,7 @@ function ThreadRow(props: {
|
||||
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#78716c", letterSpacing: 0.9 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 0.9 }}
|
||||
>
|
||||
{props.thread.environmentLabel} · {props.thread.modelSelection.provider} ·{" "}
|
||||
{relativeTime(props.thread.updatedAt ?? props.thread.createdAt)}
|
||||
@@ -193,6 +210,8 @@ function ProjectSection(props: {
|
||||
sourceFrame: TransitionSourceFrame | null,
|
||||
) => void;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
const visibleThreads = expanded ? props.threads : props.threads.slice(0, 2);
|
||||
const hiddenCount = Math.max(props.threads.length - visibleThreads.length, 0);
|
||||
@@ -200,25 +219,25 @@ function ProjectSection(props: {
|
||||
return (
|
||||
<View
|
||||
className="gap-3 rounded-[22px] border px-4 py-4"
|
||||
style={{ borderColor: "rgba(23,23,23,0.08)" }}
|
||||
style={{ borderColor: palette.border }}
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-3">
|
||||
<View className="flex-1 gap-1">
|
||||
<Text className="text-[15px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[15px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{props.project.environmentLabel}
|
||||
</Text>
|
||||
<Text className="text-[12px] font-medium leading-[18px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[12px] font-medium leading-[18px]" style={{ color: palette.textSecondary }}>
|
||||
{props.project.workspaceRoot}
|
||||
</Text>
|
||||
</View>
|
||||
<Pressable
|
||||
className="rounded-full px-3 py-2"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.06)" }}
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
onPress={() => void props.onCreateThread(props.project)}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#171717", letterSpacing: 0.9 }}
|
||||
style={{ color: palette.text, letterSpacing: 0.9 }}
|
||||
>
|
||||
New thread
|
||||
</Text>
|
||||
@@ -247,12 +266,12 @@ function ProjectSection(props: {
|
||||
{hiddenCount > 0 ? (
|
||||
<Pressable
|
||||
className="items-center rounded-[16px] px-3 py-3"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.04)" }}
|
||||
style={{ backgroundColor: palette.separator }}
|
||||
onPress={() => setExpanded((current) => !current)}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#57534e", letterSpacing: 1 }}
|
||||
style={{ color: palette.textSecondary, letterSpacing: 1 }}
|
||||
>
|
||||
{expanded ? "Show less" : `Show ${hiddenCount} more`}
|
||||
</Text>
|
||||
@@ -270,19 +289,25 @@ function CreateThreadModal(props: {
|
||||
readonly onClose: () => void;
|
||||
readonly onSelectProject: (project: ScopedMobileProject) => Promise<void>;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
|
||||
if (!props.group) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal transparent animationType="slide" visible={props.visible} onRequestClose={props.onClose}>
|
||||
<View className="flex-1 justify-end" style={{ backgroundColor: "rgba(10,10,10,0.24)" }}>
|
||||
<View className="gap-4 rounded-t-[28px] bg-stone-50 px-5 pb-8 pt-5">
|
||||
<View className="flex-1 justify-end" style={{ backgroundColor: palette.backdrop }}>
|
||||
<View
|
||||
className="gap-4 rounded-t-[28px] px-5 pb-8 pt-5"
|
||||
style={{ backgroundColor: palette.screenBackground }}
|
||||
>
|
||||
<View className="gap-1">
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: palette.text }}>
|
||||
New thread in {props.group.title}
|
||||
</Text>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: palette.textSecondary }}>
|
||||
Choose which environment should own the new thread.
|
||||
</Text>
|
||||
</View>
|
||||
@@ -291,31 +316,31 @@ function CreateThreadModal(props: {
|
||||
{props.group.projects.map(({ project, threads }) => (
|
||||
<Pressable
|
||||
key={project.environmentId + project.id}
|
||||
className="gap-2 rounded-[20px] border bg-white px-4 py-4"
|
||||
style={{ borderColor: "rgba(23,23,23,0.08)" }}
|
||||
className="gap-2 rounded-[20px] border px-4 py-4"
|
||||
style={{ backgroundColor: palette.card, borderColor: palette.border }}
|
||||
onPress={() => {
|
||||
void props.onSelectProject(project).then(props.onClose);
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-3">
|
||||
<View className="flex-1 gap-1">
|
||||
<Text className="text-[16px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[16px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{project.environmentLabel}
|
||||
</Text>
|
||||
<Text
|
||||
className="text-[12px] font-medium leading-[18px]"
|
||||
style={{ color: "#57534e" }}
|
||||
style={{ color: palette.textSecondary }}
|
||||
>
|
||||
{project.workspaceRoot}
|
||||
</Text>
|
||||
</View>
|
||||
<View
|
||||
className="rounded-full px-3 py-2"
|
||||
style={{ backgroundColor: "rgba(23,23,23,0.06)" }}
|
||||
style={{ backgroundColor: palette.subtleBg }}
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#171717", letterSpacing: 0.9 }}
|
||||
style={{ color: palette.text, letterSpacing: 0.9 }}
|
||||
>
|
||||
{threads.length} thread{threads.length === 1 ? "" : "s"}
|
||||
</Text>
|
||||
@@ -334,6 +359,7 @@ function CreateThreadModal(props: {
|
||||
|
||||
export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const repositoryGroups = useMemo(
|
||||
() => groupProjectsByRepository({ projects: props.projects, threads: props.threads }),
|
||||
[props.projects, props.threads],
|
||||
@@ -342,8 +368,7 @@ export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
const isSplitLayout = props.layout.usesSplitView;
|
||||
const contentHorizontalPadding = isSplitLayout ? 18 : 20;
|
||||
const panelBorderColor = isSplitLayout ? "rgba(23,23,23,0.08)" : "transparent";
|
||||
const panelBackgroundColor = isDarkMode ? "#0c1118" : "#f7f7f5";
|
||||
const panelBorderColor = isSplitLayout ? palette.border : "transparent";
|
||||
const refreshThreads = props.onRefresh;
|
||||
|
||||
const handleRefresh = useCallback(async (): Promise<void> => {
|
||||
@@ -363,7 +388,7 @@ export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
<View
|
||||
className="flex-1"
|
||||
style={{
|
||||
backgroundColor: panelBackgroundColor,
|
||||
backgroundColor: palette.screenBackground,
|
||||
borderRadius: isSplitLayout ? 32 : 0,
|
||||
borderWidth: isSplitLayout ? 1 : 0,
|
||||
borderColor: panelBorderColor,
|
||||
@@ -372,7 +397,7 @@ export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
>
|
||||
<View className="absolute inset-x-0 top-0 z-20">
|
||||
<GlassSafeAreaView
|
||||
leftSlot={props.showBrandWordmark ? <BrandMark compact dark={isDarkMode} /> : null}
|
||||
leftSlot={props.showBrandWordmark ? <BrandMark compact /> : null}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -394,23 +419,23 @@ export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
layout={LinearTransition.springify().damping(18).stiffness(180)}
|
||||
className="gap-4 rounded-[26px] px-4 py-4"
|
||||
style={{
|
||||
backgroundColor: "rgba(255,255,255,0.94)",
|
||||
backgroundColor: palette.cardTranslucent,
|
||||
borderWidth: 1,
|
||||
borderColor: "rgba(23,23,23,0.08)",
|
||||
borderColor: palette.border,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-4">
|
||||
<View className="flex-1 gap-2">
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#78716c", letterSpacing: 1.1 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 1.1 }}
|
||||
>
|
||||
{props.heroTitle}
|
||||
</Text>
|
||||
<Text className="text-[26px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[26px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{isSplitLayout ? "Native workspace" : "Repo board"}
|
||||
</Text>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: "#57534e" }}>
|
||||
<Text className="text-[13px] font-medium leading-[19px]" style={{ color: palette.textSecondary }}>
|
||||
{isSplitLayout
|
||||
? "Keep your repositories visible while you move between active threads."
|
||||
: "Your connected repositories, grouped by identity across environments."}
|
||||
@@ -462,27 +487,27 @@ export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
layout={LinearTransition.springify().damping(18).stiffness(180)}
|
||||
className="gap-4 rounded-[26px] px-4 py-4"
|
||||
style={{
|
||||
backgroundColor: "rgba(255,255,255,0.94)",
|
||||
backgroundColor: palette.cardTranslucent,
|
||||
borderWidth: 1,
|
||||
borderColor: "rgba(23,23,23,0.08)",
|
||||
borderColor: palette.border,
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-4">
|
||||
<View className="flex-1 gap-1">
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[22px] font-t3-bold" style={{ color: palette.text }}>
|
||||
{group.title}
|
||||
</Text>
|
||||
{group.subtitle ? (
|
||||
<Text
|
||||
className="text-[13px] font-medium leading-[19px]"
|
||||
style={{ color: "#57534e" }}
|
||||
style={{ color: palette.textSecondary }}
|
||||
>
|
||||
{group.subtitle}
|
||||
</Text>
|
||||
) : null}
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#78716c", letterSpacing: 0.9 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: 0.9 }}
|
||||
>
|
||||
{group.projectCount} environment{group.projectCount === 1 ? "" : "s"} ·{" "}
|
||||
{group.threadCount} active thread{group.threadCount === 1 ? "" : "s"}
|
||||
@@ -491,7 +516,7 @@ export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
|
||||
<Pressable
|
||||
className="rounded-full px-3 py-2"
|
||||
style={{ backgroundColor: "#171717" }}
|
||||
style={{ backgroundColor: palette.primaryButton }}
|
||||
onPress={() => {
|
||||
if (group.projects.length === 1) {
|
||||
void props.onCreateThread(group.projects[0]!.project);
|
||||
@@ -502,7 +527,7 @@ export function ThreadListScreen(props: ThreadListScreenProps) {
|
||||
>
|
||||
<Text
|
||||
className="text-[11px] font-t3-bold uppercase"
|
||||
style={{ color: "#fafaf9", letterSpacing: 0.9 }}
|
||||
style={{ color: palette.primaryButtonText, letterSpacing: 0.9 }}
|
||||
>
|
||||
New thread
|
||||
</Text>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SymbolView } from "expo-symbols";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { Modal, Pressable, ScrollView, useWindowDimensions, View } from "react-native";
|
||||
import { Modal, Pressable, ScrollView, useColorScheme, useWindowDimensions, View } from "react-native";
|
||||
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import Animated, {
|
||||
@@ -16,6 +16,7 @@ import { groupProjectsByRepository } from "../../lib/repositoryGroups";
|
||||
import type { ScopedMobileProject, ScopedMobileThread } from "../../lib/scopedEntities";
|
||||
import { scopedThreadKey } from "../../lib/scopedEntities";
|
||||
import { relativeTime } from "../../lib/time";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { threadStatusTone } from "./threadPresentation";
|
||||
|
||||
function compareThreadActivity(left: ScopedMobileThread, right: ScopedMobileThread): number {
|
||||
@@ -34,6 +35,8 @@ export function ThreadNavigationDrawer(props: {
|
||||
readonly onSelectThread: (thread: ScopedMobileThread) => void;
|
||||
readonly onStartNewTask: () => void;
|
||||
}) {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
const palette = makeAppPalette(isDarkMode);
|
||||
const insets = useSafeAreaInsets();
|
||||
const { width } = useWindowDimensions();
|
||||
const drawerWidth = Math.min(width * 0.84, 360);
|
||||
@@ -120,7 +123,7 @@ export function ThreadNavigationDrawer(props: {
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
backgroundColor: "rgba(15,23,42,0.22)",
|
||||
backgroundColor: palette.backdrop,
|
||||
},
|
||||
backdropStyle,
|
||||
]}
|
||||
@@ -139,16 +142,16 @@ export function ThreadNavigationDrawer(props: {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
width: drawerWidth,
|
||||
backgroundColor: "rgba(250,248,242,0.99)",
|
||||
backgroundColor: palette.drawerBackground,
|
||||
paddingTop: insets.top + 10,
|
||||
paddingBottom: Math.max(insets.bottom, 18),
|
||||
boxShadow: "20px 0 36px rgba(15,23,42,0.12)",
|
||||
boxShadow: `20px 0 36px ${palette.drawerShadow}`,
|
||||
},
|
||||
drawerStyle,
|
||||
]}
|
||||
>
|
||||
<View className="flex-row items-center justify-between px-4 pb-5">
|
||||
<Text className="text-[26px] font-t3-bold" style={{ color: "#171717" }}>
|
||||
<Text className="text-[26px] font-t3-bold" style={{ color: palette.text }}>
|
||||
Threads
|
||||
</Text>
|
||||
<Pressable
|
||||
@@ -157,12 +160,12 @@ export function ThreadNavigationDrawer(props: {
|
||||
props.onStartNewTask();
|
||||
}}
|
||||
className="h-11 w-11 items-center justify-center rounded-full"
|
||||
style={{ backgroundColor: "#171717" }}
|
||||
style={{ backgroundColor: palette.primaryButton }}
|
||||
>
|
||||
<SymbolView
|
||||
name="square.and.pencil"
|
||||
size={17}
|
||||
tintColor="#fafaf9"
|
||||
tintColor={palette.primaryButtonText}
|
||||
type="monochrome"
|
||||
/>
|
||||
</Pressable>
|
||||
@@ -180,18 +183,18 @@ export function ThreadNavigationDrawer(props: {
|
||||
<View key={group.key} className="gap-3">
|
||||
<Text
|
||||
className="px-1 text-[15px] font-t3-bold"
|
||||
style={{ color: "#78716c", letterSpacing: -0.2 }}
|
||||
style={{ color: palette.textMuted, letterSpacing: -0.2 }}
|
||||
>
|
||||
{group.title}
|
||||
</Text>
|
||||
|
||||
<View
|
||||
className="overflow-hidden rounded-[22px]"
|
||||
style={{ backgroundColor: "#ffffff" }}
|
||||
style={{ backgroundColor: palette.card }}
|
||||
>
|
||||
{group.threads.length === 0 ? (
|
||||
<View className="px-4 py-4">
|
||||
<Text className="text-[14px] font-medium" style={{ color: "#a8a29e" }}>
|
||||
<Text className="text-[14px] font-medium" style={{ color: palette.textTertiary }}>
|
||||
No threads yet
|
||||
</Text>
|
||||
</View>
|
||||
@@ -211,8 +214,8 @@ export function ThreadNavigationDrawer(props: {
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 15,
|
||||
borderTopWidth: index === 0 ? 0 : 1,
|
||||
borderTopColor: "rgba(23,23,23,0.06)",
|
||||
backgroundColor: selected ? "rgba(23,23,23,0.04)" : "transparent",
|
||||
borderTopColor: palette.borderSubtle,
|
||||
backgroundColor: selected ? palette.subtleBg : "transparent",
|
||||
}}
|
||||
>
|
||||
<View className="flex-row items-start justify-between gap-3">
|
||||
@@ -220,14 +223,14 @@ export function ThreadNavigationDrawer(props: {
|
||||
<Text
|
||||
className="text-[16px] font-t3-bold"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#171717" }}
|
||||
style={{ color: palette.text }}
|
||||
>
|
||||
{thread.title}
|
||||
</Text>
|
||||
<Text
|
||||
className="text-[13px] font-medium"
|
||||
numberOfLines={1}
|
||||
style={{ color: "#78716c" }}
|
||||
style={{ color: palette.textMuted }}
|
||||
>
|
||||
{relativeTime(thread.updatedAt ?? thread.createdAt)}
|
||||
</Text>
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
import { useLocalSearchParams, useRouter } from "expo-router";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { ScrollView, useColorScheme, View } from "react-native";
|
||||
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
import { EmptyState } from "../../components/EmptyState";
|
||||
import { LoadingScreen } from "../../components/LoadingScreen";
|
||||
import { buildThreadRoutePath, dismissRoute } from "../../lib/routes";
|
||||
import { scopedThreadKey } from "../../lib/scopedEntities";
|
||||
import { makeAppPalette } from "../../lib/theme";
|
||||
import { ThreadDetailScreen } from "./ThreadDetailScreen";
|
||||
import { ThreadNavigationDrawer } from "./ThreadNavigationDrawer";
|
||||
|
||||
function firstRouteParam(value: string | string[] | undefined): string | null {
|
||||
if (Array.isArray(value)) {
|
||||
return value[0] ?? null;
|
||||
}
|
||||
|
||||
return value ?? null;
|
||||
}
|
||||
|
||||
export function ThreadRouteScreen() {
|
||||
const app = useRemoteApp();
|
||||
const router = useRouter();
|
||||
const colorScheme = useColorScheme();
|
||||
const isDarkMode = colorScheme !== "light";
|
||||
const params = useLocalSearchParams<{
|
||||
environmentId?: string | string[];
|
||||
threadId?: string | string[];
|
||||
}>();
|
||||
const [drawerVisible, setDrawerVisible] = useState(false);
|
||||
const environmentId = firstRouteParam(params.environmentId);
|
||||
const threadId = firstRouteParam(params.threadId);
|
||||
|
||||
const routeThread = useMemo(() => {
|
||||
if (!environmentId || !threadId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
app.threads.find(
|
||||
(thread) => thread.environmentId === environmentId && thread.id === threadId,
|
||||
) ?? null
|
||||
);
|
||||
}, [app.threads, environmentId, threadId]);
|
||||
|
||||
const selectedMatchesRoute =
|
||||
app.selectedThread?.environmentId === environmentId && app.selectedThread?.id === threadId;
|
||||
|
||||
useEffect(() => {
|
||||
if (!routeThread) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedMatchesRoute) {
|
||||
return;
|
||||
}
|
||||
|
||||
app.onSelectThread(routeThread);
|
||||
}, [app, routeThread, selectedMatchesRoute]);
|
||||
|
||||
if (!environmentId || !threadId) {
|
||||
return <LoadingScreen message="Opening thread…" />;
|
||||
}
|
||||
|
||||
if (!routeThread) {
|
||||
const stillHydrating =
|
||||
app.isLoadingSavedConnection ||
|
||||
app.connectionState === "connecting" ||
|
||||
app.connectionState === "reconnecting";
|
||||
|
||||
if (stillHydrating) {
|
||||
return <LoadingScreen message="Opening thread…" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
contentInsetAdjustmentBehavior="automatic"
|
||||
contentContainerStyle={{
|
||||
flexGrow: 1,
|
||||
justifyContent: "center",
|
||||
paddingHorizontal: 24,
|
||||
paddingVertical: 32,
|
||||
}}
|
||||
style={{ flex: 1, backgroundColor: makeAppPalette(isDarkMode).screenBackground }}
|
||||
>
|
||||
<EmptyState
|
||||
title="Thread unavailable"
|
||||
detail="This thread is not available in the current mobile snapshot."
|
||||
/>
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
|
||||
if (!selectedMatchesRoute || !app.selectedThread) {
|
||||
return <LoadingScreen message="Opening thread…" />;
|
||||
}
|
||||
|
||||
const selectedThreadKey = scopedThreadKey(
|
||||
app.selectedThread.environmentId,
|
||||
app.selectedThread.id,
|
||||
);
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
<ThreadDetailScreen
|
||||
selectedThread={app.selectedThread}
|
||||
screenTone={app.screenTone}
|
||||
connectionError={app.connectionError}
|
||||
httpBaseUrl={app.selectedEnvironmentBaseUrl}
|
||||
bearerToken={app.selectedEnvironmentBearerToken}
|
||||
selectedThreadFeed={app.selectedThreadFeed}
|
||||
activeWorkDurationLabel={app.activeWorkDurationLabel}
|
||||
activePendingApproval={app.activePendingApproval}
|
||||
respondingApprovalId={app.respondingApprovalId}
|
||||
activePendingUserInput={app.activePendingUserInput}
|
||||
activePendingUserInputDrafts={app.activePendingUserInputDrafts}
|
||||
activePendingUserInputAnswers={app.activePendingUserInputAnswers}
|
||||
respondingUserInputId={app.respondingUserInputId}
|
||||
draftMessage={app.draftMessage}
|
||||
draftAttachments={app.draftAttachments}
|
||||
connectionStateLabel={app.connectionState}
|
||||
activeThreadBusy={app.activeThreadBusy}
|
||||
selectedThreadGitStatus={app.selectedThreadGitStatus}
|
||||
gitOperationLabel={app.gitOperationLabel}
|
||||
selectedThreadQueueCount={app.selectedThreadQueueCount}
|
||||
onBack={() => dismissRoute(router)}
|
||||
onOpenDrawer={() => setDrawerVisible(true)}
|
||||
onOpenConnectionEditor={() => router.push("/connections")}
|
||||
onChangeDraftMessage={app.onChangeDraftMessage}
|
||||
onPickDraftImages={app.onPickDraftImages}
|
||||
onPasteIntoDraft={app.onPasteIntoDraft}
|
||||
onRemoveDraftImage={app.onRemoveDraftImage}
|
||||
onRefresh={app.onRefresh}
|
||||
onRefreshSelectedThreadGitStatus={app.onRefreshSelectedThreadGitStatus}
|
||||
onListSelectedThreadBranches={app.onListSelectedThreadBranches}
|
||||
onCheckoutSelectedThreadBranch={app.onCheckoutSelectedThreadBranch}
|
||||
onCreateSelectedThreadBranch={app.onCreateSelectedThreadBranch}
|
||||
onCreateSelectedThreadWorktree={app.onCreateSelectedThreadWorktree}
|
||||
onPullSelectedThreadBranch={app.onPullSelectedThreadBranch}
|
||||
onRunSelectedThreadGitAction={app.onRunSelectedThreadGitAction}
|
||||
onRenameThread={app.onRenameThread}
|
||||
onStopThread={app.onStopThread}
|
||||
onSendMessage={app.onSendMessage}
|
||||
onRespondToApproval={app.onRespondToApproval}
|
||||
onSelectUserInputOption={app.onSelectUserInputOption}
|
||||
onChangeUserInputCustomAnswer={app.onChangeUserInputCustomAnswer}
|
||||
onSubmitUserInput={app.onSubmitUserInput}
|
||||
/>
|
||||
|
||||
<ThreadNavigationDrawer
|
||||
visible={drawerVisible}
|
||||
projects={app.projects}
|
||||
threads={app.threads}
|
||||
selectedThreadKey={selectedThreadKey}
|
||||
onClose={() => setDrawerVisible(false)}
|
||||
onSelectThread={(thread) => {
|
||||
app.onSelectThread(thread);
|
||||
router.replace(buildThreadRoutePath(thread));
|
||||
}}
|
||||
onStartNewTask={() => router.push("/new")}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,490 @@
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
|
||||
import type {
|
||||
ClaudeCodeEffort,
|
||||
GitBranch,
|
||||
ModelSelection,
|
||||
ProviderInteractionMode,
|
||||
RuntimeMode,
|
||||
ServerConfig as T3ServerConfig,
|
||||
} from "@t3tools/contracts";
|
||||
import { DEFAULT_PROVIDER_INTERACTION_MODE, DEFAULT_RUNTIME_MODE } from "@t3tools/contracts";
|
||||
|
||||
import type { DraftComposerImageAttachment } from "../../lib/composerImages";
|
||||
import { groupProjectsByRepository } from "../../lib/repositoryGroups";
|
||||
import type { ScopedMobileProject } from "../../lib/scopedEntities";
|
||||
import { scopedProjectKey } from "../../lib/scopedEntities";
|
||||
import { useRemoteApp } from "../../state/remote-app-state-provider";
|
||||
|
||||
export type WorkspaceMode = "local" | "worktree";
|
||||
|
||||
export type ModelOption = {
|
||||
readonly key: string;
|
||||
readonly label: string;
|
||||
readonly subtitle: string;
|
||||
readonly providerKey: string;
|
||||
readonly providerLabel: string;
|
||||
readonly selection: ModelSelection;
|
||||
};
|
||||
|
||||
export type ProviderGroup = {
|
||||
readonly providerKey: string;
|
||||
readonly providerLabel: string;
|
||||
readonly models: ReadonlyArray<ModelOption>;
|
||||
};
|
||||
|
||||
export function normalizeSelectedWorktreePath(
|
||||
project: ScopedMobileProject,
|
||||
branch: GitBranch,
|
||||
): string | null {
|
||||
if (!branch.worktreePath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return branch.worktreePath === project.workspaceRoot ? null : branch.worktreePath;
|
||||
}
|
||||
|
||||
export function branchBadgeLabel(input: {
|
||||
readonly branch: GitBranch;
|
||||
readonly project: ScopedMobileProject | null;
|
||||
}): string | null {
|
||||
if (input.branch.current) {
|
||||
return "current";
|
||||
}
|
||||
if (input.branch.worktreePath && input.branch.worktreePath !== input.project?.workspaceRoot) {
|
||||
return "worktree";
|
||||
}
|
||||
if (input.branch.isDefault) {
|
||||
return "default";
|
||||
}
|
||||
if (input.branch.isRemote) {
|
||||
return "remote";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function providerDisplayLabel(provider: string): string {
|
||||
if (provider === "codex") return "Codex";
|
||||
if (provider === "claudeAgent") return "Claude";
|
||||
return provider;
|
||||
}
|
||||
|
||||
function buildModelOptions(
|
||||
config: T3ServerConfig | null | undefined,
|
||||
fallbackModelSelection: ModelSelection | null,
|
||||
): ReadonlyArray<ModelOption> {
|
||||
const options = new Map<string, ModelOption>();
|
||||
|
||||
for (const provider of config?.providers ?? []) {
|
||||
if (!provider.enabled || !provider.installed || provider.auth.status === "unauthenticated") {
|
||||
continue;
|
||||
}
|
||||
|
||||
const providerLabel = providerDisplayLabel(provider.provider);
|
||||
for (const model of provider.models) {
|
||||
const key = `${provider.provider}:${model.slug}`;
|
||||
options.set(key, {
|
||||
key,
|
||||
label: model.name,
|
||||
subtitle: providerLabel,
|
||||
providerKey: provider.provider,
|
||||
providerLabel,
|
||||
selection: {
|
||||
provider: provider.provider,
|
||||
model: model.slug,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (fallbackModelSelection) {
|
||||
const key = `${fallbackModelSelection.provider}:${fallbackModelSelection.model}`;
|
||||
if (!options.has(key)) {
|
||||
const providerLabel = providerDisplayLabel(fallbackModelSelection.provider);
|
||||
options.set(key, {
|
||||
key,
|
||||
label: fallbackModelSelection.model,
|
||||
subtitle: providerLabel,
|
||||
providerKey: fallbackModelSelection.provider,
|
||||
providerLabel,
|
||||
selection: fallbackModelSelection,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return [...options.values()];
|
||||
}
|
||||
|
||||
function groupByProvider(options: ReadonlyArray<ModelOption>): ReadonlyArray<ProviderGroup> {
|
||||
const groups = new Map<string, { providerLabel: string; models: ModelOption[] }>();
|
||||
for (const option of options) {
|
||||
const existing = groups.get(option.providerKey);
|
||||
if (existing) {
|
||||
existing.models.push(option);
|
||||
} else {
|
||||
groups.set(option.providerKey, {
|
||||
providerLabel: option.providerLabel,
|
||||
models: [option],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return [...groups.entries()].map(([providerKey, group]) => ({
|
||||
providerKey,
|
||||
providerLabel: group.providerLabel,
|
||||
models: group.models,
|
||||
}));
|
||||
}
|
||||
|
||||
type NewTaskFlowContextValue = {
|
||||
readonly logicalProjects: ReadonlyArray<{
|
||||
readonly key: string;
|
||||
readonly project: ScopedMobileProject;
|
||||
}>;
|
||||
readonly selectedEnvironmentId: string;
|
||||
readonly selectedProjectKey: string | null;
|
||||
readonly selectedModelKey: string | null;
|
||||
readonly workspaceMode: WorkspaceMode;
|
||||
readonly selectedBranchName: string | null;
|
||||
readonly selectedWorktreePath: string | null;
|
||||
readonly prompt: string;
|
||||
readonly attachments: ReadonlyArray<DraftComposerImageAttachment>;
|
||||
readonly submitting: boolean;
|
||||
readonly branchQuery: string;
|
||||
readonly branchesLoading: boolean;
|
||||
readonly availableBranches: ReadonlyArray<GitBranch>;
|
||||
readonly runtimeMode: RuntimeMode;
|
||||
readonly interactionMode: ProviderInteractionMode;
|
||||
readonly effort: ClaudeCodeEffort;
|
||||
readonly fastMode: boolean;
|
||||
readonly contextWindow: string;
|
||||
readonly expandedProvider: string | null;
|
||||
readonly environments: ReadonlyArray<{
|
||||
readonly environmentId: string;
|
||||
readonly environmentLabel: string;
|
||||
}>;
|
||||
readonly selectedProject: ScopedMobileProject | null;
|
||||
readonly modelOptions: ReadonlyArray<ModelOption>;
|
||||
readonly selectedModel: ModelSelection | null;
|
||||
readonly selectedModelOption: ModelOption | null;
|
||||
readonly providerGroups: ReadonlyArray<ProviderGroup>;
|
||||
readonly filteredBranches: ReadonlyArray<GitBranch>;
|
||||
readonly reset: () => void;
|
||||
readonly setProject: (project: ScopedMobileProject) => void;
|
||||
readonly selectEnvironment: (environmentId: string) => void;
|
||||
readonly setSelectedModelKey: (key: string | null) => void;
|
||||
readonly setWorkspaceMode: (mode: WorkspaceMode) => void;
|
||||
readonly selectBranch: (branch: GitBranch) => void;
|
||||
readonly setPrompt: (value: string) => void;
|
||||
readonly setAttachments: React.Dispatch<
|
||||
React.SetStateAction<ReadonlyArray<DraftComposerImageAttachment>>
|
||||
>;
|
||||
readonly setSubmitting: (value: boolean) => void;
|
||||
readonly setBranchQuery: (value: string) => void;
|
||||
readonly loadBranches: () => Promise<void>;
|
||||
readonly setRuntimeMode: (value: RuntimeMode) => void;
|
||||
readonly setInteractionMode: (value: ProviderInteractionMode) => void;
|
||||
readonly setEffort: (value: ClaudeCodeEffort) => void;
|
||||
readonly setFastMode: (value: boolean) => void;
|
||||
readonly setContextWindow: (value: string) => void;
|
||||
readonly setExpandedProvider: (value: string | null) => void;
|
||||
};
|
||||
|
||||
const NewTaskFlowContext = React.createContext<NewTaskFlowContextValue | null>(null);
|
||||
|
||||
export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
const app = useRemoteApp();
|
||||
|
||||
const repositoryGroups = useMemo(
|
||||
() => groupProjectsByRepository({ projects: app.projects, threads: app.threads }),
|
||||
[app.projects, app.threads],
|
||||
);
|
||||
const logicalProjects = useMemo(
|
||||
() =>
|
||||
repositoryGroups
|
||||
.map((group) => {
|
||||
const primaryProject = group.projects[0]?.project;
|
||||
if (!primaryProject) {
|
||||
return null;
|
||||
}
|
||||
return { key: group.key, project: primaryProject };
|
||||
})
|
||||
.filter((entry) => entry !== null),
|
||||
[repositoryGroups],
|
||||
);
|
||||
|
||||
const [selectedEnvironmentId, setSelectedEnvironmentId] = useState(
|
||||
app.projects[0]?.environmentId ?? "",
|
||||
);
|
||||
const [selectedProjectKey, setSelectedProjectKey] = useState<string | null>(null);
|
||||
const [selectedModelKey, setSelectedModelKey] = useState<string | null>(null);
|
||||
const [workspaceMode, setWorkspaceMode] = useState<WorkspaceMode>("local");
|
||||
const [selectedBranchName, setSelectedBranchName] = useState<string | null>(null);
|
||||
const [selectedWorktreePath, setSelectedWorktreePath] = useState<string | null>(null);
|
||||
const [prompt, setPrompt] = useState("");
|
||||
const [attachments, setAttachments] = useState<ReadonlyArray<DraftComposerImageAttachment>>([]);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [branchQuery, setBranchQuery] = useState("");
|
||||
const [branchesLoading, setBranchesLoading] = useState(false);
|
||||
const [availableBranches, setAvailableBranches] = useState<ReadonlyArray<GitBranch>>([]);
|
||||
const [runtimeMode, setRuntimeMode] = useState<RuntimeMode>(DEFAULT_RUNTIME_MODE);
|
||||
const [interactionMode, setInteractionMode] = useState<ProviderInteractionMode>(
|
||||
DEFAULT_PROVIDER_INTERACTION_MODE,
|
||||
);
|
||||
const [effort, setEffort] = useState<ClaudeCodeEffort>("high");
|
||||
const [fastMode, setFastMode] = useState(false);
|
||||
const [contextWindow, setContextWindow] = useState("1M");
|
||||
const [expandedProvider, setExpandedProvider] = useState<string | null>(null);
|
||||
|
||||
const reset = useCallback(() => {
|
||||
console.log("[new task flow] reset", {
|
||||
defaultEnvironmentId: app.projects[0]?.environmentId ?? null,
|
||||
projectCount: app.projects.length,
|
||||
});
|
||||
setSelectedEnvironmentId(app.projects[0]?.environmentId ?? "");
|
||||
setSelectedProjectKey(null);
|
||||
setSelectedModelKey(null);
|
||||
setWorkspaceMode("local");
|
||||
setSelectedBranchName(null);
|
||||
setSelectedWorktreePath(null);
|
||||
setPrompt("");
|
||||
setAttachments([]);
|
||||
setSubmitting(false);
|
||||
setBranchQuery("");
|
||||
setBranchesLoading(false);
|
||||
setAvailableBranches([]);
|
||||
setRuntimeMode(DEFAULT_RUNTIME_MODE);
|
||||
setInteractionMode(DEFAULT_PROVIDER_INTERACTION_MODE);
|
||||
setEffort("high");
|
||||
setFastMode(false);
|
||||
setContextWindow("1M");
|
||||
setExpandedProvider(null);
|
||||
}, [app.projects]);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedEnvironmentId || app.projects.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("[new task flow] initializing environment", {
|
||||
environmentId: app.projects[0]!.environmentId,
|
||||
});
|
||||
setSelectedEnvironmentId(app.projects[0]!.environmentId);
|
||||
}, [app.projects, selectedEnvironmentId]);
|
||||
|
||||
const environments = useMemo(
|
||||
() =>
|
||||
[
|
||||
...new Map(
|
||||
app.projects.map((project) => [project.environmentId, project.environmentLabel]),
|
||||
).entries(),
|
||||
].map(([environmentId, environmentLabel]) => ({
|
||||
environmentId,
|
||||
environmentLabel,
|
||||
})),
|
||||
[app.projects],
|
||||
);
|
||||
|
||||
const projectsForEnvironment = useMemo(
|
||||
() => app.projects.filter((project) => project.environmentId === selectedEnvironmentId),
|
||||
[app.projects, selectedEnvironmentId],
|
||||
);
|
||||
|
||||
const selectedProject =
|
||||
projectsForEnvironment.find(
|
||||
(project) => scopedProjectKey(project.environmentId, project.id) === selectedProjectKey,
|
||||
) ??
|
||||
projectsForEnvironment[0] ??
|
||||
null;
|
||||
|
||||
const modelOptions = useMemo(
|
||||
() =>
|
||||
buildModelOptions(
|
||||
selectedProject
|
||||
? (app.serverConfigByEnvironmentId[selectedProject.environmentId] ?? null)
|
||||
: null,
|
||||
selectedProject?.defaultModelSelection ?? null,
|
||||
),
|
||||
[app.serverConfigByEnvironmentId, selectedProject],
|
||||
);
|
||||
|
||||
const selectedModel =
|
||||
modelOptions.find((option) => option.key === selectedModelKey)?.selection ??
|
||||
selectedProject?.defaultModelSelection ??
|
||||
modelOptions[0]?.selection ??
|
||||
null;
|
||||
|
||||
const selectedModelOption =
|
||||
modelOptions.find(
|
||||
(option) =>
|
||||
selectedModel &&
|
||||
option.selection.provider === selectedModel.provider &&
|
||||
option.selection.model === selectedModel.model,
|
||||
) ?? null;
|
||||
|
||||
const providerGroups = useMemo(() => groupByProvider(modelOptions), [modelOptions]);
|
||||
|
||||
const filteredBranches = useMemo(() => {
|
||||
const query = branchQuery.trim().toLowerCase();
|
||||
if (query.length === 0) {
|
||||
return availableBranches;
|
||||
}
|
||||
|
||||
return availableBranches.filter((branch) => branch.name.toLowerCase().includes(query));
|
||||
}, [availableBranches, branchQuery]);
|
||||
|
||||
const setProject = useCallback((project: ScopedMobileProject) => {
|
||||
setSelectedEnvironmentId(project.environmentId);
|
||||
setSelectedProjectKey(scopedProjectKey(project.environmentId, project.id));
|
||||
}, []);
|
||||
|
||||
const selectEnvironment = useCallback((environmentId: string) => {
|
||||
setSelectedEnvironmentId(environmentId);
|
||||
setSelectedProjectKey(null);
|
||||
setSelectedBranchName(null);
|
||||
setSelectedWorktreePath(null);
|
||||
}, []);
|
||||
|
||||
const selectBranch = useCallback(
|
||||
(branch: GitBranch) => {
|
||||
setSelectedBranchName(branch.name);
|
||||
setSelectedWorktreePath(
|
||||
selectedProject ? normalizeSelectedWorktreePath(selectedProject, branch) : null,
|
||||
);
|
||||
},
|
||||
[selectedProject],
|
||||
);
|
||||
|
||||
const loadBranches = useCallback(async () => {
|
||||
if (!selectedProject) {
|
||||
return;
|
||||
}
|
||||
|
||||
setBranchesLoading(true);
|
||||
try {
|
||||
const branches = await app.onListProjectBranches(selectedProject);
|
||||
setAvailableBranches(branches);
|
||||
|
||||
if (workspaceMode === "worktree" && !selectedBranchName) {
|
||||
const preferredBranch =
|
||||
branches.find((branch) => branch.current)?.name ??
|
||||
branches.find((branch) => branch.isDefault)?.name ??
|
||||
null;
|
||||
if (preferredBranch) {
|
||||
setSelectedBranchName(preferredBranch);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
setBranchesLoading(false);
|
||||
}
|
||||
}, [app, selectedBranchName, selectedProject, workspaceMode]);
|
||||
|
||||
const value = useMemo<NewTaskFlowContextValue>(
|
||||
() => ({
|
||||
logicalProjects,
|
||||
selectedEnvironmentId,
|
||||
selectedProjectKey,
|
||||
selectedModelKey,
|
||||
workspaceMode,
|
||||
selectedBranchName,
|
||||
selectedWorktreePath,
|
||||
prompt,
|
||||
attachments,
|
||||
submitting,
|
||||
branchQuery,
|
||||
branchesLoading,
|
||||
availableBranches,
|
||||
runtimeMode,
|
||||
interactionMode,
|
||||
effort,
|
||||
fastMode,
|
||||
contextWindow,
|
||||
expandedProvider,
|
||||
environments,
|
||||
selectedProject,
|
||||
modelOptions,
|
||||
selectedModel,
|
||||
selectedModelOption,
|
||||
providerGroups,
|
||||
filteredBranches,
|
||||
reset,
|
||||
setProject,
|
||||
selectEnvironment,
|
||||
setSelectedModelKey,
|
||||
setWorkspaceMode,
|
||||
selectBranch,
|
||||
setPrompt,
|
||||
setAttachments,
|
||||
setSubmitting,
|
||||
setBranchQuery,
|
||||
loadBranches,
|
||||
setRuntimeMode,
|
||||
setInteractionMode,
|
||||
setEffort,
|
||||
setFastMode,
|
||||
setContextWindow,
|
||||
setExpandedProvider,
|
||||
}),
|
||||
[
|
||||
attachments,
|
||||
availableBranches,
|
||||
branchQuery,
|
||||
branchesLoading,
|
||||
contextWindow,
|
||||
effort,
|
||||
environments,
|
||||
expandedProvider,
|
||||
fastMode,
|
||||
filteredBranches,
|
||||
interactionMode,
|
||||
loadBranches,
|
||||
logicalProjects,
|
||||
modelOptions,
|
||||
prompt,
|
||||
providerGroups,
|
||||
reset,
|
||||
runtimeMode,
|
||||
selectedBranchName,
|
||||
selectedEnvironmentId,
|
||||
selectedModel,
|
||||
selectedModelKey,
|
||||
selectedModelOption,
|
||||
selectedProject,
|
||||
selectedProjectKey,
|
||||
selectedWorktreePath,
|
||||
setProject,
|
||||
selectBranch,
|
||||
selectEnvironment,
|
||||
submitting,
|
||||
workspaceMode,
|
||||
],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("[new task flow] state", {
|
||||
availableBranchCount: availableBranches.length,
|
||||
environmentCount: environments.length,
|
||||
logicalProjectCount: logicalProjects.length,
|
||||
selectedEnvironmentId,
|
||||
selectedProjectKey,
|
||||
selectedProjectTitle: selectedProject?.title ?? null,
|
||||
});
|
||||
}, [
|
||||
availableBranches.length,
|
||||
environments.length,
|
||||
logicalProjects.length,
|
||||
selectedEnvironmentId,
|
||||
selectedProject?.title,
|
||||
selectedProjectKey,
|
||||
]);
|
||||
|
||||
return <NewTaskFlowContext.Provider value={value}>{props.children}</NewTaskFlowContext.Provider>;
|
||||
}
|
||||
|
||||
export function useNewTaskFlow() {
|
||||
const value = React.use(NewTaskFlowContext);
|
||||
if (value === null) {
|
||||
throw new Error("useNewTaskFlow must be used within NewTaskFlowProvider.");
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -194,3 +194,57 @@ export async function pasteComposerClipboard(input: { readonly existingCount: nu
|
||||
error: "Clipboard does not contain pasteable text or image content.",
|
||||
};
|
||||
}
|
||||
|
||||
function mimeTypeFromUri(uri: string): string {
|
||||
const ext = uri.split(".").pop()?.toLowerCase();
|
||||
switch (ext) {
|
||||
case "png":
|
||||
return "image/png";
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
return "image/jpeg";
|
||||
case "gif":
|
||||
return "image/gif";
|
||||
case "webp":
|
||||
return "image/webp";
|
||||
case "heic":
|
||||
return "image/heic";
|
||||
default:
|
||||
return "image/png";
|
||||
}
|
||||
}
|
||||
|
||||
export async function convertPastedImagesToAttachments(input: {
|
||||
readonly uris: ReadonlyArray<string>;
|
||||
readonly existingCount: number;
|
||||
}): Promise<ReadonlyArray<DraftComposerImageAttachment>> {
|
||||
const { File } = await import("expo-file-system");
|
||||
const remainingSlots = PROVIDER_SEND_TURN_MAX_ATTACHMENTS - input.existingCount;
|
||||
const uris = input.uris.slice(0, Math.max(0, remainingSlots));
|
||||
const results: DraftComposerImageAttachment[] = [];
|
||||
|
||||
for (const uri of uris) {
|
||||
try {
|
||||
const file = new File(uri);
|
||||
const base64 = await file.base64();
|
||||
const sizeBytes = estimateBase64ByteSize(base64);
|
||||
if (sizeBytes <= 0 || sizeBytes > PROVIDER_SEND_TURN_MAX_IMAGE_BYTES) {
|
||||
continue;
|
||||
}
|
||||
const mimeType = mimeTypeFromUri(uri);
|
||||
results.push({
|
||||
id: newClientId("attachment"),
|
||||
type: "image",
|
||||
name: `pasted-image.${mimeType.split("/")[1] ?? "png"}`,
|
||||
mimeType,
|
||||
sizeBytes,
|
||||
dataUrl: `data:${mimeType};base64,${base64}`,
|
||||
previewUri: uri,
|
||||
});
|
||||
} catch (error) {
|
||||
console.warn("Failed to read pasted image", uri, error);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { Router } from "expo-router";
|
||||
|
||||
import type { SelectedThreadRef } from "../state/use-remote-app-state";
|
||||
import type { ScopedMobileProject, ScopedMobileThread } from "./scopedEntities";
|
||||
|
||||
type ThreadRouteInput =
|
||||
| Pick<SelectedThreadRef, "environmentId" | "threadId">
|
||||
| Pick<ScopedMobileThread, "environmentId" | "id">;
|
||||
|
||||
export function buildThreadRoutePath(input: ThreadRouteInput): string {
|
||||
const environmentId = input.environmentId;
|
||||
const threadId = "threadId" in input ? input.threadId : input.id;
|
||||
|
||||
return `/threads/${encodeURIComponent(environmentId)}/${encodeURIComponent(threadId)}`;
|
||||
}
|
||||
|
||||
export function buildNewTaskDraftRoutePath(
|
||||
project: Pick<ScopedMobileProject, "environmentId" | "id">,
|
||||
): string {
|
||||
const params = new URLSearchParams({
|
||||
environmentId: project.environmentId,
|
||||
projectId: project.id,
|
||||
});
|
||||
|
||||
return `/new-draft?${params.toString()}`;
|
||||
}
|
||||
|
||||
export function dismissRoute(router: Router) {
|
||||
if (router.canGoBack()) {
|
||||
router.back();
|
||||
return;
|
||||
}
|
||||
|
||||
router.replace("/");
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
import { useColorScheme } from "react-native";
|
||||
|
||||
/**
|
||||
* Centralized app color palette that adapts to light/dark system appearance.
|
||||
* Modeled after the `makeConnectionSheetPalette` pattern used in connection sheets.
|
||||
*
|
||||
* Usage:
|
||||
* const isDarkMode = useColorScheme() === "dark";
|
||||
* const palette = makeAppPalette(isDarkMode);
|
||||
*/
|
||||
export function makeAppPalette(isDarkMode: boolean) {
|
||||
if (isDarkMode) {
|
||||
return {
|
||||
// Page backgrounds
|
||||
screenBackground: "#0c1118",
|
||||
sheetBackground: "rgba(18,20,23,0.98)",
|
||||
|
||||
// Card / surface
|
||||
card: "#161b22",
|
||||
cardAlt: "#1f2329",
|
||||
cardTranslucent: "rgba(22,27,34,0.94)",
|
||||
|
||||
// Text
|
||||
text: "#f8fafc",
|
||||
textSecondary: "#94a3b8",
|
||||
textMuted: "#64748b",
|
||||
textTertiary: "#78716c",
|
||||
|
||||
// Borders & separators
|
||||
border: "rgba(255,255,255,0.08)",
|
||||
borderSubtle: "rgba(255,255,255,0.06)",
|
||||
separator: "rgba(255,255,255,0.04)",
|
||||
|
||||
// Subtle backgrounds (badges, pills, overlays)
|
||||
subtleBg: "rgba(255,255,255,0.06)",
|
||||
subtleBgStrong: "rgba(255,255,255,0.10)",
|
||||
|
||||
// Primary action (inverted in dark mode)
|
||||
primaryButton: "#f8fafc",
|
||||
primaryButtonText: "#0c1118",
|
||||
primaryButtonShadow: "rgba(0,0,0,0.22)",
|
||||
|
||||
// Secondary action
|
||||
secondaryButton: "rgba(255,255,255,0.06)",
|
||||
secondaryButtonText: "#f8fafc",
|
||||
secondaryButtonBorder: "rgba(255,255,255,0.08)",
|
||||
|
||||
// Danger
|
||||
dangerButton: "rgba(190,24,93,0.14)",
|
||||
dangerBorder: "rgba(244,114,182,0.18)",
|
||||
dangerText: "#fda4af",
|
||||
|
||||
// Inputs
|
||||
inputBackground: "#111827",
|
||||
inputBorder: "rgba(255,255,255,0.08)",
|
||||
placeholder: "#64748b",
|
||||
|
||||
// Icons
|
||||
icon: "#f8fafc",
|
||||
iconMuted: "#94a3b8",
|
||||
iconSubtle: "#64748b",
|
||||
|
||||
// Header / glass chrome
|
||||
headerBackground: "rgba(12,17,24,0.94)",
|
||||
headerBorder: "rgba(255,255,255,0.08)",
|
||||
|
||||
// StatusBar
|
||||
statusBarBackground: "#0c1118",
|
||||
statusBarStyle: "light-content" as const,
|
||||
|
||||
// Markdown
|
||||
markdownBody: "#e2e8f0",
|
||||
markdownStrong: "#f8fafc",
|
||||
markdownLink: "#7dd3fc",
|
||||
markdownBlockquoteBorder: "rgba(148,163,184,0.35)",
|
||||
markdownCodeBg: "rgba(255,255,255,0.08)",
|
||||
markdownCodeText: "#e2e8f0",
|
||||
markdownUserCodeBg: "rgba(255,255,255,0.10)",
|
||||
markdownUserCodeText: "#e2e8f0",
|
||||
|
||||
// Drawer / modal backdrop
|
||||
backdrop: "rgba(2,6,23,0.48)",
|
||||
drawerBackground: "rgba(18,20,23,0.99)",
|
||||
drawerShadow: "rgba(0,0,0,0.32)",
|
||||
|
||||
// Dot separator
|
||||
dotSeparator: "rgba(148,163,184,0.45)",
|
||||
|
||||
// SVG / wordmark fill
|
||||
wordmarkFill: "#f8fafc",
|
||||
|
||||
// Chevron / disclosure
|
||||
chevronColor: "rgba(255,255,255,0.25)",
|
||||
} as const;
|
||||
}
|
||||
|
||||
return {
|
||||
// Page backgrounds
|
||||
screenBackground: "#f6f4ef",
|
||||
sheetBackground: "rgba(250,248,242,0.98)",
|
||||
|
||||
// Card / surface
|
||||
card: "#ffffff",
|
||||
cardAlt: "#f8f4ec",
|
||||
cardTranslucent: "rgba(255,255,255,0.94)",
|
||||
|
||||
// Text
|
||||
text: "#171717",
|
||||
textSecondary: "#57534e",
|
||||
textMuted: "#78716c",
|
||||
textTertiary: "#a8a29e",
|
||||
|
||||
// Borders & separators
|
||||
border: "rgba(23,23,23,0.08)",
|
||||
borderSubtle: "rgba(23,23,23,0.06)",
|
||||
separator: "rgba(23,23,23,0.04)",
|
||||
|
||||
// Subtle backgrounds (badges, pills, overlays)
|
||||
subtleBg: "rgba(23,23,23,0.06)",
|
||||
subtleBgStrong: "rgba(23,23,23,0.10)",
|
||||
|
||||
// Primary action
|
||||
primaryButton: "#171717",
|
||||
primaryButtonText: "#fafaf9",
|
||||
primaryButtonShadow: "rgba(23,23,23,0.18)",
|
||||
|
||||
// Secondary action
|
||||
secondaryButton: "#ffffff",
|
||||
secondaryButtonText: "#171717",
|
||||
secondaryButtonBorder: "rgba(23,23,23,0.08)",
|
||||
|
||||
// Danger
|
||||
dangerButton: "#fff1f2",
|
||||
dangerBorder: "rgba(225,29,72,0.12)",
|
||||
dangerText: "#be123c",
|
||||
|
||||
// Inputs
|
||||
inputBackground: "#ffffff",
|
||||
inputBorder: "rgba(23,23,23,0.06)",
|
||||
placeholder: "#94a3b8",
|
||||
|
||||
// Icons
|
||||
icon: "#171717",
|
||||
iconMuted: "#57534e",
|
||||
iconSubtle: "#a8a29e",
|
||||
|
||||
// Header / glass chrome
|
||||
headerBackground: "rgba(247,247,245,0.94)",
|
||||
headerBorder: "rgba(23,23,23,0.06)",
|
||||
|
||||
// StatusBar
|
||||
statusBarBackground: "#f6f4ef",
|
||||
statusBarStyle: "dark-content" as const,
|
||||
|
||||
// Markdown
|
||||
markdownBody: "#020617",
|
||||
markdownStrong: "#020617",
|
||||
markdownLink: "#0369a1",
|
||||
markdownBlockquoteBorder: "rgba(100,116,139,0.35)",
|
||||
markdownCodeBg: "rgba(15,23,42,0.08)",
|
||||
markdownCodeText: "#0f172a",
|
||||
markdownUserCodeBg: "rgba(255,255,255,0.55)",
|
||||
markdownUserCodeText: "#0f172a",
|
||||
|
||||
// Drawer / modal backdrop
|
||||
backdrop: "rgba(15,23,42,0.22)",
|
||||
drawerBackground: "rgba(250,248,242,0.99)",
|
||||
drawerShadow: "rgba(15,23,42,0.12)",
|
||||
|
||||
// Dot separator
|
||||
dotSeparator: "rgba(120,113,108,0.45)",
|
||||
|
||||
// SVG / wordmark fill
|
||||
wordmarkFill: "#171717",
|
||||
|
||||
// Chevron / disclosure
|
||||
chevronColor: "rgba(23,23,23,0.25)",
|
||||
} as const;
|
||||
}
|
||||
|
||||
export type AppPalette = ReturnType<typeof makeAppPalette>;
|
||||
|
||||
/** Convenience hook that returns the palette for the current color scheme. */
|
||||
export function useAppPalette(): AppPalette {
|
||||
const isDarkMode = useColorScheme() === "dark";
|
||||
return makeAppPalette(isDarkMode);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import React from "react";
|
||||
|
||||
import { type RemoteAppModel, useRemoteAppState } from "./use-remote-app-state";
|
||||
|
||||
const RemoteAppStateContext = React.createContext<RemoteAppModel | null>(null);
|
||||
|
||||
export function RemoteAppStateProvider(props: React.PropsWithChildren) {
|
||||
const app = useRemoteAppState();
|
||||
|
||||
return (
|
||||
<RemoteAppStateContext.Provider value={app}>{props.children}</RemoteAppStateContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useRemoteApp() {
|
||||
const app = React.use(RemoteAppStateContext);
|
||||
if (app === null) {
|
||||
throw new Error("useRemoteApp must be used within RemoteAppStateProvider.");
|
||||
}
|
||||
return app;
|
||||
}
|
||||
+24
-16
@@ -106,14 +106,14 @@ export interface RemoteAppModel {
|
||||
readonly onCloseConnectionEditor: () => void;
|
||||
readonly onRequestCloseConnectionEditor: () => void;
|
||||
readonly onChangeConnectionPairingUrl: (pairingUrl: string) => void;
|
||||
readonly onConnectPress: () => void;
|
||||
readonly onConnectPress: (pairingUrl?: string) => Promise<void>;
|
||||
readonly onUpdateEnvironment: (
|
||||
environmentId: string,
|
||||
updates: { readonly label: string; readonly displayUrl: string },
|
||||
) => Promise<void>;
|
||||
readonly onRemoveEnvironmentPress: (environmentId: string) => void;
|
||||
readonly onRefresh: () => Promise<void>;
|
||||
readonly onCreateThread: (project: ScopedMobileProject) => Promise<void>;
|
||||
readonly onCreateThread: (project: ScopedMobileProject) => Promise<SelectedThreadRef | null>;
|
||||
readonly onCreateThreadWithOptions: (input: {
|
||||
readonly project: ScopedMobileProject;
|
||||
readonly modelSelection: ModelSelection;
|
||||
@@ -124,7 +124,7 @@ export interface RemoteAppModel {
|
||||
readonly interactionMode: ProviderInteractionMode;
|
||||
readonly initialMessageText: string;
|
||||
readonly initialAttachments: ReadonlyArray<DraftComposerImageAttachment>;
|
||||
}) => Promise<void>;
|
||||
}) => Promise<SelectedThreadRef | null>;
|
||||
readonly onSelectThread: (thread: ScopedMobileThread) => void;
|
||||
readonly onBackFromThread: () => void;
|
||||
readonly onChangeDraftMessage: (value: string) => void;
|
||||
@@ -181,10 +181,10 @@ interface EnvironmentRuntimeState {
|
||||
readonly serverConfig: T3ServerConfig | null;
|
||||
}
|
||||
|
||||
type SelectedThreadRef = {
|
||||
export interface SelectedThreadRef {
|
||||
readonly environmentId: string;
|
||||
readonly threadId: string;
|
||||
};
|
||||
}
|
||||
|
||||
function defaultEnvironmentRuntimeState(): EnvironmentRuntimeState {
|
||||
return {
|
||||
@@ -1157,7 +1157,7 @@ export function useRemoteAppState(): RemoteAppModel {
|
||||
}) => {
|
||||
const client = clientsRef.current.get(input.project.environmentId);
|
||||
if (!client) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
const threadId = ThreadId.makeUnsafe(newClientId("thread"));
|
||||
@@ -1166,7 +1166,7 @@ export function useRemoteAppState(): RemoteAppModel {
|
||||
const nextTitle = deriveThreadTitleFromPrompt(input.initialMessageText);
|
||||
if (input.envMode === "worktree") {
|
||||
if (!input.branch || initialMessageText.length === 0) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
await client.dispatchCommand({
|
||||
@@ -1241,6 +1241,10 @@ export function useRemoteAppState(): RemoteAppModel {
|
||||
threadId,
|
||||
});
|
||||
await onRefresh();
|
||||
return {
|
||||
environmentId: input.project.environmentId,
|
||||
threadId,
|
||||
};
|
||||
},
|
||||
[onRefresh],
|
||||
);
|
||||
@@ -1256,10 +1260,10 @@ export function useRemoteAppState(): RemoteAppModel {
|
||||
project.defaultModelSelection ?? latestProjectThread?.modelSelection ?? null;
|
||||
if (!modelSelection) {
|
||||
setPendingConnectionError("This project does not have a default model configured yet.");
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
await onCreateThreadWithOptions({
|
||||
return await onCreateThreadWithOptions({
|
||||
project,
|
||||
modelSelection,
|
||||
envMode: "local",
|
||||
@@ -1274,20 +1278,24 @@ export function useRemoteAppState(): RemoteAppModel {
|
||||
[onCreateThreadWithOptions, threads],
|
||||
);
|
||||
|
||||
const onConnectPress = useCallback(() => {
|
||||
void bootstrapRemoteConnection(connectionInput)
|
||||
.then(async (connection) => {
|
||||
const onConnectPress = useCallback(
|
||||
async (pairingUrl?: string) => {
|
||||
try {
|
||||
const nextConnectionInput = pairingUrl !== undefined ? { pairingUrl } : connectionInput;
|
||||
const connection = await bootstrapRemoteConnection(nextConnectionInput);
|
||||
setPendingConnectionError(null);
|
||||
await connectSavedEnvironment(connection);
|
||||
setConnectionInput({ pairingUrl: "" });
|
||||
setConnectionEditorVisible(false);
|
||||
})
|
||||
.catch((error) => {
|
||||
} catch (error) {
|
||||
setPendingConnectionError(
|
||||
error instanceof Error ? error.message : "Failed to pair with the environment.",
|
||||
);
|
||||
});
|
||||
}, [connectSavedEnvironment, connectionInput]);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
[connectSavedEnvironment, connectionInput],
|
||||
);
|
||||
|
||||
const onRemoveEnvironmentPress = useCallback(
|
||||
(environmentId: string) => {
|
||||
@@ -55,14 +55,18 @@
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"effect": "catalog:",
|
||||
"expo": "~55.0.8",
|
||||
"expo": "~55.0.14",
|
||||
"expo-camera": "~55.0.15",
|
||||
"expo-clipboard": "~55.0.9",
|
||||
"expo-constants": "^55.0.9",
|
||||
"expo-dev-client": "~55.0.26",
|
||||
"expo-font": "^55.0.4",
|
||||
"expo-glass-effect": "~55.0.8",
|
||||
"expo-haptics": "^55.0.9",
|
||||
"expo-image-picker": "~55.0.14",
|
||||
"expo-linking": "~55.0.12",
|
||||
"expo-paste-input": "^0.1.15",
|
||||
"expo-router": "~55.0.12",
|
||||
"expo-secure-store": "~55.0.9",
|
||||
"expo-splash-screen": "~55.0.13",
|
||||
"expo-symbols": "~55.0.5",
|
||||
@@ -70,12 +74,14 @@
|
||||
"nativewind": "5.0.0-preview.3",
|
||||
"punycode": "^2.3.1",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0",
|
||||
"react-native": "0.83.4",
|
||||
"react-native-css": "3.0.7",
|
||||
"react-native-gesture-handler": "~2.31.1",
|
||||
"react-native-gesture-handler": "~2.30.0",
|
||||
"react-native-markdown-display": "^7.0.2",
|
||||
"react-native-reanimated": "4.2.1",
|
||||
"react-native-safe-area-context": "~5.6.2",
|
||||
"react-native-screens": "~4.23.0",
|
||||
"react-native-svg": "15.15.3",
|
||||
"react-native-worklets": "0.7.2",
|
||||
},
|
||||
@@ -616,6 +622,8 @@
|
||||
|
||||
"@expo/metro-config": ["@expo/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.20.0", "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", "@expo/config": "~55.0.15", "@expo/env": "~2.1.1", "@expo/json-file": "~10.0.13", "@expo/metro": "~55.0.0", "@expo/spawn-async": "^1.7.2", "browserslist": "^4.25.0", "chalk": "^4.1.0", "debug": "^4.3.2", "getenv": "^2.0.0", "glob": "^13.0.0", "hermes-parser": "^0.32.0", "jsc-safe-url": "^0.2.4", "lightningcss": "^1.30.1", "picomatch": "^4.0.3", "postcss": "~8.4.32", "resolve-from": "^5.0.0" }, "peerDependencies": { "expo": "*" }, "optionalPeers": ["expo"] }, "sha512-JaWDw0dmYZ5pOqA+3/Efvl8JzCVgWQVPogHFjTRC5azUgAsFV+T7moOaZTSgg4d+5TjFZjZbMZg4SUomE7LiGg=="],
|
||||
|
||||
"@expo/metro-runtime": ["@expo/[email protected]", "", { "dependencies": { "@expo/log-box": "55.0.10", "anser": "^1.4.9", "pretty-format": "^29.7.0", "stacktrace-parser": "^0.1.10", "whatwg-fetch": "^3.0.0" }, "peerDependencies": { "expo": "*", "react": "*", "react-dom": "*", "react-native": "*" }, "optionalPeers": ["react-dom"] }, "sha512-H37b2Mc/8GiQbwtUFzUTxA3KsAMZu00SRg/RhbHa9xVE7J0n5ZX4NHy0LJEFAbkzTb1TUy1hLpo3oEKnG+rLyg=="],
|
||||
|
||||
"@expo/osascript": ["@expo/[email protected]", "", { "dependencies": { "@expo/spawn-async": "^1.7.2" } }, "sha512-/XP7PSYF2hzOZzqfjgkoWtllyeTN8dW3aM4P6YgKcmmPikKL5FdoyQhti4eh6RK5a5VrUXJTOlTNIpIHsfB5Iw=="],
|
||||
|
||||
"@expo/package-manager": ["@expo/[email protected]", "", { "dependencies": { "@expo/json-file": "^10.0.13", "@expo/spawn-async": "^1.7.2", "chalk": "^4.0.0", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", "resolve-workspace-root": "^2.0.0" } }, "sha512-y9Mr4Kmpk4abAVZrNNPCdzOZr8nLLyi18p1SXr0RCVA8IfzqZX/eY4H+50a0HTmXqIsPZrQdcdb4I3ekMS9GvQ=="],
|
||||
@@ -914,6 +922,48 @@
|
||||
|
||||
"@quansync/fs": ["@quansync/[email protected]", "", { "dependencies": { "quansync": "^1.0.0" } }, "sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ=="],
|
||||
|
||||
"@radix-ui/primitive": ["@radix-ui/[email protected]", "", {}, "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg=="],
|
||||
|
||||
"@radix-ui/react-collection": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw=="],
|
||||
|
||||
"@radix-ui/react-compose-refs": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg=="],
|
||||
|
||||
"@radix-ui/react-context": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA=="],
|
||||
|
||||
"@radix-ui/react-dialog": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw=="],
|
||||
|
||||
"@radix-ui/react-direction": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw=="],
|
||||
|
||||
"@radix-ui/react-dismissable-layer": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-escape-keydown": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Nqcp+t5cTB8BinFkZgXiMJniQH0PsUt2k51FUhbdfeKvc4ACcG2uQniY/8+h1Yv6Kza4Q7lD7PQV0z0oicE0Mg=="],
|
||||
|
||||
"@radix-ui/react-focus-guards": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw=="],
|
||||
|
||||
"@radix-ui/react-focus-scope": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw=="],
|
||||
|
||||
"@radix-ui/react-id": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg=="],
|
||||
|
||||
"@radix-ui/react-portal": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ=="],
|
||||
|
||||
"@radix-ui/react-presence": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ=="],
|
||||
|
||||
"@radix-ui/react-primitive": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-slot": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ=="],
|
||||
|
||||
"@radix-ui/react-roving-focus": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA=="],
|
||||
|
||||
"@radix-ui/react-slot": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Jl+bCv8HxKnlTLVrcDE8zTMJ09R9/ukw4qBs/oZClOfoQk/cOTbDn+NceXfV7j09YPVQUryJPHurafcSg6EVKA=="],
|
||||
|
||||
"@radix-ui/react-tabs": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A=="],
|
||||
|
||||
"@radix-ui/react-use-callback-ref": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg=="],
|
||||
|
||||
"@radix-ui/react-use-controllable-state": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-use-effect-event": "0.0.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg=="],
|
||||
|
||||
"@radix-ui/react-use-effect-event": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA=="],
|
||||
|
||||
"@radix-ui/react-use-escape-keydown": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-use-callback-ref": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g=="],
|
||||
|
||||
"@radix-ui/react-use-layout-effect": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ=="],
|
||||
|
||||
"@react-native-async-storage/async-storage": ["@react-native-async-storage/[email protected]", "", { "dependencies": { "merge-options": "^3.0.4" }, "peerDependencies": { "react-native": "^0.0.0-0 || >=0.65 <1.0" } }, "sha512-gvRvjR5JAaUZF8tv2Kcq/Gbt3JHwbKFYfmb445rhOj6NUMx3qPLixmDx5pZAyb9at1bYvJ4/eTUipU5aki45xw=="],
|
||||
|
||||
"@react-native-masked-view/masked-view": ["@react-native-masked-view/[email protected]", "", { "peerDependencies": { "react": ">=16", "react-native": ">=0.57" } }, "sha512-XwuQoW7/GEgWRMovOQtX3A4PrXhyaZm0lVUiY8qJDvdngjLms9Cpdck6SmGAUNqQwcj2EadHC1HwL0bEyoa/SQ=="],
|
||||
@@ -944,6 +994,18 @@
|
||||
|
||||
"@react-native/virtualized-lists": ["@react-native/[email protected]", "", { "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" }, "peerDependencies": { "@types/react": "^19.2.0", "react": "*", "react-native": "*" }, "optionalPeers": ["@types/react"] }, "sha512-vNF/8kokMW8JEjG4n+j7veLTjHRRABlt4CaTS6+wtqzvWxCJHNIC8fhCqrDPn9fIn8sNePd8DyiFVX5L9TBBRA=="],
|
||||
|
||||
"@react-navigation/bottom-tabs": ["@react-navigation/[email protected]", "", { "dependencies": { "@react-navigation/elements": "^2.9.14", "color": "^4.2.3", "sf-symbols-typescript": "^2.1.0" }, "peerDependencies": { "@react-navigation/native": "^7.2.2", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-Ou28A1aZLj5wiFQ3F93aIsrI4NCwn3IJzkkjNo9KLFXsc0Yks+UqrVaFlffHFLsrbajuGRG/OQpnMA1ljayY5Q=="],
|
||||
|
||||
"@react-navigation/core": ["@react-navigation/[email protected]", "", { "dependencies": { "@react-navigation/routers": "^7.5.3", "escape-string-regexp": "^4.0.0", "fast-deep-equal": "^3.1.3", "nanoid": "^3.3.11", "query-string": "^7.1.3", "react-is": "^19.1.0", "use-latest-callback": "^0.2.4", "use-sync-external-store": "^1.5.0" }, "peerDependencies": { "react": ">= 18.2.0" } }, "sha512-Rt2OZwcgOmjv401uLGAKaRM6xo0fiBce/A7LfRHI1oe5FV+KooWcgAoZ2XOtgKj6UzVMuQWt3b2e6rxo/mDJRA=="],
|
||||
|
||||
"@react-navigation/elements": ["@react-navigation/[email protected]", "", { "dependencies": { "color": "^4.2.3", "use-latest-callback": "^0.2.4", "use-sync-external-store": "^1.5.0" }, "peerDependencies": { "@react-native-masked-view/masked-view": ">= 0.2.0", "@react-navigation/native": "^7.2.2", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0" }, "optionalPeers": ["@react-native-masked-view/masked-view"] }, "sha512-lKqzu+su2pI/YIZmR7L7xdOs4UL+rVXKJAMpRMBrwInEy96SjIFst6QDGpE89Dunnu3VjVpjWfByo9f2GWBHDQ=="],
|
||||
|
||||
"@react-navigation/native": ["@react-navigation/[email protected]", "", { "dependencies": { "@react-navigation/core": "^7.17.2", "escape-string-regexp": "^4.0.0", "fast-deep-equal": "^3.1.3", "nanoid": "^3.3.11", "use-latest-callback": "^0.2.4" }, "peerDependencies": { "react": ">= 18.2.0", "react-native": "*" } }, "sha512-kem1Ko2BcbAjmbQIv66dNmr6EtfDut3QU0qjsVhMnLLhktwyXb6FzZYp8gTrUb6AvkAbaJoi+BF5Pl55pAUa5w=="],
|
||||
|
||||
"@react-navigation/native-stack": ["@react-navigation/[email protected]", "", { "dependencies": { "@react-navigation/elements": "^2.9.14", "color": "^4.2.3", "sf-symbols-typescript": "^2.1.0", "warn-once": "^0.1.1" }, "peerDependencies": { "@react-navigation/native": "^7.2.2", "react": ">= 18.2.0", "react-native": "*", "react-native-safe-area-context": ">= 4.0.0", "react-native-screens": ">= 4.0.0" } }, "sha512-mCbYbYhi7Em2R2nEgwYGdLU38smy+KK+HMMVcwuzllWsF3Qb+jOUEYbB6Or7LvE7SS77BZ6sHdx4HptCEv50hQ=="],
|
||||
|
||||
"@react-navigation/routers": ["@react-navigation/[email protected]", "", { "dependencies": { "nanoid": "^3.3.11" } }, "sha512-1tJHg4KKRJuQ1/EvJxatrMef3NZXEPzwUIUZ3n1yJ2t7Q97siwRtbynRpQG9/69ebbtiZ8W3ScOZF/OmhvM4Rg=="],
|
||||
|
||||
"@rolldown/binding-android-arm64": ["@rolldown/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-0T1k9FinuBZ/t7rZ8jN6OpUKPnUjNdYHoj/cESWrQ3ZraAJ4OMm6z7QjSfCxqj8mOp9kTKc1zHK3kGz5vMu+nQ=="],
|
||||
|
||||
"@rolldown/binding-darwin-arm64": ["@rolldown/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-JWWLzvcmc/3pe7qdJqPpuPk91SoE/N+f3PcWx/6ZwuyDVyungAEJPvKm/eEldiDdwTmaEzWfIR+HORxYWrCi1A=="],
|
||||
@@ -1158,8 +1220,6 @@
|
||||
|
||||
"@types/react-dom": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],
|
||||
|
||||
"@types/react-test-renderer": ["@types/[email protected]", "", { "dependencies": { "@types/react": "*" } }, "sha512-XD0WZrHqjNrxA/MaR9O22w/RNidWR9YZmBdRGI7wcnWGrv/3dA8wKCJ8m63Sn+tLJhcjmuhOi629N66W6kgWzQ=="],
|
||||
|
||||
"@types/responselike": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw=="],
|
||||
|
||||
"@types/stack-utils": ["@types/[email protected]", "", {}, "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw=="],
|
||||
@@ -1250,6 +1310,8 @@
|
||||
|
||||
"argparse": ["[email protected]", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="],
|
||||
|
||||
"aria-hidden": ["[email protected]", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="],
|
||||
|
||||
"aria-query": ["[email protected]", "", {}, "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw=="],
|
||||
|
||||
"array-iterate": ["[email protected]", "", {}, "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg=="],
|
||||
@@ -1390,6 +1452,8 @@
|
||||
|
||||
"cli-width": ["[email protected]", "", {}, "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ=="],
|
||||
|
||||
"client-only": ["[email protected]", "", {}, "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="],
|
||||
|
||||
"cliui": ["[email protected]", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="],
|
||||
|
||||
"clone": ["[email protected]", "", {}, "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg=="],
|
||||
@@ -1400,10 +1464,14 @@
|
||||
|
||||
"cluster-key-slot": ["[email protected]", "", {}, "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA=="],
|
||||
|
||||
"color": ["[email protected]", "", { "dependencies": { "color-convert": "^2.0.1", "color-string": "^1.9.0" } }, "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A=="],
|
||||
|
||||
"color-convert": ["[email protected]", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
|
||||
|
||||
"color-name": ["[email protected]", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
|
||||
|
||||
"color-string": ["[email protected]", "", { "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" } }, "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg=="],
|
||||
|
||||
"colorjs.io": ["[email protected]", "", {}, "sha512-c/h/8uAmPydQcriRdX8UTAFHj6SpSHFHBA8LvMikvYWAVApPTwg/pyOXNsGmaCBd6L/EeDlRHSNhTtnIFp/qsg=="],
|
||||
|
||||
"comma-separated-tokens": ["[email protected]", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="],
|
||||
@@ -1462,6 +1530,8 @@
|
||||
|
||||
"decode-named-character-reference": ["[email protected]", "", { "dependencies": { "character-entities": "^2.0.0" } }, "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q=="],
|
||||
|
||||
"decode-uri-component": ["[email protected]", "", {}, "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ=="],
|
||||
|
||||
"decompress-response": ["[email protected]", "", { "dependencies": { "mimic-response": "^3.1.0" } }, "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ=="],
|
||||
|
||||
"deepmerge": ["[email protected]", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="],
|
||||
@@ -1496,6 +1566,8 @@
|
||||
|
||||
"detect-node": ["[email protected]", "", {}, "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g=="],
|
||||
|
||||
"detect-node-es": ["[email protected]", "", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="],
|
||||
|
||||
"devalue": ["[email protected]", "", {}, "sha512-MUbZ586EgQqdRnC4yDrlod3BEdyvE4TapGYHMW2CiaW+KkkFmWEFqBUaLltEZCGi0iFXCEjRF0OjF0DV2QHjOA=="],
|
||||
|
||||
"devlop": ["[email protected]", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="],
|
||||
@@ -1594,6 +1666,14 @@
|
||||
|
||||
"expo-constants": ["[email protected]", "", { "dependencies": { "@expo/config": "~55.0.15", "@expo/env": "~2.1.1" }, "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-l23QVQCYBPKT5zbxxZdJeuhiunadvWdjcQ9+GC8h+02jCoLmWRk20064nCINnQTP3Hf+uLPteUiwYrJd0e446w=="],
|
||||
|
||||
"expo-dev-client": ["[email protected]", "", { "dependencies": { "expo-dev-launcher": "55.0.28", "expo-dev-menu": "55.0.23", "expo-dev-menu-interface": "55.0.2", "expo-manifests": "~55.0.15", "expo-updates-interface": "~55.1.5" }, "peerDependencies": { "expo": "*" } }, "sha512-Ala2ER6v1NPFySdnuQN/GpQZI9r7E9eSMvzD32vv8A4FJkPfzjvj6U5uH4IytQQLVTa837fknXRvOMwRb9ZYQQ=="],
|
||||
|
||||
"expo-dev-launcher": ["[email protected]", "", { "dependencies": { "@expo/schema-utils": "^55.0.3", "expo-dev-menu": "55.0.23", "expo-manifests": "~55.0.15" }, "peerDependencies": { "expo": "*" } }, "sha512-jwCD7YeGqZMWrS4KODb51kPBDta8bDrPjhYCnodglcQ0jhPVsAnVSbtsQ2/TaaYUUtv+ipm1ufhNTFtcwya9kA=="],
|
||||
|
||||
"expo-dev-menu": ["[email protected]", "", { "dependencies": { "expo-dev-menu-interface": "55.0.2" }, "peerDependencies": { "expo": "*" } }, "sha512-m6B2EwkoX9hwzP50EZPX8vc/szGfvNFsUTw3ExTWnxiJ9/IM0WfCFYjt8siFjMHcyblIjBt/XLN6mw6q8m2AEg=="],
|
||||
|
||||
"expo-dev-menu-interface": ["[email protected]", "", { "peerDependencies": { "expo": "*" } }, "sha512-DomUNvGzY/xliwnMdbAYY780sCv19N7zIbifc0ClcoCzJZpNSCkvJ2qGIFRPyM/7DmqmlHGCKi8di7kYYLKNEg=="],
|
||||
|
||||
"expo-eas-client": ["[email protected]", "", {}, "sha512-wRagCeSbSnSGVXgP7V+qiGfXzZ9hTVKWvKIOP7lwrX3MIEenNmNlO4D3RVC3aNU2GhmO3ZCZIIEre80KZoUUHA=="],
|
||||
|
||||
"expo-file-system": ["[email protected]", "", { "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-EetQ/zVFK07Vmz4Yke0fvoES4xVwScTdd0PMoLekuMX7puE4op75pNnEdh1M0AeWzkqLrBoZIaU2ynSrKN5VZg=="],
|
||||
@@ -1604,6 +1684,8 @@
|
||||
|
||||
"expo-haptics": ["[email protected]", "", { "peerDependencies": { "expo": "*" } }, "sha512-KjDItBsA9mi1f5nRwf8g1wOdfEcLHwvEdt5Jl1sMCDETR/homcGOl+F3QIiPOl/PRlbGVieQsjTtF4DGtHOj6g=="],
|
||||
|
||||
"expo-image": ["[email protected]", "", { "dependencies": { "sf-symbols-typescript": "^2.2.0" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*", "react-native-web": "*" }, "optionalPeers": ["react-native-web"] }, "sha512-fNdvdYVcGn3g1x6o5AXHKzk4xX8U6rg2W9vFdE1pQO80kWCNReh003ypqSrGy4dD+zA8FtZjrNF3oMDGnPpIGQ=="],
|
||||
|
||||
"expo-image-loader": ["[email protected]", "", { "peerDependencies": { "expo": "*" } }, "sha512-NOjp56wDrfuA5aiNAybBIjqIn1IxKeGJ8CECWZncQ/GzjZfyTYAHTCyeApYkdKkMBLHINzI4BbTGSlbCa0fXXQ=="],
|
||||
|
||||
"expo-image-picker": ["[email protected]", "", { "dependencies": { "expo-image-loader": "~55.0.0" }, "peerDependencies": { "expo": "*" } }, "sha512-lGpPGRu+7mE8qN0ma2boRsCmfOGbdHZ2bXTpWVeWly0JCZdogGlTrYFnhTqgS8+lmiRb/UCOs7iTm2P5Rra6kw=="],
|
||||
@@ -1612,12 +1694,18 @@
|
||||
|
||||
"expo-keep-awake": ["[email protected]", "", { "peerDependencies": { "expo": "*", "react": "*" } }, "sha512-acJjeHqkNxMVckEcJhGQeIksqqsarscSHJtT559bNgyiM4r14dViQ66su7bb6qDVeBt0K7z3glXI1dHVck1Zgg=="],
|
||||
|
||||
"expo-linking": ["[email protected]", "", { "dependencies": { "expo-constants": "~55.0.14", "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-xbOqNWQCC5RGtXSW83ZCKOjRivyxO2zBouRYy/hgbsyrHUJhztMAjlq8RKYDUL8D6QVsH9Q81SNoq4Zhcn+4HQ=="],
|
||||
|
||||
"expo-manifests": ["[email protected]", "", { "dependencies": { "@expo/config": "~55.0.14", "expo-json-utils": "~55.0.2" }, "peerDependencies": { "expo": "*" } }, "sha512-p40ftXpgLTFGddFy35MYZMyjm/E6IQdn3l6fBZZ6zeraEzYLt+VLHYsplOL9ccTYvUSWKN9aOWRpoEYpyGVBVw=="],
|
||||
|
||||
"expo-modules-autolinking": ["[email protected]", "", { "dependencies": { "@expo/require-utils": "^55.0.4", "@expo/spawn-async": "^1.7.2", "chalk": "^4.1.0", "commander": "^7.2.0" }, "bin": { "expo-modules-autolinking": "bin/expo-modules-autolinking.js" } }, "sha512-VhlEVGnP+xBjfSKDKNN7GAPKN2whIfV08jsZvNj7UGyJWpZYiO6Emx1FLP5xd1+JZVpIrt/kxR641kdcPo7Ehw=="],
|
||||
|
||||
"expo-modules-core": ["[email protected]", "", { "dependencies": { "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*", "react-native-worklets": "^0.7.4 || ^0.8.0" }, "optionalPeers": ["react-native-worklets"] }, "sha512-NC5GyvCHvnOvi5MtgLv68oUSrRP/0UORGzU/MX+7BIA8ctgBPxKSjPXPSfhwk3gMzj7eHBhYwlu0HJsIEnVd9A=="],
|
||||
|
||||
"expo-paste-input": ["[email protected]", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-wV0z1s0/Q4MB+lNiSwbMfck+1Im6sDIcgyCi5Y0aF35n5kcM4FHSOjmRfzn3UbkMlvxmYfDiHeHvIqn22qatqA=="],
|
||||
|
||||
"expo-router": ["[email protected]", "", { "dependencies": { "@expo/metro-runtime": "^55.0.9", "@expo/schema-utils": "^55.0.3", "@radix-ui/react-slot": "^1.2.0", "@radix-ui/react-tabs": "^1.1.12", "@react-navigation/bottom-tabs": "^7.15.5", "@react-navigation/native": "^7.1.33", "@react-navigation/native-stack": "^7.14.5", "client-only": "^0.0.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "expo-glass-effect": "^55.0.10", "expo-image": "^55.0.8", "expo-server": "^55.0.7", "expo-symbols": "^55.0.7", "fast-deep-equal": "^3.1.3", "invariant": "^2.2.4", "nanoid": "^3.3.8", "query-string": "^7.1.3", "react-fast-compare": "^3.2.2", "react-native-is-edge-to-edge": "^1.2.1", "semver": "~7.6.3", "server-only": "^0.0.1", "sf-symbols-typescript": "^2.1.0", "shallowequal": "^1.1.0", "use-latest-callback": "^0.2.1", "vaul": "^1.1.2" }, "peerDependencies": { "@expo/log-box": "55.0.10", "@react-navigation/drawer": "^7.9.4", "@testing-library/react-native": ">= 13.2.0", "expo": "*", "expo-constants": "^55.0.13", "expo-linking": "^55.0.12", "react": "*", "react-dom": "*", "react-native": "*", "react-native-gesture-handler": "*", "react-native-reanimated": "*", "react-native-safe-area-context": ">= 5.4.0", "react-native-screens": "*", "react-native-web": "*", "react-server-dom-webpack": "~19.0.4 || ~19.1.5 || ~19.2.4" }, "optionalPeers": ["@react-navigation/drawer", "@testing-library/react-native", "react-dom", "react-native-gesture-handler", "react-native-reanimated", "react-native-web", "react-server-dom-webpack"] }, "sha512-Bm6IhI0Kl5/tDlCHPms8jDqy1O6HLHIOrMsEmmAQ5Lgg5UBtDfRThEyHPVOLNTOs8e7/bG/Ftz6a4UgQVA+NhQ=="],
|
||||
|
||||
"expo-secure-store": ["[email protected]", "", { "peerDependencies": { "expo": "*" } }, "sha512-I6r0JNO1Fd4o0Gu7Ixiic7s89lqgdUHq17uBH9y1f/AntoyKn71TdtYJH82RgfsBbu5qNVzrwImmvlANyOlITQ=="],
|
||||
|
||||
"expo-server": ["[email protected]", "", {}, "sha512-Cc1btFyPsD9P4DT2xd1pG/uR96TLVMx0W+dPm9Gjk1uDV9xuzvMcUsY7nf9bt4U5pGyWWkCXmPJcKwWfdl51Pw=="],
|
||||
@@ -1668,6 +1756,8 @@
|
||||
|
||||
"fill-range": ["[email protected]", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
|
||||
|
||||
"filter-obj": ["[email protected]", "", {}, "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ=="],
|
||||
|
||||
"finalhandler": ["[email protected]", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", "parseurl": "~1.3.3", "statuses": "~1.5.0", "unpipe": "~1.0.0" } }, "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA=="],
|
||||
|
||||
"find-my-way-ts": ["[email protected]", "", {}, "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA=="],
|
||||
@@ -1702,6 +1792,8 @@
|
||||
|
||||
"get-intrinsic": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"get-nonce": ["[email protected]", "", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="],
|
||||
|
||||
"get-package-type": ["[email protected]", "", {}, "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q=="],
|
||||
|
||||
"get-proto": ["[email protected]", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
||||
@@ -1824,6 +1916,8 @@
|
||||
|
||||
"is-alphanumerical": ["[email protected]", "", { "dependencies": { "is-alphabetical": "^2.0.0", "is-decimal": "^2.0.0" } }, "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw=="],
|
||||
|
||||
"is-arrayish": ["[email protected]", "", {}, "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA=="],
|
||||
|
||||
"is-binary-path": ["[email protected]", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="],
|
||||
|
||||
"is-core-module": ["[email protected]", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="],
|
||||
@@ -2330,6 +2424,8 @@
|
||||
|
||||
"quansync": ["[email protected]", "", {}, "sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA=="],
|
||||
|
||||
"query-string": ["[email protected]", "", { "dependencies": { "decode-uri-component": "^0.2.2", "filter-obj": "^1.1.0", "split-on-first": "^1.0.0", "strict-uri-encode": "^2.0.0" } }, "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg=="],
|
||||
|
||||
"queue": ["[email protected]", "", { "dependencies": { "inherits": "~2.0.3" } }, "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA=="],
|
||||
|
||||
"quick-lru": ["[email protected]", "", {}, "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA=="],
|
||||
@@ -2344,10 +2440,14 @@
|
||||
|
||||
"react-devtools-core": ["[email protected]", "", { "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" } }, "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA=="],
|
||||
|
||||
"react-dom": ["[email protected].5", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.5" } }, "sha512-J5bAZz+DXMMwW/wV3xzKke59Af6CHY7G4uYLN1OvBcKEsWOs4pQExj86BBKamxl/Ik5bx9whOrvBlSDfWzgSag=="],
|
||||
"react-dom": ["[email protected].0", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.0" } }, "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ=="],
|
||||
|
||||
"react-error-boundary": ["[email protected]", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0" } }, "sha512-BrYwPOdXi5mqkk5lw+Uvt0ThHx32rCt3BkukS4X23A2AIWDPSGX6iaWTc0y9TU/mHDA/6qOSGel+B2ERkOvD1w=="],
|
||||
|
||||
"react-fast-compare": ["[email protected]", "", {}, "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ=="],
|
||||
|
||||
"react-freeze": ["[email protected]", "", { "peerDependencies": { "react": ">=17.0.0" } }, "sha512-r4F0Sec0BLxWicc7HEyo2x3/2icUTrRmDjaaRyzzn+7aDyFZliszMDOgLVwSnQnYENOlL1o569Ze2HZefk8clA=="],
|
||||
|
||||
"react-is": ["[email protected]", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="],
|
||||
|
||||
"react-markdown": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "html-url-attributes": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "unified": "^11.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" }, "peerDependencies": { "@types/react": ">=18", "react": ">=18" } }, "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ=="],
|
||||
@@ -2358,7 +2458,7 @@
|
||||
|
||||
"react-native-fit-image": ["[email protected]", "", { "dependencies": { "prop-types": "^15.5.10" } }, "sha512-Wl3Vq2DQzxgsWKuW4USfck9zS7YzhvLNPpkwUUCF90bL32e1a0zOVQ3WsJILJOwzmPdHfzZmWasiiAUNBkhNkg=="],
|
||||
|
||||
"react-native-gesture-handler": ["[email protected]1.1", "", { "dependencies": { "@egjs/hammerjs": "^2.0.17", "@types/react-test-renderer": "^19.1.0", "hoist-non-react-statics": "^3.3.0", "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-wQDlECdEzHhYKTnQXFnSqWUtJ5TS3MGQi7EWvQczTnEVKfk6XVSBecnpWAoI/CqlYQ7IWMJEyutY6BxwEBoxeg=="],
|
||||
"react-native-gesture-handler": ["[email protected]0.1", "", { "dependencies": { "@egjs/hammerjs": "^2.0.17", "hoist-non-react-statics": "^3.3.0", "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-xIUBDo5ktmJs++0fZlavQNvDEE4PsihWhSeJsJtoz4Q6p0MiTM9TgrTgfEgzRR36qGPytFoeq+ShLrVwGdpUdA=="],
|
||||
|
||||
"react-native-is-edge-to-edge": ["[email protected]", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-FLbPWl/MyYQWz+KwqOZsSyj2JmLKglHatd3xLZWskXOpRaio4LfEDEz8E/A6uD8QoTHW6Aobw1jbEwK7KMgR7Q=="],
|
||||
|
||||
@@ -2368,12 +2468,20 @@
|
||||
|
||||
"react-native-safe-area-context": ["[email protected]", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-4XGqMNj5qjUTYywJqpdWZ9IG8jgkS3h06sfVjfw5yZQZfWnRFXczi0GnYyFyCc2EBps/qFmoCH8fez//WumdVg=="],
|
||||
|
||||
"react-native-screens": ["[email protected]", "", { "dependencies": { "react-freeze": "^1.0.0", "warn-once": "^0.1.0" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-XhO3aK0UeLpBn4kLecd+J+EDeRRJlI/Ro9Fze06vo1q163VeYtzfU9QS09/VyDFMWR1qxDC1iazCArTPSFFiPw=="],
|
||||
|
||||
"react-native-svg": ["[email protected]", "", { "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3", "warn-once": "0.1.1" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-/k4KYwPBLGcx2f5d4FjE+vCScK7QOX14cl2lIASJ28u4slHHtIhL0SZKU7u9qmRBHxTCKPoPBtN6haT1NENJNA=="],
|
||||
|
||||
"react-native-worklets": ["[email protected]", "", { "dependencies": { "@babel/plugin-transform-arrow-functions": "7.27.1", "@babel/plugin-transform-class-properties": "7.27.1", "@babel/plugin-transform-classes": "7.28.4", "@babel/plugin-transform-nullish-coalescing-operator": "7.27.1", "@babel/plugin-transform-optional-chaining": "7.27.1", "@babel/plugin-transform-shorthand-properties": "7.27.1", "@babel/plugin-transform-template-literals": "7.27.1", "@babel/plugin-transform-unicode-regex": "7.27.1", "@babel/preset-typescript": "7.27.1", "convert-source-map": "2.0.0", "semver": "7.7.3" }, "peerDependencies": { "@babel/core": "*", "react": "*", "react-native": "*" } }, "sha512-DuLu1kMV/Uyl9pQHp3hehAlThoLw7Yk2FwRTpzASOmI+cd4845FWn3m2bk9MnjUw8FBRIyhwLqYm2AJaXDXsog=="],
|
||||
|
||||
"react-refresh": ["[email protected]", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="],
|
||||
|
||||
"react-remove-scroll": ["[email protected]", "", { "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", "tslib": "^2.1.0", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q=="],
|
||||
|
||||
"react-remove-scroll-bar": ["[email protected]", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="],
|
||||
|
||||
"react-style-singleton": ["[email protected]", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="],
|
||||
|
||||
"readdirp": ["[email protected]", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="],
|
||||
|
||||
"redis-errors": ["[email protected]", "", {}, "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w=="],
|
||||
@@ -2482,10 +2590,14 @@
|
||||
|
||||
"serve-static": ["[email protected]", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "~0.19.1" } }, "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA=="],
|
||||
|
||||
"server-only": ["[email protected]", "", {}, "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA=="],
|
||||
|
||||
"setprototypeof": ["[email protected]", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
|
||||
|
||||
"sf-symbols-typescript": ["[email protected]", "", {}, "sha512-TPbeg0b7ylrswdGCji8FRGFAKuqbpQlLbL8SOle3j1iHSs5Ob5mhvMAxWN2UItOjgALAB5Zp3fmMfj8mbWvXKw=="],
|
||||
|
||||
"shallowequal": ["[email protected]", "", {}, "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="],
|
||||
|
||||
"sharp": ["[email protected]", "", { "dependencies": { "@img/colour": "^1.0.0", "detect-libc": "^2.1.2", "semver": "^7.7.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.34.5", "@img/sharp-darwin-x64": "0.34.5", "@img/sharp-libvips-darwin-arm64": "1.2.4", "@img/sharp-libvips-darwin-x64": "1.2.4", "@img/sharp-libvips-linux-arm": "1.2.4", "@img/sharp-libvips-linux-arm64": "1.2.4", "@img/sharp-libvips-linux-ppc64": "1.2.4", "@img/sharp-libvips-linux-riscv64": "1.2.4", "@img/sharp-libvips-linux-s390x": "1.2.4", "@img/sharp-libvips-linux-x64": "1.2.4", "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", "@img/sharp-libvips-linuxmusl-x64": "1.2.4", "@img/sharp-linux-arm": "0.34.5", "@img/sharp-linux-arm64": "0.34.5", "@img/sharp-linux-ppc64": "0.34.5", "@img/sharp-linux-riscv64": "0.34.5", "@img/sharp-linux-s390x": "0.34.5", "@img/sharp-linux-x64": "0.34.5", "@img/sharp-linuxmusl-arm64": "0.34.5", "@img/sharp-linuxmusl-x64": "0.34.5", "@img/sharp-wasm32": "0.34.5", "@img/sharp-win32-arm64": "0.34.5", "@img/sharp-win32-ia32": "0.34.5", "@img/sharp-win32-x64": "0.34.5" } }, "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg=="],
|
||||
|
||||
"shebang-command": ["[email protected]", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
|
||||
@@ -2510,6 +2622,8 @@
|
||||
|
||||
"simple-plist": ["[email protected]", "", { "dependencies": { "bplist-creator": "0.1.0", "bplist-parser": "0.3.1", "plist": "^3.0.5" } }, "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw=="],
|
||||
|
||||
"simple-swizzle": ["[email protected]", "", { "dependencies": { "is-arrayish": "^0.3.1" } }, "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw=="],
|
||||
|
||||
"sirv": ["[email protected]", "", { "dependencies": { "@polka/url": "^1.0.0-next.24", "mrmime": "^2.0.0", "totalist": "^3.0.0" } }, "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g=="],
|
||||
|
||||
"sisteransi": ["[email protected]", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],
|
||||
@@ -2528,6 +2642,8 @@
|
||||
|
||||
"space-separated-tokens": ["[email protected]", "", {}, "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q=="],
|
||||
|
||||
"split-on-first": ["[email protected]", "", {}, "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw=="],
|
||||
|
||||
"sprintf-js": ["[email protected]", "", {}, "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="],
|
||||
|
||||
"stack-utils": ["[email protected]", "", { "dependencies": { "escape-string-regexp": "^2.0.0" } }, "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ=="],
|
||||
@@ -2548,6 +2664,8 @@
|
||||
|
||||
"strict-event-emitter": ["[email protected]", "", {}, "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ=="],
|
||||
|
||||
"strict-uri-encode": ["[email protected]", "", {}, "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ=="],
|
||||
|
||||
"string-width": ["[email protected]", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
|
||||
"stringify-entities": ["[email protected]", "", { "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" } }, "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg=="],
|
||||
@@ -2716,6 +2834,12 @@
|
||||
|
||||
"update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
|
||||
|
||||
"use-callback-ref": ["[email protected]", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="],
|
||||
|
||||
"use-latest-callback": ["[email protected]", "", { "peerDependencies": { "react": ">=16.8" } }, "sha512-FvRG9i1HSo0wagmX63Vrm8SnlUU3LMM3WyZkQ76RnslpBrX694AdG4A0zQBx2B3ZifFA0yv/BaEHGBnEax5rZg=="],
|
||||
|
||||
"use-sidecar": ["[email protected]", "", { "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ=="],
|
||||
|
||||
"use-sync-external-store": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="],
|
||||
|
||||
"utils-merge": ["[email protected]", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],
|
||||
@@ -2726,6 +2850,8 @@
|
||||
|
||||
"vary": ["[email protected]", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
|
||||
|
||||
"vaul": ["[email protected]", "", { "dependencies": { "@radix-ui/react-dialog": "^1.1.1" }, "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-ZFkClGpWyI2WUQjdLJ/BaGuV6AVQiJ3uELGk3OYtP+B6yCO7Cmn9vPFXVJkRaGkOJu3m8bQMgtyzNHixULceQA=="],
|
||||
|
||||
"vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],
|
||||
|
||||
"vfile-location": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile": "^6.0.0" } }, "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg=="],
|
||||
@@ -2898,6 +3024,12 @@
|
||||
|
||||
"@pierre/diffs/shiki": ["[email protected]", "", { "dependencies": { "@shikijs/core": "3.23.0", "@shikijs/engine-javascript": "3.23.0", "@shikijs/engine-oniguruma": "3.23.0", "@shikijs/langs": "3.23.0", "@shikijs/themes": "3.23.0", "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA=="],
|
||||
|
||||
"@radix-ui/react-collection/@radix-ui/react-slot": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="],
|
||||
|
||||
"@radix-ui/react-dialog/@radix-ui/react-slot": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="],
|
||||
|
||||
"@radix-ui/react-primitive/@radix-ui/react-slot": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="],
|
||||
|
||||
"@react-native/babel-preset/babel-plugin-syntax-hermes-parser": ["[email protected]", "", { "dependencies": { "hermes-parser": "0.32.0" } }, "sha512-m5HthL++AbyeEA2FcdwOLfVFvWYECOBObLHNqdR8ceY4TsEdn4LdX2oTvbB2QJSSElE2AWA/b2MXZ/PF/CqLZg=="],
|
||||
|
||||
"@react-native/codegen/glob": ["[email protected]", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="],
|
||||
@@ -2906,6 +3038,8 @@
|
||||
|
||||
"@react-native/dev-middleware/open": ["[email protected]", "", { "dependencies": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" } }, "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q=="],
|
||||
|
||||
"@react-navigation/core/react-is": ["[email protected]", "", {}, "sha512-Dn0t8IQhCmeIT3wu+Apm1/YVsJXsGWi6k4sPdnBIdqMVtHtv0IGi6dcpNpNkNac0zB2uUAqNX3MHzN8c+z2rwQ=="],
|
||||
|
||||
"@rolldown/plugin-babel/rolldown": ["[email protected]", "", { "dependencies": { "@oxc-project/types": "=0.124.0", "@rolldown/pluginutils": "1.0.0-rc.15" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0-rc.15", "@rolldown/binding-darwin-arm64": "1.0.0-rc.15", "@rolldown/binding-darwin-x64": "1.0.0-rc.15", "@rolldown/binding-freebsd-x64": "1.0.0-rc.15", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.15", "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.15", "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.15", "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.15", "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.15", "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.15", "@rolldown/binding-linux-x64-musl": "1.0.0-rc.15", "@rolldown/binding-openharmony-arm64": "1.0.0-rc.15", "@rolldown/binding-wasm32-wasi": "1.0.0-rc.15", "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.15", "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.15" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-Ff31guA5zT6WjnGp0SXw76X6hzGRk/OQq2hE+1lcDe+lJdHSgnSX6nK3erbONHyCbpSj9a9E+uX/OvytZoWp2g=="],
|
||||
|
||||
"@rollup/pluginutils/estree-walker": ["[email protected]", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
|
||||
@@ -2976,6 +3110,8 @@
|
||||
|
||||
"expo-modules-autolinking/commander": ["[email protected]", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],
|
||||
|
||||
"expo-router/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A=="],
|
||||
|
||||
"express/accepts": ["[email protected]", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],
|
||||
|
||||
"express/cookie": ["[email protected]", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"postinstall": "node scripts/patch-expo-dev-launcher.mjs",
|
||||
"dev": "node scripts/dev-runner.ts dev",
|
||||
"dev:server": "node scripts/dev-runner.ts dev:server",
|
||||
"dev:web": "node scripts/dev-runner.ts dev:web",
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import { existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
const root = process.cwd();
|
||||
|
||||
const candidates = [join(root, "node_modules/expo-dev-launcher/ios/EXDevLauncherController.m")];
|
||||
|
||||
const bunStorePath = join(root, "node_modules/.bun");
|
||||
|
||||
if (existsSync(bunStorePath)) {
|
||||
for (const entry of readdirSync(bunStorePath)) {
|
||||
if (!entry.startsWith("expo-dev-launcher@")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
candidates.push(
|
||||
join(bunStorePath, entry, "node_modules/expo-dev-launcher/ios/EXDevLauncherController.m"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const targetLine = "[manager updateCurrentBridge:self.appBridge];";
|
||||
const replacement = [
|
||||
" // Expo SDK 55's dev launcher still references `self.appBridge`,",
|
||||
" // but React Native 0.83 removed that property from the delegate base class.",
|
||||
" // Newer Expo builds stop updating the dev menu bridge here.",
|
||||
].join("\n");
|
||||
|
||||
let patchedCount = 0;
|
||||
let locatedCount = 0;
|
||||
|
||||
for (const filePath of candidates) {
|
||||
if (!existsSync(filePath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
locatedCount += 1;
|
||||
const source = readFileSync(filePath, "utf8");
|
||||
|
||||
if (source.includes(replacement)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!source.includes(targetLine)) {
|
||||
throw new Error(
|
||||
`Found expo-dev-launcher source at ${filePath}, but the expected bridge line was missing.`,
|
||||
);
|
||||
}
|
||||
|
||||
const nextSource = source.replace(` ${targetLine}`, replacement);
|
||||
writeFileSync(filePath, nextSource);
|
||||
patchedCount += 1;
|
||||
}
|
||||
|
||||
if (patchedCount > 0) {
|
||||
console.log(
|
||||
`[patch-expo-dev-launcher] patched ${patchedCount} expo-dev-launcher installation(s).`,
|
||||
);
|
||||
} else if (locatedCount > 0) {
|
||||
console.log("[patch-expo-dev-launcher] expo-dev-launcher already patched.");
|
||||
} else {
|
||||
console.log("[patch-expo-dev-launcher] expo-dev-launcher not installed; skipping.");
|
||||
}
|
||||
Reference in new issue
Block a user