Improve thread composer focus behavior

This commit is contained in:
Theo Browne committed 2026-02-13 16:29:27 -08:00
1 parent 9e3fa3e67f
commit 54e7dd96f7
3 files changed
+12 -13

No files matched your search

+2
View File
@@ -12,3 +12,5 @@
- [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)
- [ ] Insta focus input on new thread creation
- [ ] Disable "streaming" (wait until whole paragraph/step finishes before showing it
- [ ] Making new thread should auto-focus input box
- [ ] Threads should be scrolled to bottom on open (they currently start near top and "scroll down" after rendering, it's jank)
+10
View File
@@ -357,6 +357,16 @@ export default function ChatView() {
setExpandedWorkGroups({});
}, [activeThread?.id]);
useEffect(() => {
if (!activeThread?.id || activeThread.terminalOpen) return;
const frame = window.requestAnimationFrame(() => {
focusComposer();
});
return () => {
window.cancelAnimationFrame(frame);
};
}, [activeThread?.id, activeThread?.terminalOpen, focusComposer]);
useEffect(() => {
composerImagesRef.current = composerImages;
}, [composerImages]);
-13
View File
@@ -328,19 +328,6 @@ export default function Sidebar() {
event.key.toLowerCase() === "o";
if (!isNewThreadShortcut) return;
const target = event.target;
if (target instanceof HTMLElement) {
const tagName = target.tagName;
if (
target.isContentEditable ||
tagName === "INPUT" ||
tagName === "TEXTAREA" ||
tagName === "SELECT"
) {
return;
}
}
const activeThread = state.threads.find((t) => t.id === state.activeThreadId);
const projectId = activeThread?.projectId ?? state.projects[0]?.id;
if (!projectId) return;