Skip to content

Commit 6f3a570

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-9317
2 parents 493a0d7 + 9bc4138 commit 6f3a570

159 files changed

Lines changed: 3599 additions & 4554 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ runs:
4747
echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"
4848
"$HOME/.vite-plus/bin/vp" env use "${{ steps.vp.outputs.node }}"
4949
50+
# vp gives each Node.js download attempt 10 minutes by default, so one
51+
# stalled stream holds the job that long. It retries 3 times and resumes
52+
# partial bytes, so a shorter limit costs a slow download only a retry.
5053
- name: Setup Vite+
5154
if: steps.vp_cache.outputs.cache-hit != 'true'
5255
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
56+
env:
57+
VP_DOWNLOAD_TIMEOUT: "120"
5358
with:
5459
node-version-file: package.json
5560
cache: false

‎.github/workflows/release-desktop.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,24 @@ jobs:
254254
if [[ "${{ inputs.version }}" =~ -nightly\.[0-9]{8}\.[0-9]+$ ]]; then brand=nightly; fi
255255
node scripts/apply-web-brand-assets.ts "$brand" apps/server/dist/client
256256
257+
# tsdown downloads the target Node with one fetch and no retry, and
258+
# nodejs.org drops that download often enough to fail releases. Seed
259+
# tsdown's cache with a retried, checksum-verified copy instead.
260+
- name: Download target Node.js for the CLI executable
261+
if: inputs.cli_archive && inputs.platform == 'win'
262+
shell: bash
263+
run: |
264+
set -euo pipefail
265+
version="$(node -p 'require("./package.json").engines.node')"
266+
name="node-v$version-win-${{ inputs.arch }}"
267+
dest="${XDG_CACHE_HOME:-$HOME/.cache}/tsdown/node/v$version/win-${{ inputs.arch }}"
268+
dir="$RUNNER_TEMP/node-download"
269+
mkdir -p "$dir" "$dest"
270+
curl -fsSL --retry 5 --retry-all-errors -o "$dir/$name.zip" "https://nodejs.org/dist/v$version/$name.zip"
271+
curl -fsSL --retry 5 --retry-all-errors -o "$dir/SHASUMS256.txt" "https://nodejs.org/dist/v$version/SHASUMS256.txt"
272+
(cd "$dir" && grep " $name.zip\$" SHASUMS256.txt | sha256sum -c -)
273+
unzip -p "$dir/$name.zip" "$name/node.exe" > "$dest/node.exe"
274+
257275
# Setup Vite+ selects the exact engines.node version from package.json.
258276
# Native builds embed that executable; cross-target builds download the
259277
# same version for their target.

‎apps/desktop/src/app/DesktopAppActivation.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// @effect-diagnostics nodeBuiltinImport:off -- Local socket ownership checks need lstat, an atomic rename, and a directory watch at the Node adapter boundary.
2+
import { pipe } from "effect/Function";
23
import * as NodeCrypto from "node:crypto";
34
import * as NodeFS from "node:fs";
45
import * as NodeFSP from "node:fs/promises";
@@ -151,8 +152,10 @@ export async function startDesktopAppControlServer(input: {
151152
}
152153

153154
if (!isDesktopAppActivationRequest(parsed)) {
154-
finish(
155-
invalidResponse(requestIdFromUnknown(parsed), "The desktop app request is invalid."),
155+
pipe(
156+
requestIdFromUnknown(parsed),
157+
(requestId) => invalidResponse(requestId, "The desktop app request is invalid."),
158+
finish,
156159
);
157160
return;
158161
}

‎apps/desktop/src/settings/DesktopClientSettings.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const clientSettings: ClientSettings = {
6363
},
6464
sidebarProjectSortOrder: "manual",
6565
sidebarThreadSortOrder: "created_at",
66-
sidebarThreadPreviewCount: 6,
66+
boringSidebarEnabled: false,
6767
legacySidebarEnabled: false,
6868
sidebarWorkingShelfEnabled: false,
6969
loadBalancingEnabled: false,

‎apps/desktop/src/snapShot/DesktopSnapShot.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @effect-diagnostics globalTimers:off -- Capture timeouts and Electron overlay animation timers run at native callback boundaries outside Effect fibers.
22

3+
import { pipe } from "effect/Function";
34
import {
45
DEFAULT_CLIENT_SETTINGS,
56
DesktopPendingSnapShot,
@@ -1288,10 +1289,10 @@ export const make = Effect.gen(function* () {
12881289
if (isModifierPairShortcut(shortcut)) {
12891290
registered = yield* Effect.tryPromise(() =>
12901291
startPairShortcutProcess(snapShotShortcutModifierPair(shortcut), onCurrentShortcut, () => {
1291-
void runPromise(
1292-
setShortcutFailure(
1293-
snapShotShortcutRegistrationFailureMessage(shortcut, environment.platform),
1294-
),
1292+
void pipe(
1293+
snapShotShortcutRegistrationFailureMessage(shortcut, environment.platform),
1294+
setShortcutFailure,
1295+
runPromise,
12951296
).catch(() => undefined);
12961297
}),
12971298
).pipe(

‎apps/mobile/src/App.tsx‎

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import {
1313
createPathConfigForStaticNavigation,
1414
createStaticNavigation,
1515
getActionFromState,
16+
getStateFromPath,
1617
type NavigationAction,
1718
type NavigationState,
1819
} from "@react-navigation/native";
20+
import { pipe } from "effect/Function";
1921

2022
import { RegistryContext } from "@effect/atom-react";
2123
import { ProjectChipIconRasterizer } from "./native/ProjectChipIconImages";
@@ -48,12 +50,22 @@ import { subscribeComposerDraftModelReconciliation } from "./state/use-composer-
4850
import { environmentThreadShells } from "./state/threads";
4951
import { environmentShell } from "./state/shell";
5052
import { OverlayPortalHost } from "./components/ui/OverlayPortal";
51-
import { shouldHandleAppLink } from "./lib/appLinking";
53+
import { shouldHandleAppLink, restoreDraftLinkState } from "./lib/appLinking";
5254
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";
5769
import {
5870
disposeOnFoundationReplace,
5971
type FoundationHotModule,
@@ -63,10 +75,12 @@ import { installUiRuntimeMemoryWarningGc } from "./lib/useUiRuntimeMemoryWarning
6375
import { SubscriptionUsageCoordinator } from "./widgets/SubscriptionUsageCoordinator";
6476
import { installSubscriptionUsageRefresh } from "./widgets/useSubscriptionUsage";
6577
import { GlobalVoiceInputControl } from "./features/voice-input/GlobalVoiceInputControl";
78+
import { restoreSettingsLinkState } from "./features/settings/settings-navigation";
6679
import {
6780
hydrateWorkspaceSelections,
6881
launchWorkspaceURL,
6982
recordWorkspaceSelections,
83+
settingsLinkPage,
7084
} from "./features/workspace/workspace-selection-store";
7185
import { workspaceDetailLinkAction } from "./features/workspace/workspace-detail-selection";
7286
import { NativeLayoutMetricsProvider } from "./native/native-layout-metrics";
@@ -94,6 +108,19 @@ const linkingConfig = {
94108
screens: createPathConfigForStaticNavigation(RootStack, { initialRouteName: "Home" }) ?? {},
95109
} as const;
96110

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+
97124
const appLinking = {
98125
prefixes: [Linking.createURL("/"), "t3code://", "t3code-dev://", "t3code-preview://"],
99126
config: { initialRouteName: "Home" },

‎apps/mobile/src/features/connection/ConnectionDiagnosisDetails.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
} from "@t3tools/client-runtime/connection";
1111
import type { EnvironmentId } from "@t3tools/contracts";
1212
import Constants from "expo-constants";
13-
import * as Option from "effect/Option";
1413
import { AsyncResult } from "effect/reactivity";
1514
import { Linking, View } from "react-native";
1615

@@ -28,8 +27,8 @@ export function useConnectionDiagnosis(
2827
environmentId: EnvironmentId,
2928
presentation: EnvironmentPresentation | null,
3029
) {
31-
const state = Option.getOrElse(
32-
AsyncResult.value(useAtomValue(environmentCatalog.stateAtom(environmentId))),
30+
const state = AsyncResult.getOrElse(
31+
useAtomValue(environmentCatalog.stateAtom(environmentId)),
3332
() => AVAILABLE_CONNECTION_STATE,
3433
);
3534
if (presentation === null || !presentation.entry.enabled) return { diagnosis: null, state };

‎apps/mobile/src/features/pull-requests/usePullRequestFilesViewed.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { usePullRequestConnected } from "./usePullRequestConnected";
22
import { RegistryContext, useAtomRefresh, useAtomValue } from "@effect/atom-react";
33
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
44
import type { PullRequestDetail } from "@t3tools/contracts";
5-
import * as Option from "effect/Option";
65
import { AsyncResult } from "effect/reactivity";
76
import { use, useState } from "react";
87
import { composerPullRequests } from "../../state/pull-requests";
@@ -50,8 +49,9 @@ export function usePullRequestFilesViewed(params: PullRequestParams, pr: PullReq
5049
input: { ...target.input, files: [{ path, viewed }] },
5150
});
5251
// The read that is current once the write lands still predates it; a newer one carries it.
53-
const readAtWrite = Option.getOrNull(
54-
AsyncResult.value(registry.get(composerPullRequests.filesViewed(target))),
52+
const readAtWrite = AsyncResult.getOrElse(
53+
registry.get(composerPullRequests.filesViewed(target)),
54+
() => null,
5555
);
5656
setState((current) => {
5757
if (current.key !== scopeKey || current.presses[path]?.version !== version) return current;

‎apps/mobile/src/features/pull-requests/usePullRequestList.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { executeAtomQuery, squashAtomCommandFailure } from "@t3tools/client-runt
33
import type { EnvironmentId, PullRequestDiffStat, PullRequestListInput } from "@t3tools/contracts";
44
import * as Cause from "effect/Cause";
55
import * as Effect from "effect/Effect";
6-
import * as Option from "effect/Option";
76
import { AsyncResult, Atom, type AtomRegistry } from "effect/reactivity";
87
import { use, useMemo, useState } from "react";
98
import { environmentCatalog } from "../../connection/catalog";
@@ -32,7 +31,7 @@ type Read = <A>(atom: Atom.Atom<A>) => A;
3231

3332
/** The head the list query holds now, cached or answered. */
3433
function currentHead(read: Read, target: ListTarget) {
35-
return Option.getOrNull(AsyncResult.value(read(composerPullRequests.list(target))));
34+
return AsyncResult.getOrElse(read(composerPullRequests.list(target)), () => null);
3635
}
3736

3837
function currentPages(read: Read, target: ListTarget): PullRequestListPages | null {

‎apps/mobile/src/features/settings/EnvironmentRoutesSection.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function EnvironmentRoutesSection({
5656
const entry = useAtomValue(environmentCatalog.catalogValueAtom).entries.get(environmentId);
5757
const prepared = useAtomValue(environmentSession.preparedConnectionValueAtom(environmentId));
5858
const sessionResult = useAtomValue(environmentSession.sessionStateAtom(environmentId));
59-
const session = Option.getOrNull(AsyncResult.value(sessionResult));
59+
const session = AsyncResult.getOrElse(sessionResult, () => null);
6060
const [permissionsOpen, setPermissionsOpen] = useState(false);
6161
const reorder = useAtomCommand(environmentCatalog.reorderRoutes, "route reorder");
6262
const removeRoute = useAtomCommand(environmentCatalog.removeRoute, "route removal");

0 commit comments

Comments
 (0)