fix(web): preserve search focus behavior

This commit is contained in:
Sybil Agent
2026-11-04 12:35:25 -08:00
parent b9ff0a795c
commit e9967ddaf8
2 changed files with 173 additions and 2 deletions
+4 -2
View File
@@ -1619,6 +1619,7 @@ export default function App() {
useEffect(() => {
if (isActiveSelectionSending) return;
if (isSearchMode) return;
const hasWorkspaceSelection = Boolean(selectedItem) || draftKind !== null;
if (!hasWorkspaceSelection) return;
const mobileLayout = isMobileLayout();
@@ -1628,7 +1629,7 @@ export default function App() {
}
suppressNextMobileComposerFocusRef.current = false;
focusComposer();
}, [draftKind, isActiveSelectionSending, selectedKey]);
}, [draftKind, isActiveSelectionSending, isSearchMode, selectedKey]);
useEffect(() => {
return () => {
@@ -1927,6 +1928,7 @@ export default function App() {
setIsChatSettingsOpen(false);
setChatSettingsError(null);
setIsMobileSidebarOpen(false);
focusComposer();
};
const selectAdjacentSidebarItem = (direction: -1 | 1) => {
@@ -3448,7 +3450,7 @@ export default function App() {
}
} finally {
const shouldSuppressMobileChatFocus = sentTarget?.kind === "chat" && isMobileLayout();
if ((!sentTarget || isCurrentSelection(sentTarget)) && !shouldSuppressMobileChatFocus) {
if ((!sentTarget || isCurrentSelection(sentTarget)) && !sentAsSearch && !shouldSuppressMobileChatFocus) {
focusComposer();
}
}