Unified · Split
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "@t3tools/desktop", |
| 3 | − "version": "0.0.21", | |
| 3 | + "version": "0.0.22", | |
| 4 | 4 | "private": true, |
| 5 | 5 | "type": "module", |
| 6 | 6 | "main": "dist-electron/main.cjs", |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "t3", |
| 3 | − "version": "0.0.21", | |
| 3 | + "version": "0.0.22", | |
| 4 | 4 | "license": "MIT", |
| 5 | 5 | "repository": { |
| 6 | 6 | "type": "git", |
| @@ -19,7 +19,6 @@ · 12 unmodified lines | ||
| 19 | 19 | "build": "node scripts/cli.ts build", |
| 20 | 20 | "build:bundle": "tsdown", |
| 21 | 21 | "start": "node dist/bin.mjs", |
| 22 | − "prepare": "effect-language-service patch", | |
| 23 | 22 | "typecheck": "tsc --noEmit", |
| 24 | 23 | "test": "vitest run", |
| 25 | 24 | "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 | ||
| 30 | 29 | "@effect/platform-node": "catalog:", |
| 31 | 30 | "@effect/sql-sqlite-bun": "catalog:", |
| 32 | 31 | "@opencode-ai/sdk": "^1.3.15", |
| 33 | − "@pierre/diffs": "^1.1.0-beta.16", | |
| 32 | + "@pierre/diffs": "catalog:", | |
| 34 | 33 | "effect": "catalog:", |
| 35 | 34 | "node-pty": "^1.1.0", |
| 36 | 35 | "open": "^10.1.0" |
| @@ -1,12 +1,11 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "@t3tools/web", |
| 3 | − "version": "0.0.21", | |
| 3 | + "version": "0.0.22", | |
| 4 | 4 | "private": true, |
| 5 | 5 | "type": "module", |
| 6 | 6 | "scripts": { |
| 7 | 7 | "dev": "vite", |
| 8 | 8 | "build": "vite build", |
| 9 | − "prepare": "effect-language-service patch", | |
| 10 | 9 | "preview": "vite preview", |
| 11 | 10 | "typecheck": "tsc --noEmit", |
| 12 | 11 | "test": "vitest run --passWithNoTests", |
| @@ -23,7 +22,7 @@ · 10 unmodified lines | ||
| 23 | 22 | "@formkit/auto-animate": "^0.9.0", |
| 24 | 23 | "@legendapp/list": "3.0.0-beta.44", |
| 25 | 24 | "@lexical/react": "^0.41.0", |
| 26 | − "@pierre/diffs": "^1.1.0-beta.16", | |
| 25 | + "@pierre/diffs": "catalog:", | |
| 27 | 26 | "@t3tools/client-runtime": "workspace:*", |
| 28 | 27 | "@t3tools/contracts": "workspace:*", |
| 29 | 28 | "@t3tools/shared": "workspace:*", |
| @@ -5,6 +5,7 @@ import { useNavigate, useParams, useSearch } from "@tanstack/react-router"; · 4 unmodified lines | ||
| 5 | 5 | import { scopeThreadRef } from "@t3tools/client-runtime"; |
| 6 | 6 | import type { TurnId } from "@t3tools/contracts"; |
| 7 | 7 | import { |
| 8 | + ChevronDownIcon, | |
| 8 | 9 | ChevronLeftIcon, |
| 9 | 10 | ChevronRightIcon, |
| 10 | 11 | Columns2Icon, |
| @@ -161,6 +162,21 @@ function buildFileDiffRenderKey(fileDiff: FileDiffMetadata): string { · 150 unmodified lines | ||
| 161 | 162 | return fileDiff.cacheKey ?? `${fileDiff.prevName ?? "none"}:${fileDiff.name}`; |
| 162 | 163 | } |
| 163 | 164 | |
| 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 | + | |
| 164 | 180 | interface DiffPanelProps { |
| 165 | 181 | mode?: DiffPanelMode; |
| 166 | 182 | } |
| @@ -174,6 +190,9 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 7 unmodified lines | ||
| 174 | 190 | const [diffRenderMode, setDiffRenderMode] = useState<DiffRenderMode>("stacked"); |
| 175 | 191 | const [diffWordWrap, setDiffWordWrap] = useState(settings.diffWordWrap); |
| 176 | 192 | const [diffIgnoreWhitespace, setDiffIgnoreWhitespace] = useState(settings.diffIgnoreWhitespace); |
| 193 | + const [collapsedDiffFileKeys, setCollapsedDiffFileKeys] = useState<ReadonlySet<string>>( | |
| 194 | + () => new Set(), | |
| 195 | + ); | |
| 177 | 196 | const patchViewportRef = useRef<HTMLDivElement>(null); |
| 178 | 197 | const turnStripRef = useRef<HTMLDivElement>(null); |
| 179 | 198 | const previousDiffOpenRef = useRef(false); |
| @@ -317,6 +336,19 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 137 unmodified lines | ||
| 317 | 336 | ); |
| 318 | 337 | }, [renderablePatch]); |
| 319 | 338 | |
| 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 | + | |
| 320 | 352 | useEffect(() => { |
| 321 | 353 | if (diffOpen && !previousDiffOpenRef.current) { |
| 322 | 354 | setDiffWordWrap(settings.diffWordWrap); |
| @@ -346,6 +378,17 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 23 unmodified lines | ||
| 346 | 378 | }, |
| 347 | 379 | [activeCwd], |
| 348 | 380 | ); |
| 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 | + }, []); | |
| 349 | 392 | |
| 350 | 393 | const selectTurn = (turnId: TurnId) => { |
| 351 | 394 | if (!activeThread) return; |
| @@ -620,11 +663,12 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 268 unmodified lines | ||
| 620 | 663 | const filePath = resolveFileDiffPath(fileDiff); |
| 621 | 664 | const fileKey = buildFileDiffRenderKey(fileDiff); |
| 622 | 665 | const themedFileKey = `${fileKey}:${resolvedTheme}`; |
| 666 | + const collapsed = collapsedDiffFileKeys.has(fileKey); | |
| 623 | 667 | return ( |
| 624 | 668 | <div |
| 625 | 669 | key={themedFileKey} |
| 626 | 670 | 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" | |
| 628 | 672 | onClickCapture={(event) => { |
| 629 | 673 | const nativeEvent = event.nativeEvent as MouseEvent; |
| 630 | 674 | const composedPath = nativeEvent.composedPath?.() ?? []; |
| @@ -638,7 +682,30 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { · 7 unmodified lines | ||
| 638 | 682 | > |
| 639 | 683 | <FileDiff |
| 640 | 684 | 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 | + )} | |
| 641 | 707 | options={{ |
| 708 | + collapsed, | |
| 642 | 709 | diffStyle: diffRenderMode === "split" ? "split" : "unified", |
| 643 | 710 | lineDiffType: "none", |
| 644 | 711 | overflow: diffWordWrap ? "wrap" : "scroll", |
| @@ -28,7 +28,7 @@ const DiffPanel = lazy(() => import("../components/DiffPanel")); · 27 unmodified lines | ||
| 28 | 28 | const DIFF_INLINE_SIDEBAR_WIDTH_STORAGE_KEY = "chat_diff_sidebar_width"; |
| 29 | 29 | const DIFF_INLINE_DEFAULT_WIDTH = "clamp(24rem,34vw,36rem)"; |
| 30 | 30 | 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; | |
| 32 | 32 | const COMPOSER_COMPACT_MIN_LEFT_CONTROLS_WIDTH_PX = 208; |
| 33 | 33 | |
| 34 | 34 | const DiffLoadingFallback = (props: { mode: DiffPanelMode }) => { |
| @@ -5,10 +5,12 @@ · 4 unmodified lines | ||
| 5 | 5 | "": { |
| 6 | 6 | "name": "@t3tools/monorepo", |
| 7 | 7 | "devDependencies": { |
| 8 | + "@effect/language-service": "catalog:", | |
| 8 | 9 | "@types/node": "catalog:", |
| 9 | 10 | "oxfmt": "^0.40.0", |
| 10 | 11 | "oxlint": "^1.55.0", |
| 11 | 12 | "turbo": "^2.3.3", |
| 13 | + "typescript": "catalog:", | |
| 12 | 14 | "vitest": "catalog:", |
| 13 | 15 | }, |
| 14 | 16 | }, |
| @@ -124,7 +126,7 @@ · 109 unmodified lines | ||
| 124 | 126 | "@effect/platform-node": "catalog:", |
| 125 | 127 | "@effect/sql-sqlite-bun": "catalog:", |
| 126 | 128 | "@opencode-ai/sdk": "^1.3.15", |
| 127 | − "@pierre/diffs": "^1.1.0-beta.16", | |
| 129 | + "@pierre/diffs": "catalog:", | |
| 128 | 130 | "effect": "catalog:", |
| 129 | 131 | "node-pty": "^1.1.0", |
| 130 | 132 | "open": "^10.1.0", |
| @@ -158,7 +160,7 @@ · 27 unmodified lines | ||
| 158 | 160 | "@formkit/auto-animate": "^0.9.0", |
| 159 | 161 | "@legendapp/list": "3.0.0-beta.44", |
| 160 | 162 | "@lexical/react": "^0.41.0", |
| 161 | − "@pierre/diffs": "^1.1.0-beta.16", | |
| 163 | + "@pierre/diffs": "catalog:", | |
| 162 | 164 | "@t3tools/client-runtime": "workspace:*", |
| 163 | 165 | "@t3tools/contracts": "workspace:*", |
| 164 | 166 | "@t3tools/shared": "workspace:*", |
| @@ -348,6 +350,7 @@ · 183 unmodified lines | ||
| 348 | 350 | "@effect/platform-node-shared": "4.0.0-beta.59", |
| 349 | 351 | "@effect/sql-sqlite-bun": "4.0.0-beta.59", |
| 350 | 352 | "@effect/vitest": "4.0.0-beta.59", |
| 353 | + "@pierre/diffs": "1.1.20", | |
| 351 | 354 | "@types/bun": "^1.3.11", |
| 352 | 355 | "@types/node": "^24.10.13", |
| 353 | 356 | "effect": "4.0.0-beta.59", |
| @@ -998,7 +1001,7 @@ · 644 unmodified lines | ||
| 998 | 1001 | |
| 999 | 1002 | "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.60.0", "", { "os": "win32", "cpu": "x64" }, "sha512-JOro4ZcfBLamJCyfURQmOQByoorgOdx3ZjAkSqnb/CyG/i+lN3KoV5LAgk5ZAW6DPq7/Cx7n23f8DuTWXTWgyQ=="], |
| 1000 | 1003 | |
| 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=="], | |
| 1002 | 1005 | |
| 1003 | 1006 | "@pierre/theme": ["@pierre/theme@0.0.28", "", {}, "sha512-1j/H/fECBuc9dEvntdWI+l435HZapw+RCJTlqCA6BboQ5TjlnE005j/ROWutXIs8aq5OAc82JI2Kwk4A1WWBgw=="], |
| 1004 | 1007 | |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | "@effect/sql-sqlite-bun": "4.0.0-beta.59", |
| 18 | 18 | "@effect/vitest": "4.0.0-beta.59", |
| 19 | 19 | "@effect/language-service": "0.84.2", |
| 20 | + "@pierre/diffs": "1.1.20", | |
| 20 | 21 | "@types/bun": "^1.3.11", |
| 21 | 22 | "@types/node": "^24.10.13", |
| 22 | 23 | "tsdown": "^0.20.3", |
| @@ -27,6 +28,7 @@ · 4 unmodified lines | ||
| 27 | 28 | "type": "module", |
| 28 | 29 | "scripts": { |
| 29 | 30 | "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", | |
| 30 | 32 | "dev": "node scripts/dev-runner.ts dev", |
| 31 | 33 | "dev:server": "node scripts/dev-runner.ts dev:server", |
| 32 | 34 | "dev:web": "node scripts/dev-runner.ts dev:web", |
| @@ -60,10 +62,12 @@ · 27 unmodified lines | ||
| 60 | 62 | "sync:vscode-icons": "node scripts/sync-vscode-icons.mjs" |
| 61 | 63 | }, |
| 62 | 64 | "devDependencies": { |
| 65 | + "@effect/language-service": "catalog:", | |
| 63 | 66 | "@types/node": "catalog:", |
| 64 | 67 | "oxfmt": "^0.40.0", |
| 65 | 68 | "oxlint": "^1.55.0", |
| 66 | 69 | "turbo": "^2.3.3", |
| 70 | + "typescript": "catalog:", | |
| 67 | 71 | "vitest": "catalog:" |
| 68 | 72 | }, |
| 69 | 73 | "overrides": { |
| @@ -15,7 +15,6 @@ · 14 unmodified lines | ||
| 15 | 15 | } |
| 16 | 16 | }, |
| 17 | 17 | "scripts": { |
| 18 | − "prepare": "effect-language-service patch", | |
| 19 | 18 | "typecheck": "tsc --noEmit", |
| 20 | 19 | "test": "vitest run" |
| 21 | 20 | }, |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "@t3tools/contracts", |
| 3 | − "version": "0.0.21", | |
| 3 | + "version": "0.0.22", | |
| 4 | 4 | "private": true, |
| 5 | 5 | "files": [ |
| 6 | 6 | "dist" |
| @@ -24,7 +24,6 @@ · 17 unmodified lines | ||
| 24 | 24 | "scripts": { |
| 25 | 25 | "dev": "tsdown src/index.ts --format esm,cjs --dts --watch --clean", |
| 26 | 26 | "build": "tsdown src/index.ts --format esm,cjs --dts --clean", |
| 27 | − "prepare": "effect-language-service patch", | |
| 28 | 27 | "typecheck": "tsc --noEmit", |
| 29 | 28 | "test": "vitest run" |
| 30 | 29 | }, |
| @@ -35,7 +35,6 @@ · 34 unmodified lines | ||
| 35 | 35 | "scripts": { |
| 36 | 36 | "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", |
| 37 | 37 | "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", | |
| 39 | 38 | "typecheck": "tsc --noEmit", |
| 40 | 39 | "test": "vitest run", |
| 41 | 40 | "generate": "bun run scripts/generate.ts" |
| @@ -27,7 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | "scripts": { |
| 28 | 28 | "dev": "tsdown src/client.ts src/rpc.ts src/protocol.ts src/schema.ts --format esm,cjs --dts --watch --clean", |
| 29 | 29 | "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", | |
| 31 | 30 | "typecheck": "tsc --noEmit", |
| 32 | 31 | "test": "vitest run", |
| 33 | 32 | "generate": "bun run scripts/generate.ts", |
| @@ -98,7 +98,6 @@ · 97 unmodified lines | ||
| 98 | 98 | } |
| 99 | 99 | }, |
| 100 | 100 | "scripts": { |
| 101 | − "prepare": "effect-language-service patch", | |
| 102 | 101 | "typecheck": "tsc --noEmit", |
| 103 | 102 | "test": "vitest run" |
| 104 | 103 | }, |
| @@ -26,7 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | } |
| 27 | 27 | }, |
| 28 | 28 | "scripts": { |
| 29 | − "prepare": "effect-language-service patch", | |
| 30 | 29 | "typecheck": "tsc --noEmit", |
| 31 | 30 | "test": "vitest run" |
| 32 | 31 | }, |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | } |
| 11 | 11 | }, |
| 12 | 12 | "scripts": { |
| 13 | − "prepare": "effect-language-service patch", | |
| 14 | 13 | "typecheck": "tsc --noEmit", |
| 15 | 14 | "test": "vitest run" |
| 16 | 15 | }, |
| @@ -3,7 +3,6 @@ · 2 unmodified lines | ||
| 3 | 3 | "private": true, |
| 4 | 4 | "type": "module", |
| 5 | 5 | "scripts": { |
| 6 | − "prepare": "effect-language-service patch", | |
| 7 | 6 | "typecheck": "tsc --noEmit", |
| 8 | 7 | "test": "vitest run" |
| 9 | 8 | }, |
| @@ -197,6 +197,8 @@ try { · 196 unmodified lines | ||
| 197 | 197 | }, |
| 198 | 198 | ); |
| 199 | 199 | |
| 200 | + rmSync(resolve(tempRoot, "bun.lock"), { force: true }); | |
| 201 | + | |
| 200 | 202 | execFileSync("bun", ["install", "--ignore-scripts"], { |
| 201 | 203 | cwd: tempRoot, |
| 202 | 204 | stdio: "inherit", |