Skip to content

Commit ba5dd36

Browse files
feat(sidebar): add advanced search menu item and hotkey
1 parent 282fb99 commit ba5dd36

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

apps/desktop/src/components/main/body/empty/index.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ function EmptyView() {
7272
() => openCurrent({ type: "ai" }),
7373
[openCurrent],
7474
);
75+
const openAdvancedSearch = useCallback(
76+
() => openCurrent({ type: "search" }),
77+
[openCurrent],
78+
);
7579

7680
useHotkeys(
7781
"mod+o",
@@ -89,27 +93,33 @@ function EmptyView() {
8993
shortcut={["⌘", "O"]}
9094
onClick={() => setOpenNoteDialogOpen(true)}
9195
/>
96+
<div className="h-px bg-neutral-200 my-1" />
97+
<ActionItem
98+
label="Contacts"
99+
shortcut={["⌘", "⇧", "O"]}
100+
onClick={openContacts}
101+
/>
92102
<ActionItem
93103
label="Calendar"
94104
shortcut={["⌘", "⇧", "C"]}
95105
onClick={openCalendar}
96106
/>
97107
<ActionItem
98-
label="Contacts"
99-
shortcut={["⌘", "⇧", "O"]}
100-
onClick={openContacts}
108+
label="Advanced Search"
109+
shortcut={["⌘", "⇧", "F"]}
110+
onClick={openAdvancedSearch}
101111
/>
102112
<div className="h-px bg-neutral-200 my-1" />
103-
<ActionItem
104-
label="Settings"
105-
shortcut={["⌘", ","]}
106-
onClick={openSettings}
107-
/>
108113
<ActionItem
109114
label="AI Settings"
110115
shortcut={["⌘", "⇧", ","]}
111116
onClick={openAiSettings}
112117
/>
118+
<ActionItem
119+
label="App Settings"
120+
shortcut={["⌘", ","]}
121+
onClick={openSettings}
122+
/>
113123
</div>
114124
<OpenNoteDialog
115125
open={openNoteDialogOpen}

apps/desktop/src/components/main/sidebar/profile/index.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
FileTextIcon,
77
FolderOpenIcon,
88
MessageSquareIcon,
9+
SearchIcon,
910
SettingsIcon,
1011
SparklesIcon,
1112
UsersIcon,
@@ -168,6 +169,11 @@ export function ProfileSection({ onExpandChange }: ProfileSectionProps = {}) {
168169
closeMenu();
169170
}, [openFeedback, closeMenu]);
170171

172+
const handleClickAdvancedSearch = useCallback(() => {
173+
openNew({ type: "search" });
174+
closeMenu();
175+
}, [openNew, closeMenu]);
176+
171177
// const handleClickData = useCallback(() => {
172178
// openNew({ type: "data" });
173179
// closeMenu();
@@ -198,6 +204,12 @@ export function ProfileSection({ onExpandChange }: ProfileSectionProps = {}) {
198204
onClick: handleClickCalendar,
199205
badge: <Kbd className={kbdClass}>⌘ ⇧ C</Kbd>,
200206
},
207+
{
208+
icon: SearchIcon,
209+
label: "Advanced Search",
210+
onClick: handleClickAdvancedSearch,
211+
badge: <Kbd className={kbdClass}>⌘ ⇧ F</Kbd>,
212+
},
201213
{
202214
icon: FileTextIcon,
203215
label: "Templates",
@@ -265,7 +277,7 @@ export function ProfileSection({ onExpandChange }: ProfileSectionProps = {}) {
265277
{menuItems.map((item, index) => (
266278
<div key={item.label}>
267279
<MenuItem {...item} />
268-
{(index === 2 || index === 5 || index === 7) && (
280+
{(index === 3 || index === 6 || index === 8) && (
269281
<div className="my-1 border-t border-neutral-100" />
270282
)}
271283
</div>

0 commit comments

Comments
 (0)