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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions apps/mobile/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { installPermissionUpdateNotice } from "./features/connection/permissionUpdateNotice";
import { installComposerAttachmentUploads } from "./state/composer-attachment-uploads";
import { installThreadOutboxDelivery } from "./state/threadOutboxDelivery";
import * as Linking from "expo-linking";
import * as SplashScreen from "expo-splash-screen";
import { useEffect } from "react";
Expand Down Expand Up @@ -86,11 +88,14 @@ const navigationRef = createNavigationContainerRef();

declare const module: { readonly hot?: FoundationHotModule } | undefined;

const disposePermissionUpdateNotice = installPermissionUpdateNotice();
disposeOnFoundationReplace(
typeof module === "undefined" ? undefined : module.hot,
disposePermissionUpdateNotice,
);
const appServiceDisposers = [
installPermissionUpdateNotice(),
installThreadOutboxDelivery(),
installComposerAttachmentUploads(),
];
disposeOnFoundationReplace(typeof module === "undefined" ? undefined : module.hot, () => {
for (const dispose of appServiceDisposers) dispose();
});

function SplashScreenCoordinator() {
const { isReady } = useAppearancePreferences();
Expand Down
66 changes: 29 additions & 37 deletions apps/mobile/src/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ import { SettingsEnvironmentDetailRouteScreen } from "./features/settings/Settin
import { SettingsEnvironmentsRouteScreen } from "./features/settings/SettingsEnvironmentsRouteScreen";
import { SettingsFollowUpRouteScreen } from "./features/settings/SettingsFollowUpRouteScreen";
import {
SettingsEnvironmentAgentBehaviorRouteScreen,
SettingsEnvironmentMaintenanceRouteScreen,
SettingsEnvironmentNewThreadsRouteScreen,
SettingsThreadsRouteScreen,
SettingsWorktreesRouteScreen,
SettingsEnvironmentSourceControlRouteScreen,
} from "./features/settings/SettingsServerControlsRouteScreen";
import {
Expand All @@ -125,7 +125,7 @@ import { UsageRouteScreen } from "./features/usage/UsageRouteScreen";
import { SettingsAboutRouteScreen } from "./features/settings/SettingsAboutRouteScreen";
import { SettingsNotificationsRouteScreen } from "./features/settings/SettingsNotificationsRouteScreen";
import { SettingsRouteScreen } from "./features/settings/SettingsRouteScreen";
import { SettingsThreadsRouteScreen } from "./features/settings/SettingsThreadsRouteScreen";
import { SettingsLabsRouteScreen } from "./features/settings/ThreadSettingsSections";
import { SettingsEnvironmentFilterProvider } from "./features/settings/settings-environment-filter";
import { openSettings, settingsOpenIn } from "./features/settings/settings-navigation";
import { DEFAULT_SETTINGS_PAGE } from "./features/workspace/workspace-tab-navigation";
Expand All @@ -149,8 +149,6 @@ import { deriveLayout } from "./lib/layout";
import { useNativeLayoutMetrics } from "./native/native-layout-metrics";
import { nativeHeaderScrollEdgeEffects } from "./native/StackHeader";
import { HORIZONTAL_FORM_SHEET_OPTIONS, formSheetDetents } from "./native/sheet-surface";
import { useThreadOutboxDrain } from "./state/use-thread-outbox-drain";
import { useComposerAttachmentUploadWorker } from "./state/composer-attachment-uploads";
import {
selectWorkspaceDetail,
workspaceDetailRouter,
Expand Down Expand Up @@ -263,25 +261,36 @@ const SETTINGS_SCREENS = {
linking: "settings/environments/:environmentId",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Environment" },
}),
// Old links to New threads and Agent behavior open Threads, which absorbed them.
SettingsEnvironmentNewThreads: createNativeStackScreen({
screen: SettingsEnvironmentNewThreadsRouteScreen,
screen: SettingsThreadsRouteScreen,
linking: "settings/new-threads",
options: { ...SETTINGS_PAGE_OPTIONS, title: "New threads" },
options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
}),
SettingsEnvironmentSourceControl: createNativeStackScreen({
screen: SettingsEnvironmentSourceControlRouteScreen,
linking: "settings/source-control",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Source control" },
}),
SettingsEnvironmentAgentBehavior: createNativeStackScreen({
screen: SettingsEnvironmentAgentBehaviorRouteScreen,
screen: SettingsThreadsRouteScreen,
linking: "settings/agent-behavior",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Agent behavior" },
options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
}),
SettingsWorktrees: createNativeStackScreen({
screen: SettingsWorktreesRouteScreen,
linking: "settings/worktrees",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Worktrees" },
}),
SettingsLabs: createNativeStackScreen({
screen: SettingsLabsRouteScreen,
linking: "settings/labs",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Labs" },
}),
SettingsProviderAccounts: createNativeStackScreen({
screen: SettingsProviderAccountsRouteScreen,
linking: "settings/provider-accounts",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Provider accounts" },
options: { ...SETTINGS_PAGE_OPTIONS, title: "Providers" },
}),
SettingsEnvironmentMaintenance: createNativeStackScreen({
screen: SettingsEnvironmentMaintenanceRouteScreen,
Expand All @@ -296,12 +305,12 @@ const SETTINGS_SCREENS = {
SettingsThreads: createNativeStackScreen({
screen: SettingsThreadsRouteScreen,
linking: "settings/thread-preferences",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Thread behavior" },
options: { ...SETTINGS_PAGE_OPTIONS, title: "Threads" },
}),
SettingsAbout: createNativeStackScreen({
screen: SettingsAboutRouteScreen,
linking: "settings/about",
options: { ...SETTINGS_PAGE_OPTIONS, title: "About T3 Code" },
options: { ...SETTINGS_PAGE_OPTIONS, title: "About" },
}),
SettingsEnvironmentNew: createNativeStackScreen({
screen: ConnectionsNewRouteScreen,
Expand All @@ -316,7 +325,7 @@ const SETTINGS_SCREENS = {
linking: "settings/archive",
options: {
...SETTINGS_PAGE_OPTIONS,
title: "Archived Threads",
title: "Archive",
},
}),
SettingsNavigation: createNativeStackScreen({
Expand All @@ -337,21 +346,21 @@ const SETTINGS_SCREENS = {
linking: "settings/project-grouping",
options: {
...SETTINGS_PAGE_OPTIONS,
title: "Organization",
title: "General",
},
}),
SettingsOrganization: createNativeStackScreen({
screen: SettingsProjectGroupingRouteScreen,
linking: "settings/organization",
options: {
...SETTINGS_PAGE_OPTIONS,
title: "Organization",
title: "General",
},
}),
SettingsProjectOverview: createNativeStackScreen({
screen: SettingsProjectOverviewRouteScreen,
linking: "settings/project",
options: { ...SETTINGS_PAGE_OPTIONS, title: "Project overview" },
options: { ...SETTINGS_PAGE_OPTIONS, title: "Projects" },
}),
SettingsKeyboard: createNativeStackScreen({
screen: SettingsKeyboardRouteScreen,
Expand All @@ -374,15 +383,15 @@ const SETTINGS_SCREENS = {
linking: "settings/follow-ups",
options: {
...SETTINGS_PAGE_OPTIONS,
title: "Follow-ups",
title: "Chat",
},
}),
SettingsScheduledTasks: createNativeStackScreen({
screen: SettingsScheduledTasksRouteScreen,
linking: "settings/scheduled-tasks",
options: {
...SETTINGS_PAGE_OPTIONS,
title: "Scheduled Tasks",
title: "Scheduled tasks",
headerTitleStyle: { fontSize: 16, fontWeight: "800" },
},
}),
Expand Down Expand Up @@ -485,13 +494,6 @@ function workspaceLocationFromState(state: NavigationState) {
};
}

// Isolate subscriptions so streaming updates cannot re-render RootStackLayout and every screen.
function ThreadOutboxDrainWorker() {
useThreadOutboxDrain();
useComposerAttachmentUploadWorker();
return null;
}

function RootStackLayout(props: {
readonly children: React.ReactNode;
readonly state: NavigationState;
Expand All @@ -509,16 +511,11 @@ function RootStackLayout(props: {
);
const draftRoute = props.state.routes.findLast((route) => route.name === "Thread");
const draftParams = (
draftRoute?.params as
| { draft?: { draftId?: string | string[]; pendingTaskId?: string | string[] } }
| undefined
draftRoute?.params as { draft?: { draftId?: string | string[] } } | undefined
)?.draft;
const routeDraftId = Array.isArray(draftParams?.draftId)
? draftParams.draftId[0]
: draftParams?.draftId;
const routePendingTaskId = Array.isArray(draftParams?.pendingTaskId)
? draftParams.pendingTaskId[0]
: draftParams?.pendingTaskId;
useAgentNotificationNavigation(workspaceLocation.pathname);
useConnectOnboardingNavigation();
useAppShortcuts(props.state);
Expand All @@ -540,13 +537,8 @@ function RootStackLayout(props: {
}, [navigation, pendingShare, props.state]);

return (
<NewTaskFlowProvider
active={isDraftThreadRoute(draftRoute)}
routeDraftId={routeDraftId}
routePendingTaskId={routePendingTaskId}
>
<NewTaskFlowProvider active={isDraftThreadRoute(draftRoute)} routeDraftId={routeDraftId}>
<HardwareKeyboardCommandProvider pathname={pathname}>
<ThreadOutboxDrainWorker />
<ShowcaseCaptureCoordinator pathname={pathname} />
<SettingsEnvironmentFilterProvider open={settingsOpen}>
<WorkspaceConnectionStatusProvider>
Expand Down
6 changes: 2 additions & 4 deletions apps/mobile/src/components/ui/ListChoiceRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ export function ListChoiceRow(props: {
onPress={props.onPress}
android_ripple={{ color: rippleStyle.backgroundColor }}
unstable_pressDelay={Platform.OS === "android" ? 50 : undefined}
className={cn(
props.selected ? "bg-subtle" : "bg-grouped-card",
props.separated && "border-t border-border-subtle",
)}
// Like UIKit and Material lists, only the checkmark or radio marks the selected row.
className={cn("bg-grouped-card", props.separated && "border-t border-border-subtle")}
>
<ListRowLayout
label={props.label}
Expand Down

This file was deleted.

Loading