History

Merge origin/main into mobile remote connect

Julius Marminge committed 6 months ago

Commit 0c1ccda2 parents 7d20cb9 35721d916 files · +87 −21Browse files

Unified · Split

16 files
  1. apps/desktop/package.json +1 −1
  2. apps/server/package.json +2 −3
  3. apps/web/package.json +2 −3
  4. apps/web/src/components/DiffPanel.tsx +68 −1
  5. apps/web/src/routes/_chat.$environmentId.$threadId.tsx +1 −1
  6. bun.lock +6 −3
  7. package.json +4 −0
  8. packages/client-runtime/package.json +0 −1
  9. packages/contracts/package.json +1 −2
  10. packages/effect-acp/package.json +0 −1
  11. packages/effect-codex-app-server/package.json +0 −1
  12. packages/shared/package.json +0 −1
  13. packages/ssh/package.json +0 −1
  14. packages/tailscale/package.json +0 −1
  15. scripts/package.json +0 −1
  16. scripts/release-smoke.ts +2 −0
apps/desktop/package.json+1−1
@@ -1,6 +1,6 @@
11 {
22 "name": "@t3tools/desktop",
3− "version": "0.0.21",
3+ "version": "0.0.22",
44 "private": true,
55 "type": "module",
66 "main": "dist-electron/main.cjs",
apps/server/package.json+2−3
@@ -1,6 +1,6 @@
11 {
22 "name": "t3",
3− "version": "0.0.21",
3+ "version": "0.0.22",
44 "license": "MIT",
55 "repository": {
66 "type": "git",
@@ -19,7 +19,6 @@ · 12 unmodified lines
1919 "build": "node scripts/cli.ts build",
2020 "build:bundle": "tsdown",
2121 "start": "node dist/bin.mjs",
22− "prepare": "effect-language-service patch",
2322 "typecheck": "tsc --noEmit",
2423 "test": "vitest run",
2524 "test:process-reaper": "vitest run src/server.test.ts src/provider/Layers/ClaudeAdapter.test.ts src/provider/Layers/ProviderSessionDirectory.test.ts src/provider/Layers/ProviderSessionReaper.test.ts src/provider/Layers/CodexAdapter.test.ts"
@@ -30,7 +29,7 @@ · 4 unmodified lines
3029 "@effect/platform-node": "catalog:",
3130 "@effect/sql-sqlite-bun": "catalog:",
3231 "@opencode-ai/sdk": "^1.3.15",
33− "@pierre/diffs": "^1.1.0-beta.16",
32+ "@pierre/diffs": "catalog:",
3433 "effect": "catalog:",
3534 "node-pty": "^1.1.0",
3635 "open": "^10.1.0"
apps/web/package.json+2−3
@@ -1,12 +1,11 @@
11 {
22 "name": "@t3tools/web",
3− "version": "0.0.21",
3+ "version": "0.0.22",
44 "private": true,
55 "type": "module",
66 "scripts": {
77 "dev": "vite",
88 "build": "vite build",
9− "prepare": "effect-language-service patch",
109 "preview": "vite preview",
1110 "typecheck": "tsc --noEmit",
1211 "test": "vitest run --passWithNoTests",
@@ -23,7 +22,7 @@ · 10 unmodified lines
2322 "@formkit/auto-animate": "^0.9.0",
2423 "@legendapp/list": "3.0.0-beta.44",
2524 "@lexical/react": "^0.41.0",
26− "@pierre/diffs": "^1.1.0-beta.16",
25+ "@pierre/diffs": "catalog:",
2726 "@t3tools/client-runtime": "workspace:*",
2827 "@t3tools/contracts": "workspace:*",
2928 "@t3tools/shared": "workspace:*",
apps/web/src/components/DiffPanel.tsx+68−1
@@ -5,6 +5,7 @@ import { useNavigate, useParams, useSearch } from "@tanstack/react-router"; · 4 unmodified lines
55 import { scopeThreadRef } from "@t3tools/client-runtime";
66 import type { TurnId } from "@t3tools/contracts";
77 import {
8+ ChevronDownIcon,
89 ChevronLeftIcon,
910 ChevronRightIcon,
1011 Columns2Icon,
@@ -161,6 +162,21 @@ function buildFileDiffRenderKey(fileDiff: FileDiffMetadata): string { · 150 unmodified lines
161162 return fileDiff.cacheKey ?? `${fileDiff.prevName ?? "none"}:${fileDiff.name}`;
162163 }
163164
165+function getDiffCollapseIconClassName(fileDiff: FileDiffMetadata): string {
166+ switch (fileDiff.type) {
167+ case "new":
168+ return "text-[var(--diffs-addition-base)]";
169+ case "deleted":
170+ return "text-[var(--diffs-deletion-base)]";
171+ case "change":
172+ case "rename-pure":
173+ case "rename-changed":
174+ return "text-[var(--diffs-modified-base)]";
175+ default:
176+ return "text-muted-foreground/80";
177+ }
178+}
179+
164180 interface DiffPanelProps {
165181 mode?: DiffPanelMode;
166182 }
@@ -174,6 +190,9 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 7 unmodified lines
174190 const [diffRenderMode, setDiffRenderMode] = useState<DiffRenderMode>("stacked");
175191 const [diffWordWrap, setDiffWordWrap] = useState(settings.diffWordWrap);
176192 const [diffIgnoreWhitespace, setDiffIgnoreWhitespace] = useState(settings.diffIgnoreWhitespace);
193+ const [collapsedDiffFileKeys, setCollapsedDiffFileKeys] = useState<ReadonlySet<string>>(
194+ () => new Set(),
195+ );
177196 const patchViewportRef = useRef<HTMLDivElement>(null);
178197 const turnStripRef = useRef<HTMLDivElement>(null);
179198 const previousDiffOpenRef = useRef(false);
@@ -317,6 +336,19 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 137 unmodified lines
317336 );
318337 }, [renderablePatch]);
319338
339+ useEffect(() => {
340+ if (renderableFiles.length === 0) {
341+ setCollapsedDiffFileKeys((current) => (current.size === 0 ? current : new Set()));
342+ return;
343+ }
344+
345+ const visibleFileKeys = new Set(renderableFiles.map(buildFileDiffRenderKey));
346+ setCollapsedDiffFileKeys((current) => {
347+ const next = new Set([...current].filter((fileKey) => visibleFileKeys.has(fileKey)));
348+ return next.size === current.size ? current : next;
349+ });
350+ }, [renderableFiles]);
351+
320352 useEffect(() => {
321353 if (diffOpen && !previousDiffOpenRef.current) {
322354 setDiffWordWrap(settings.diffWordWrap);
@@ -346,6 +378,17 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 23 unmodified lines
346378 },
347379 [activeCwd],
348380 );
381+ const toggleDiffFileCollapsed = useCallback((fileKey: string) => {
382+ setCollapsedDiffFileKeys((current) => {
383+ const next = new Set(current);
384+ if (next.has(fileKey)) {
385+ next.delete(fileKey);
386+ } else {
387+ next.add(fileKey);
388+ }
389+ return next;
390+ });
391+ }, []);
349392
350393 const selectTurn = (turnId: TurnId) => {
351394 if (!activeThread) return;
@@ -620,11 +663,12 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 268 unmodified lines
620663 const filePath = resolveFileDiffPath(fileDiff);
621664 const fileKey = buildFileDiffRenderKey(fileDiff);
622665 const themedFileKey = `${fileKey}:${resolvedTheme}`;
666+ const collapsed = collapsedDiffFileKeys.has(fileKey);
623667 return (
624668 <div
625669 key={themedFileKey}
626670 data-diff-file-path={filePath}
627− className="diff-render-file mb-2 rounded-md first:mt-2 last:mb-0"
671+ className="diff-render-file group/diff-file mb-2 rounded-md first:mt-2 last:mb-0"
628672 onClickCapture={(event) => {
629673 const nativeEvent = event.nativeEvent as MouseEvent;
630674 const composedPath = nativeEvent.composedPath?.() ?? [];
@@ -638,7 +682,30 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 7 unmodified lines
638682 >
639683 <FileDiff
640684 fileDiff={fileDiff}
685+ renderHeaderPrefix={() => (
686+ <button
687+ type="button"
688+ className={cn(
689+ "inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 transition-colors hover:bg-foreground/10 focus-visible:outline-hidden",
690+ getDiffCollapseIconClassName(fileDiff),
691+ )}
692+ aria-label={collapsed ? `Expand ${filePath}` : `Collapse ${filePath}`}
693+ aria-expanded={!collapsed}
694+ title={collapsed ? "Expand diff" : "Collapse diff"}
695+ onClick={(event) => {
696+ event.stopPropagation();
697+ toggleDiffFileCollapsed(fileKey);
698+ }}
699+ >
700+ {collapsed ? (
701+ <ChevronRightIcon className="size-4" />
702+ ) : (
703+ <ChevronDownIcon className="size-4" />
704+ )}
705+ </button>
706+ )}
641707 options={{
708+ collapsed,
642709 diffStyle: diffRenderMode === "split" ? "split" : "unified",
643710 lineDiffType: "none",
644711 overflow: diffWordWrap ? "wrap" : "scroll",
apps/web/src/routes/_chat.$environmentId.$threadId.tsx+1−1
@@ -28,7 +28,7 @@ const DiffPanel = lazy(() => import("../components/DiffPanel")); · 27 unmodified lines
2828 const DIFF_INLINE_SIDEBAR_WIDTH_STORAGE_KEY = "chat_diff_sidebar_width";
2929 const DIFF_INLINE_DEFAULT_WIDTH = "clamp(24rem,34vw,36rem)";
3030 const DIFF_INLINE_SIDEBAR_MIN_WIDTH = 22 * 16;
31−const DIFF_INLINE_SIDEBAR_MAX_WIDTH = 36 * 16;
31+const DIFF_INLINE_SIDEBAR_MAX_WIDTH = 256 * 16;
3232 const COMPOSER_COMPACT_MIN_LEFT_CONTROLS_WIDTH_PX = 208;
3333
3434 const DiffLoadingFallback = (props: { mode: DiffPanelMode }) => {
bun.lock+6−3
@@ -5,10 +5,12 @@ · 4 unmodified lines
55 "": {
66 "name": "@t3tools/monorepo",
77 "devDependencies": {
8+ "@effect/language-service": "catalog:",
89 "@types/node": "catalog:",
910 "oxfmt": "^0.40.0",
1011 "oxlint": "^1.55.0",
1112 "turbo": "^2.3.3",
13+ "typescript": "catalog:",
1214 "vitest": "catalog:",
1315 },
1416 },
@@ -124,7 +126,7 @@ · 109 unmodified lines
124126 "@effect/platform-node": "catalog:",
125127 "@effect/sql-sqlite-bun": "catalog:",
126128 "@opencode-ai/sdk": "^1.3.15",
127− "@pierre/diffs": "^1.1.0-beta.16",
129+ "@pierre/diffs": "catalog:",
128130 "effect": "catalog:",
129131 "node-pty": "^1.1.0",
130132 "open": "^10.1.0",
@@ -158,7 +160,7 @@ · 27 unmodified lines
158160 "@formkit/auto-animate": "^0.9.0",
159161 "@legendapp/list": "3.0.0-beta.44",
160162 "@lexical/react": "^0.41.0",
161− "@pierre/diffs": "^1.1.0-beta.16",
163+ "@pierre/diffs": "catalog:",
162164 "@t3tools/client-runtime": "workspace:*",
163165 "@t3tools/contracts": "workspace:*",
164166 "@t3tools/shared": "workspace:*",
@@ -348,6 +350,7 @@ · 183 unmodified lines
348350 "@effect/platform-node-shared": "4.0.0-beta.59",
349351 "@effect/sql-sqlite-bun": "4.0.0-beta.59",
350352 "@effect/vitest": "4.0.0-beta.59",
353+ "@pierre/diffs": "1.1.20",
351354 "@types/bun": "^1.3.11",
352355 "@types/node": "^24.10.13",
353356 "effect": "4.0.0-beta.59",
@@ -998,7 +1001,7 @@ · 644 unmodified lines
9981001
9991002 "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.60.0", "", { "os": "win32", "cpu": "x64" }, "sha512-JOro4ZcfBLamJCyfURQmOQByoorgOdx3ZjAkSqnb/CyG/i+lN3KoV5LAgk5ZAW6DPq7/Cx7n23f8DuTWXTWgyQ=="],
10001003
1001− "@pierre/diffs": ["@pierre/diffs@1.1.15", "", { "dependencies": { "@pierre/theme": "0.0.28", "@shikijs/transformers": "^3.0.0", "diff": "8.0.3", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-Gj863E+aSpc0H3C4cH0fQTaF/tP9yYfhnilR7/dS72qq8thqNpR3fo3jURHRtRKz6KJJ10anxcurHP7b3ZUQkw=="],
1004+ "@pierre/diffs": ["@pierre/diffs@1.1.20", "", { "dependencies": { "@pierre/theme": "0.0.28", "@shikijs/transformers": "^3.0.0", "diff": "8.0.3", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-lLi+3sLCm3QDd5/aLO9pw+WbF6UzhrkWm2oTZ5WZJTGemOyUNRJ4DDhcEKmVusu4C4bXx9Nssh6fF+wQcapb5w=="],
10021005
10031006 "@pierre/theme": ["@pierre/theme@0.0.28", "", {}, "sha512-1j/H/fECBuc9dEvntdWI+l435HZapw+RCJTlqCA6BboQ5TjlnE005j/ROWutXIs8aq5OAc82JI2Kwk4A1WWBgw=="],
10041007
package.json+4−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 "@effect/sql-sqlite-bun": "4.0.0-beta.59",
1818 "@effect/vitest": "4.0.0-beta.59",
1919 "@effect/language-service": "0.84.2",
20+ "@pierre/diffs": "1.1.20",
2021 "@types/bun": "^1.3.11",
2122 "@types/node": "^24.10.13",
2223 "tsdown": "^0.20.3",
@@ -27,6 +28,7 @@ · 4 unmodified lines
2728 "type": "module",
2829 "scripts": {
2930 "postinstall": "node scripts/patch-expo-dev-launcher.mjs && node scripts/patch-react-native-nitro-modules.mjs && node scripts/patch-pierre-diffs-utils.mjs",
31+ "prepare": "effect-language-service patch",
3032 "dev": "node scripts/dev-runner.ts dev",
3133 "dev:server": "node scripts/dev-runner.ts dev:server",
3234 "dev:web": "node scripts/dev-runner.ts dev:web",
@@ -60,10 +62,12 @@ · 27 unmodified lines
6062 "sync:vscode-icons": "node scripts/sync-vscode-icons.mjs"
6163 },
6264 "devDependencies": {
65+ "@effect/language-service": "catalog:",
6366 "@types/node": "catalog:",
6467 "oxfmt": "^0.40.0",
6568 "oxlint": "^1.55.0",
6669 "turbo": "^2.3.3",
70+ "typescript": "catalog:",
6771 "vitest": "catalog:"
6872 },
6973 "overrides": {
packages/client-runtime/package.json+0−1
@@ -15,7 +15,6 @@ · 14 unmodified lines
1515 }
1616 },
1717 "scripts": {
18− "prepare": "effect-language-service patch",
1918 "typecheck": "tsc --noEmit",
2019 "test": "vitest run"
2120 },
packages/contracts/package.json+1−2
@@ -1,6 +1,6 @@
11 {
22 "name": "@t3tools/contracts",
3− "version": "0.0.21",
3+ "version": "0.0.22",
44 "private": true,
55 "files": [
66 "dist"
@@ -24,7 +24,6 @@ · 17 unmodified lines
2424 "scripts": {
2525 "dev": "tsdown src/index.ts --format esm,cjs --dts --watch --clean",
2626 "build": "tsdown src/index.ts --format esm,cjs --dts --clean",
27− "prepare": "effect-language-service patch",
2827 "typecheck": "tsc --noEmit",
2928 "test": "vitest run"
3029 },
packages/effect-acp/package.json+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 "scripts": {
3636 "dev": "tsdown src/client.ts src/agent.ts src/_generated/schema.gen.ts src/rpc.ts src/protocol.ts src/terminal.ts --format esm,cjs --dts --watch --clean",
3737 "build": "tsdown src/client.ts src/agent.ts src/_generated/schema.gen.ts src/rpc.ts src/protocol.ts src/terminal.ts --format esm,cjs --dts --clean",
38− "prepare": "effect-language-service patch",
3938 "typecheck": "tsc --noEmit",
4039 "test": "vitest run",
4140 "generate": "bun run scripts/generate.ts"
packages/effect-codex-app-server/package.json+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 "scripts": {
2828 "dev": "tsdown src/client.ts src/rpc.ts src/protocol.ts src/schema.ts --format esm,cjs --dts --watch --clean",
2929 "build": "tsdown src/client.ts src/rpc.ts src/protocol.ts src/schema.ts --format esm,cjs --dts --clean",
30− "prepare": "effect-language-service patch",
3130 "typecheck": "tsc --noEmit",
3231 "test": "vitest run",
3332 "generate": "bun run scripts/generate.ts",
packages/shared/package.json+0−1
@@ -98,7 +98,6 @@ · 97 unmodified lines
9898 }
9999 },
100100 "scripts": {
101− "prepare": "effect-language-service patch",
102101 "typecheck": "tsc --noEmit",
103102 "test": "vitest run"
104103 },
packages/ssh/package.json+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 }
2727 },
2828 "scripts": {
29− "prepare": "effect-language-service patch",
3029 "typecheck": "tsc --noEmit",
3130 "test": "vitest run"
3231 },
packages/tailscale/package.json+0−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 }
1111 },
1212 "scripts": {
13− "prepare": "effect-language-service patch",
1413 "typecheck": "tsc --noEmit",
1514 "test": "vitest run"
1615 },
scripts/package.json+0−1
@@ -3,7 +3,6 @@ · 2 unmodified lines
33 "private": true,
44 "type": "module",
55 "scripts": {
6− "prepare": "effect-language-service patch",
76 "typecheck": "tsc --noEmit",
87 "test": "vitest run"
98 },
scripts/release-smoke.ts+2−0
@@ -197,6 +197,8 @@ try { · 196 unmodified lines
197197 },
198198 );
199199
200+ rmSync(resolve(tempRoot, "bun.lock"), { force: true });
201+
200202 execFileSync("bun", ["install", "--ignore-scripts"], {
201203 cwd: tempRoot,
202204 stdio: "inherit",