Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix: focus search input if search is already open (#2431)

gbirman03771627c65d
diff --git a/js/app/packages/app/component/app-sidebar/sidebar.tsx b/js/app/packages/app/component/app-sidebar/sidebar.tsx
index e6d2815597..36bb6cbbb1 100644
--- a/js/app/packages/app/component/app-sidebar/sidebar.tsx
+++ b/js/app/packages/app/component/app-sidebar/sidebar.tsx
@@ -226,6 +226,27 @@ export const registerSidebarHotkeys = ({
resetHotkeysState();
debounceResetHotkeysState.clear();
}
+
+ if (link.id === 'search' && !e?.shiftKey) {
+ const activeSplit = globalSplitManager()?.activeSplit();
+ const content = activeSplit?.content();
+ if (
+ activeSplit &&
+ content?.type === 'component' &&
+ content.id === 'search'
+ ) {
+ const splitEl = document.querySelector(
+ `[data-split-id="${activeSplit.id}"]`
+ );
+ const searchInput =
+ splitEl?.querySelector<HTMLInputElement>('[data-soup-search]');
+ if (searchInput) {
+ searchInput.focus();
+ return true;
+ }
+ }
+ }
+
openWithSplit(
{
type: 'component',
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsx
index 581b43c032..3505748679 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/soup-view-search-bar.tsx
@@ -97,6 +97,7 @@ export const SoupSearchbar = (props: SoupSearchbarProps) => {
/>
<input
ref={setRef}
+ data-soup-search
type="text"
value={searchText()}
onInput={(e) => setSearchText(e.currentTarget.value)}