Improve thread composer focus behavior
This commit is contained in:
3 files changed
+12
-13
No files matched your search
@@ -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)
|
||||
@@ -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]);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user