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 22, 19:30 UTC
test(web): chat shortcut test types through the composer handle (#23126)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 21, 2026 at 15:47 UTC
bd6940beab9e04a843d711fca812067c22991ab4
1 file changed
+10
-3
apps/web/src/components/chat/useChatShortcuts.browser.test.tsx
+10
-3
@@ -3,6 +3,7 @@ import { expect, it } from "vite-plus/test";
3
import { userEvent } from "vite-plus/test/browser";
4
5
import { render } from "../../../test/render";
6
+import type { ChatComposerHandle } from "./ChatComposer";
7
import { useChatShortcuts } from "./useChatShortcuts";
8
9
const shortcutContext = {
@@ -50,10 +51,16 @@ function Chat(props: { composerKeys: string[]; launcher?: { keys: string; receiv
51
scriptKeybindings: [],
52
getShortcutContext: () => shortcutContext,
53
threadFindActive: false,
53
- typeIntoComposer: (key) => {
54
- props.composerKeys.push(key);
55
- return true;
54
+ // Type-to-focus only calls insertTextAtEnd, so the stand-in composer implements just that.
55
+ composerRef: {
56
+ current: {
57
+ insertTextAtEnd: (key: string) => {
58
+ props.composerKeys.push(key);
59
+ return true;
60
+ },
61
+ } as Partial<ChatComposerHandle> as ChatComposerHandle,
62
},
63
+ branchToolbarRef: { current: null },
64
closeThreadFind: () => {},
65
commands: {},
66
fallback: () => undefined,