@@ -13,9 +13,11 @@ import { |
13 | 13 | createPathConfigForStaticNavigation, |
14 | 14 | createStaticNavigation, |
15 | 15 | getActionFromState, |
| 16 | + getStateFromPath, |
16 | 17 | type NavigationAction, |
17 | 18 | type NavigationState, |
18 | 19 | } from "@react-navigation/native"; |
| 20 | +import { pipe } from "effect/Function"; |
19 | 21 |
|
20 | 22 | import { RegistryContext } from "@effect/atom-react"; |
21 | 23 | import { ProjectChipIconRasterizer } from "./native/ProjectChipIconImages"; |
@@ -48,12 +50,22 @@ import { subscribeComposerDraftModelReconciliation } from "./state/use-composer- |
48 | 50 | import { environmentThreadShells } from "./state/threads"; |
49 | 51 | import { environmentShell } from "./state/shell"; |
50 | 52 | import { OverlayPortalHost } from "./components/ui/OverlayPortal"; |
51 | | -import { shouldHandleAppLink } from "./lib/appLinking"; |
| 53 | +import { shouldHandleAppLink, restoreDraftLinkState } from "./lib/appLinking"; |
52 | 54 | import { hasCloudPublicConfig } from "./features/cloud/publicConfig"; |
53 | | -import { pairingFormLinkAction } from "./features/connection/devAutoConnect"; |
54 | | -import { resolvePendingNewTaskPromptLink } from "./features/prompt-links/newTaskPromptLink"; |
55 | | -import { resolvePendingThreadPromptLink } from "./features/prompt-links/threadPromptLink"; |
56 | | -import { getAppStateFromPath } from "./lib/appLinkState"; |
| 55 | +import { takeScheduledTaskNewLink } from "./features/settings/scheduled-task-editor-state"; |
| 56 | +import { |
| 57 | + pairingFormLinkAction, |
| 58 | + startDevAutoConnect, |
| 59 | + withoutPairingTarget, |
| 60 | +} from "./features/connection/devAutoConnect"; |
| 61 | +import { |
| 62 | + resolvePendingNewTaskPromptLink, |
| 63 | + takeNewTaskPromptLink, |
| 64 | +} from "./features/prompt-links/newTaskPromptLink"; |
| 65 | +import { |
| 66 | + resolvePendingThreadPromptLink, |
| 67 | + takeThreadPromptLink, |
| 68 | +} from "./features/prompt-links/threadPromptLink"; |
57 | 69 | import { |
58 | 70 | disposeOnFoundationReplace, |
59 | 71 | type FoundationHotModule, |
@@ -63,10 +75,12 @@ import { installUiRuntimeMemoryWarningGc } from "./lib/useUiRuntimeMemoryWarning |
63 | 75 | import { SubscriptionUsageCoordinator } from "./widgets/SubscriptionUsageCoordinator"; |
64 | 76 | import { installSubscriptionUsageRefresh } from "./widgets/useSubscriptionUsage"; |
65 | 77 | import { GlobalVoiceInputControl } from "./features/voice-input/GlobalVoiceInputControl"; |
| 78 | +import { restoreSettingsLinkState } from "./features/settings/settings-navigation"; |
66 | 79 | import { |
67 | 80 | hydrateWorkspaceSelections, |
68 | 81 | launchWorkspaceURL, |
69 | 82 | recordWorkspaceSelections, |
| 83 | + settingsLinkPage, |
70 | 84 | } from "./features/workspace/workspace-selection-store"; |
71 | 85 | import { workspaceDetailLinkAction } from "./features/workspace/workspace-detail-selection"; |
72 | 86 | import { NativeLayoutMetricsProvider } from "./native/native-layout-metrics"; |
@@ -94,6 +108,19 @@ const linkingConfig = { |
94 | 108 | screens: createPathConfigForStaticNavigation(RootStack, { initialRouteName: "Home" }) ?? {}, |
95 | 109 | } as const; |
96 | 110 |
|
| 111 | +function getAppStateFromPath(path: string, options: Parameters<typeof getStateFromPath>[1]) { |
| 112 | + return pipe( |
| 113 | + getStateFromPath(path, options), |
| 114 | + (state) => restoreDraftLinkState(state, path), |
| 115 | + (state) => restoreSettingsLinkState(state, settingsLinkPage()), |
| 116 | + takeThreadPromptLink, |
| 117 | + takeNewTaskPromptLink, |
| 118 | + withoutPairingTarget, |
| 119 | + startDevAutoConnect, |
| 120 | + takeScheduledTaskNewLink, |
| 121 | + ); |
| 122 | +} |
| 123 | + |
97 | 124 | const appLinking = { |
98 | 125 | prefixes: [Linking.createURL("/"), "t3code://", "t3code-dev://", "t3code-preview://"], |
99 | 126 | config: { initialRouteName: "Home" }, |
|