authorgravatar for me@t3.ggTheo Browne <me@t3.gg> 2026-02-13 16:29:27-08:00
committergravatar for me@t3.ggTheo Browne <me@t3.gg> 2026-02-13 16:29:27-08:00
log54e7dd96f73163a46f5ee6d0db652a7c55ee1d41
tree5b2e29c8287910ae79c9d354cd943b8935daa0d4
parent9e3fa3e67f1642f43b89f6260b5b93d4295344b0
signature Commit is signed but in an unrecognized format.

Improve thread composer focus behavior


3 files changed, 12 insertions(+), 13 deletions(-)

TODO.md+2
...@@ -12,3 +12,5 @@...@@ -12,3 +12,5 @@
12- [x] Reduce noise of tool calls (combine "command run" and "command completed", make tool calls a "box" with limited # of calls shown at a time, etc)12- [x] Reduce noise of tool calls (combine "command run" and "command completed", make tool calls a "box" with limited # of calls shown at a time, etc)
13- [ ] Insta focus input on new thread creation13- [ ] Insta focus input on new thread creation
14- [ ] Disable "streaming" (wait until whole paragraph/step finishes before showing it14- [ ] Disable "streaming" (wait until whole paragraph/step finishes before showing it
15- [ ] Making new thread should auto-focus input box
16- [ ] Threads should be scrolled to bottom on open (they currently start near top and "scroll down" after rendering, it's jank)
apps/web/src/components/ChatView.tsx+10
...@@ -357,6 +357,16 @@ export default function ChatView() {...@@ -357,6 +357,16 @@ export default function ChatView() {
357 setExpandedWorkGroups({});357 setExpandedWorkGroups({});
358 }, [activeThread?.id]);358 }, [activeThread?.id]);
359359
360 useEffect(() => {
361 if (!activeThread?.id || activeThread.terminalOpen) return;
362 const frame = window.requestAnimationFrame(() => {
363 focusComposer();
364 });
365 return () => {
366 window.cancelAnimationFrame(frame);
367 };
368 }, [activeThread?.id, activeThread?.terminalOpen, focusComposer]);
369
360 useEffect(() => {370 useEffect(() => {
361 composerImagesRef.current = composerImages;371 composerImagesRef.current = composerImages;
362 }, [composerImages]);372 }, [composerImages]);
apps/web/src/components/Sidebar.tsx-13
...@@ -328,19 +328,6 @@ export default function Sidebar() {...@@ -328,19 +328,6 @@ export default function Sidebar() {
328 event.key.toLowerCase() === "o";328 event.key.toLowerCase() === "o";
329 if (!isNewThreadShortcut) return;329 if (!isNewThreadShortcut) return;
330330
331 const target = event.target;
332 if (target instanceof HTMLElement) {
333 const tagName = target.tagName;
334 if (
335 target.isContentEditable ||
336 tagName === "INPUT" ||
337 tagName === "TEXTAREA" ||
338 tagName === "SELECT"
339 ) {
340 return;
341 }
342 }
343
344 const activeThread = state.threads.find((t) => t.id === state.activeThreadId);331 const activeThread = state.threads.find((t) => t.id === state.activeThreadId);
345 const projectId = activeThread?.projectId ?? state.projects[0]?.id;332 const projectId = activeThread?.projectId ?? state.projects[0]?.id;
346 if (!projectId) return;333 if (!projectId) return;