@devries-cameron20 / t3code Mirror · read-only / commits / 326595b148
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 11:00 UTC

Add Vitest to web app and remove unused composer/env props

- add `vitest` to `apps/web` devDependencies and lockfile - remove unused `envMode` prop from `BranchToolbar` usage and signature - drop unused composer command input ref in `ChatView`

Julius Marminge committed Mar 3, 2026 at 14:49 UTC 326595b148e410174e79c9a6e7f63006478ffaf6
4 files changed +34 -29
apps/web/package.json
+2 -1
@@ -44,6 +44,7 @@
44 "babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
45 "tailwindcss": "^4.0.0",
46 "typescript": "catalog:",
47 - "vite": "^8.0.0-beta.12"
47 + "vite": "^8.0.0-beta.12",
48 + "vitest": "catalog:"
49 }
50 }
apps/web/src/components/BranchToolbar.tsx
-2
@@ -15,7 +15,6 @@ import { Button } from "./ui/button";
15
16 interface BranchToolbarProps {
17 threadId: ThreadId;
18 - envMode: EnvMode;
18 onEnvModeChange: (mode: EnvMode) => void;
19 envLocked: boolean;
20 onComposerFocusRequest?: () => void;
@@ -23,7 +22,6 @@ interface BranchToolbarProps {
22
23 export default function BranchToolbar({
24 threadId,
26 - envMode,
25 onEnvModeChange,
26 envLocked,
27 onComposerFocusRequest,
apps/web/src/components/ChatView.tsx
+31 -26
@@ -524,7 +524,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
524 const pendingUserScrollUpIntentRef = useRef(false);
525 const pendingAutoScrollFrameRef = useRef<number | null>(null);
526 const composerEditorRef = useRef<ComposerPromptEditorHandle>(null);
527 - const composerCommandInputRef = useRef<HTMLInputElement>(null);
527 const composerFormRef = useRef<HTMLFormElement>(null);
528 const composerFormHeightRef = useRef(0);
529 const composerImagesRef = useRef<ComposerImageAttachment[]>([]);
@@ -633,7 +632,8 @@ export default function ChatView({ threadId }: ChatViewProps) {
632 [selectedModel, settings.customCodexModels],
633 );
634 const slashModelOptions = useMemo(
636 - () => getSlashModelOptions(settings.customCodexModels, composerTrigger?.query ?? "", selectedModel),
635 + () =>
636 + getSlashModelOptions(settings.customCodexModels, composerTrigger?.query ?? "", selectedModel),
637 [composerTrigger?.query, selectedModel, settings.customCodexModels],
638 );
639 const phase = derivePhase(activeThread?.session ?? null);
@@ -912,12 +912,12 @@ export default function ChatView({ threadId }: ChatViewProps) {
912 }
913
914 return slashModelOptions.map(({ slug, name }) => ({
915 - id: `model:${slug}`,
916 - type: "model" as const,
917 - model: slug,
918 - label: name,
919 - description: slug,
920 - }));
915 + id: `model:${slug}`,
916 + type: "model" as const,
917 + model: slug,
918 + label: name,
919 + description: slug,
920 + }));
921 }, [composerTrigger, slashModelOptions, workspaceEntries]);
922 const composerMenuOpen = Boolean(composerTrigger);
923 const activeComposerMenuItem = useMemo(
@@ -2312,12 +2312,9 @@ export default function ChatView({ threadId }: ChatViewProps) {
2312 return;
2313 }
2314 if (item.type === "slash-command") {
2315 - const applied = applyPromptReplacement(
2316 - trigger.rangeStart,
2317 - trigger.rangeEnd,
2318 - "/model ",
2319 - { expectedText: expectedToken },
2320 - );
2315 + const applied = applyPromptReplacement(trigger.rangeStart, trigger.rangeEnd, "/model ", {
2316 + expectedText: expectedToken,
2317 + });
2318 if (applied) {
2319 setComposerHighlightedItemId(null);
2320 }
@@ -2360,18 +2357,27 @@ export default function ChatView({ threadId }: ChatViewProps) {
2357 workspaceEntriesQuery.isLoading ||
2358 workspaceEntriesQuery.isFetching);
2359
2363 - const onPromptChange = useCallback((nextPrompt: string, nextCursor: number, cursorAdjacentToMention: boolean) => {
2364 - promptRef.current = nextPrompt;
2365 - setPrompt(nextPrompt);
2366 - setComposerCursor(nextCursor);
2367 - setComposerTrigger(
2368 - cursorAdjacentToMention
2369 - ? null
2370 - : detectComposerTrigger(nextPrompt, expandCollapsedComposerCursor(nextPrompt, nextCursor)),
2371 - );
2372 - }, [setPrompt]);
2360 + const onPromptChange = useCallback(
2361 + (nextPrompt: string, nextCursor: number, cursorAdjacentToMention: boolean) => {
2362 + promptRef.current = nextPrompt;
2363 + setPrompt(nextPrompt);
2364 + setComposerCursor(nextCursor);
2365 + setComposerTrigger(
2366 + cursorAdjacentToMention
2367 + ? null
2368 + : detectComposerTrigger(
2369 + nextPrompt,
2370 + expandCollapsedComposerCursor(nextPrompt, nextCursor),
2371 + ),
2372 + );
2373 + },
2374 + [setPrompt],
2375 + );
2376
2374 - const onComposerCommandKey = (key: "ArrowDown" | "ArrowUp" | "Enter" | "Tab", event: KeyboardEvent) => {
2377 + const onComposerCommandKey = (
2378 + key: "ArrowDown" | "ArrowUp" | "Enter" | "Tab",
2379 + event: KeyboardEvent,
2380 + ) => {
2381 const { trigger } = resolveActiveComposerTrigger();
2382 const menuIsActive = composerMenuOpenRef.current || trigger !== null;
2383
@@ -2778,7 +2784,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
2784 {isGitRepo && (
2785 <BranchToolbar
2786 threadId={activeThread.id}
2781 - envMode={envMode}
2787 onEnvModeChange={onEnvModeChange}
2788 envLocked={envLocked}
2789 onComposerFocusRequest={scheduleComposerFocus}
bun.lock
+1
@@ -95,6 +95,7 @@
95 "tailwindcss": "^4.0.0",
96 "typescript": "catalog:",
97 "vite": "^8.0.0-beta.12",
98 + "vitest": "catalog:",
99 },
100 },
101 "packages/contracts": {