Skip to content

Commit 51d6213

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-25399
2 parents d607be3 + 28286d5 commit 51d6213

114 files changed

Lines changed: 3520 additions & 1731 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.

‎.coderabbit.config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@ export default defineConfig((ctx) => ({
2626
path: "apps/web/src/**/*.{tsx,css}",
2727
instructions: "Hold changed code to the rules in docs/internals/web-ui.md.",
2828
},
29+
{
30+
path: "**/*.test.{ts,tsx}",
31+
instructions:
32+
"Hold changed tests to the rules in docs/internals/testing.md. Request tests only as those rules allow.",
33+
},
2934
],
3035
},
3136
knowledge_base: {
3237
code_guidelines: {
3338
filePatterns: [
3439
{ files: "docs/internals/effect-services.md", applyTo: "{apps,packages,infra}/**/*.ts" },
3540
{ files: "docs/internals/web-ui.md", applyTo: "apps/web/src/**/*.{tsx,css}" },
41+
{ files: "docs/internals/testing.md", applyTo: "{apps,packages,infra}/**/*.{ts,tsx}" },
3642
],
3743
},
3844
},

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
103103
- Use `vp run typecheck`, not `npx tsc`; it caches per package. Both run tsc-rs (`typescript` is the `@tsc-rs/typescript` drop-in).
104104
- Run `node -e` snippets from `apps/server` or the owning package. `effect` does not resolve from the repo root.
105105
- Test meaningful logic or observable behavior. Do not render components to static markup to assert props or attributes, or add tests that merely assert callback wiring or mirror the implementation.
106+
- [Testing](docs/internals/testing.md) carries these same test rules, plus review guidance, for review bots. Change both together.
106107
- **Do not run repo-wide checks.** No `vp check`, no `vp run -r test`, no `vp run -r typecheck` unless I ask. CI owns the full suite.
107108
- Backend behavior changes ship with focused tests for that behavior.
108109
- Proof for a bug fix depends on the bug. Logic, data, state, and protocol bugs get a failing test first (the fewest that fail on `main` for that reason, in the module's existing test file), then the fix. Purely visual bugs (spacing, colour, alignment, a layout shift) get before/after captures as their proof and no test: do not add UI tests for nitpicks, and do not ask for one in review when a capture already shows it. A server-only fix with no visible surface ships the test plus a short runtime transcript.

‎apps/mobile/package.json‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@
7373
"@t3tools/mobile-review-diff-native": "file:./modules/t3-review-diff",
7474
"@t3tools/mobile-source-text": "file:./modules/t3-source-text",
7575
"@t3tools/mobile-terminal-native": "file:./modules/t3-terminal",
76-
"@t3tools/provider-acp-registry": "workspace:*",
77-
"@t3tools/provider-core": "workspace:*",
78-
"@t3tools/provider-cursor": "workspace:*",
79-
"@t3tools/provider-fx": "workspace:*",
80-
"@t3tools/provider-grok": "workspace:*",
81-
"@t3tools/provider-muse": "workspace:*",
82-
"@t3tools/provider-opencode": "workspace:*",
83-
"@t3tools/provider-pi": "workspace:*",
8476
"@t3tools/shared": "workspace:*",
8577
"@tabler/icons-react-native": "^3.44.0",
8678
"clsx": "^2.1.1",

‎apps/mobile/src/App.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { CloudAuthProvider } from "./features/cloud/CloudAuthProvider";
2626
import { prepareNativeShowcaseCapture } from "./features/showcase/nativeShowcaseScene";
2727
import {
2828
presentPendingIncomingShare,
29+
pruneIncomingShareImports,
2930
startIncomingShareInbox,
3031
} from "./features/sharing/IncomingShareProvider";
3132
import {
@@ -133,6 +134,7 @@ function handleNavigationStateChange(state: NavigationState | undefined): void {
133134
setAgentNotificationPathname(workspaceLocationFromState(state).pathname);
134135
recordAppShortcutNavigationState(state);
135136
pruneNewTaskBranchCheckouts(state);
137+
pruneIncomingShareImports(state);
136138
}
137139

138140
function handleNavigationReady(): void {

‎apps/mobile/src/Stack.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,12 @@ export function workspaceLocationFromState(state: NavigationState) {
482482
? ({ ...state, routes, index: routes.length - 1 } as NavigationState)
483483
: state;
484484
const path = getPathFromState(effectiveState, navigationPathConfig);
485+
const route = effectiveState.routes[effectiveState.index];
485486
return {
486487
pathname: path.startsWith("/") ? path : `/${path}`,
487-
routeKey: effectiveState.routes[effectiveState.index]?.key,
488+
routeKey: route?.key,
489+
routeName: route?.name,
490+
routeKeys: effectiveState.routes.map((stackRoute) => stackRoute.key),
488491
};
489492
}
490493

@@ -518,6 +521,8 @@ function RootStackLayout(props: {
518521
<AdaptiveWorkspaceLayout
519522
pathname={workspaceLocation.pathname}
520523
workspaceRouteKey={workspaceLocation.routeKey}
524+
workspaceRouteName={workspaceLocation.routeName}
525+
workspaceRouteKeys={workspaceLocation.routeKeys}
521526
selectedPullRequestKey={selectedPullRequestKey(props.state)}
522527
>
523528
{props.children}

‎apps/mobile/src/components/ComposerModelControl.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function ComposerModelControl(props: {
7070
/>
7171
)
7272
}
73-
label={label}
73+
label={props.modelOption?.shortName ?? label}
7474
iconOnly={props.iconOnly}
7575
suffix={
7676
summary ? (

‎apps/mobile/src/components/ProviderIcon.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useId, useState } from "react";
1010
import { resolveOfficialAcpRegistryIconUrl } from "@t3tools/contracts";
1111
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
1212
import { AppText as Text } from "./ui/AppText";
13-
import { getProviderClient } from "../lib/providerClients";
13+
import { getProviderClient } from "@t3tools/client-runtime/provider-clients";
1414

1515
type ProviderIconProps = {
1616
readonly provider: string | null | undefined;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import type { Wakeups } from "@t3tools/client-runtime/connection";
22

3-
export const MOBILE_BACKGROUND_RECONNECT_AFTER_MS = 10_000;
3+
export const MOBILE_LONG_BACKGROUND_AFTER_MS = 10_000;
44

55
export type MobileApplicationActiveWakeup = Extract<
66
Wakeups.ConnectionWakeup,
7-
"application-active-probe" | "application-active-reconnect"
7+
"application-active-probe" | "application-active-long"
88
>;
99

1010
export function mobileApplicationActiveWakeup(
1111
backgroundedAtMs: number | null,
1212
activeAtMs: number,
1313
): MobileApplicationActiveWakeup {
1414
return backgroundedAtMs !== null &&
15-
activeAtMs - backgroundedAtMs >= MOBILE_BACKGROUND_RECONNECT_AFTER_MS
16-
? "application-active-reconnect"
15+
activeAtMs - backgroundedAtMs >= MOBILE_LONG_BACKGROUND_AFTER_MS
16+
? "application-active-long"
1717
: "application-active-probe";
1818
}

‎apps/mobile/src/connection/platform.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const networkPathChanges = Stream.callback<"network-changed">((queue) =>
118118
const layerWakeups = Wakeups.layer({
119119
changes: Stream.mergeAll(
120120
[
121-
Stream.callback<"application-active-probe" | "application-active-reconnect">((queue) =>
121+
Stream.callback<"application-active-probe" | "application-active-long">((queue) =>
122122
Effect.acquireRelease(
123123
Effect.sync(() => {
124124
let backgroundedAtMs = AppState.currentState === "background" ? Date.now() : null;

‎apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { resolveFilesystemReadAccess } from "@t3tools/client-runtime/state/files
44
import { environmentSession } from "../../state/session";
55
import { NativeStackScreenOptions } from "../../native/StackHeader";
66
import { StackActions, useNavigation, type StaticScreenProps } from "@react-navigation/native";
7-
import { useEffect, useId, useRef, useState } from "react";
7+
import { useId, useState } from "react";
88
import { Platform, View } from "react-native";
99
import { useSafeAreaInsets } from "react-native-safe-area-context";
1010
import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
@@ -431,14 +431,13 @@ function FilesToolbarBottomFade() {
431431
export function ThreadFilesTreeScreen(props: ThreadFilesRouteScreenProps) {
432432
useAdaptiveWorkspacePaneRole("inspector");
433433
const navigation = useNavigation();
434-
const { fileInspector, layout, showAuxiliaryPane } = useAdaptiveWorkspaceLayout();
434+
const { fileInspector, layout } = useAdaptiveWorkspaceLayout();
435435
const [searchQuery, setSearchQuery] = useState("");
436436
const { themeAppearance: highlightTheme } = useAppearancePreferences();
437437
const { cwd, environmentId, projectName, selectedThread, threadId } = useThreadFilesWorkspace(
438438
props.route.params,
439439
);
440440
const hasFileInspector = fileInspector.supported && threadId !== null;
441-
const revealedInspectorRef = useRef(false);
442441
const fileAccessSession = useEnvironmentQuery(
443442
environmentId !== null ? environmentSession.sessionStateAtom(environmentId) : null,
444443
);
@@ -511,13 +510,6 @@ export function ThreadFilesTreeScreen(props: ThreadFilesRouteScreenProps) {
511510
theme: highlightTheme,
512511
});
513512
};
514-
useEffect(() => {
515-
if (hasFileInspector && cwd !== null && !revealedInspectorRef.current) {
516-
revealedInspectorRef.current = true;
517-
showAuxiliaryPane("inspector");
518-
}
519-
}, [cwd, hasFileInspector, showAuxiliaryPane]);
520-
521513
if (environmentId === null || (threadId !== null && selectedThread === null)) {
522514
if (hasFileInspector) {
523515
return (

0 commit comments

Comments
 (0)