Skip to content

Commit 6671e05

Browse files
committed
fix: hiding long form tasks and fixing shortcut keys
1 parent 7bef26d commit 6671e05

File tree

5 files changed

+102
-79
lines changed

5 files changed

+102
-79
lines changed

src/client/app/settings/page.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,18 @@ const WhatsAppSettings = () => {
231231
WhatsApp Notifications
232232
</h2>
233233
<p className="text-neutral-400 mb-6">
234-
Receive important notifications, task updates, and reminders on WhatsApp.
234+
Receive important notifications, task updates, and reminders on
235+
WhatsApp.
235236
</p>
236237
<div className="bg-neutral-900/50 p-6 rounded-2xl border border-neutral-800">
237238
<div className="space-y-4">
238239
<p className="text-neutral-400 text-sm">
239-
Receive important notifications, task updates, and reminders on WhatsApp. We're in the process of getting an official number, so for now, messages will come from our co-founder Sarthak (+91827507823), who may also occasionally reach out for feedback. Please enter your number with the country code.
240+
Receive important notifications, task updates, and
241+
reminders on WhatsApp. We're in the process of getting
242+
an official number, so for now, messages will come from
243+
our co-founder Sarthak (+91827507823), who may also
244+
occasionally reach out for feedback. Please enter your
245+
number with the country code.
240246
</p>
241247
{isNotifLoading ? (
242248
<div className="flex justify-center mt-4">
@@ -324,18 +330,20 @@ const WhatsAppSettings = () => {
324330

325331
const ShortcutsSettings = () => {
326332
const shortcuts = {
327-
Global: [
328-
{ keys: ["Ctrl", "M"], description: "Open Chat" },
329-
{ keys: ["Ctrl", "B"], description: "Toggle Notifications" },
330-
{ keys: ["Esc"], description: "Close Modal / Chat" },
331-
{ keys: ["Ctrl", "K"], description: "Open Command Palette" }
333+
General: [
334+
{ keys: ["Ctrl", "K"], description: "Open Search" },
335+
{
336+
keys: ["Ctrl", "Shift", "E"],
337+
description: "Toggle Notifications"
338+
},
339+
{ keys: ["Esc"], description: "Close Modal / Popup" }
332340
],
333341
Navigation: [
334-
{ keys: ["Ctrl", "H"], description: "Go to Chat" },
335-
{ keys: ["Ctrl", "J"], description: "Go to Notes" },
336-
{ keys: ["Ctrl", "A"], description: "Go to Tasks" },
337-
{ keys: ["Ctrl", "I"], description: "Go to Integrations" },
338-
{ keys: ["Ctrl", "S"], description: "Go to Settings" }
342+
{ keys: ["Ctrl", "Shift", "1"], description: "Go to Chat" },
343+
{ keys: ["Ctrl", "Shift", "2"], description: "Go to Tasks" },
344+
{ keys: ["Ctrl", "Shift", "3"], description: "Go to Memories" },
345+
{ keys: ["Ctrl", "Shift", "4"], description: "Go to Integrations" },
346+
{ keys: ["Ctrl", "Shift", "5"], description: "Go to Settings" }
339347
]
340348
}
341349

src/client/components/CommandPallete.js

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
IconChecklist,
88
IconPlugConnected,
99
IconAdjustments,
10-
IconPlus
10+
IconPlus,
11+
IconBrain
1112
} from "@tabler/icons-react"
1213
import { useRouter } from "next/navigation"
1314

@@ -36,25 +37,40 @@ const CommandPalette = ({ open, setOpen }) => {
3637
onOpenChange={setOpen}
3738
label="Global Command Menu"
3839
>
40+
{/* The 'label' prop provides the accessible name for the dialog, satisfying accessibility requirements. */}
3941
<Command.Input placeholder="Type a command or search..." />
4042
<Command.List>
4143
<Command.Empty>No results found.</Command.Empty>
4244

4345
<Command.Group heading="Navigation">
4446
<Command.Item
45-
onSelect={() =>
46-
runCommand(() => router.push("/integrations"))
47-
}
47+
onSelect={() => runCommand(() => router.push("/chat"))}
4848
>
49-
<IconPlugConnected className="mr-2 h-4 w-4" />
50-
Go to Integrations
49+
<IconMessage className="mr-2 h-4 w-4" />
50+
Go to Chat
5151
</Command.Item>
5252
<Command.Item
5353
onSelect={() => runCommand(() => router.push("/tasks"))}
5454
>
5555
<IconChecklist className="mr-2 h-4 w-4" />
5656
Go to Tasks
5757
</Command.Item>
58+
<Command.Item
59+
onSelect={() =>
60+
runCommand(() => router.push("/memories"))
61+
}
62+
>
63+
<IconBrain className="mr-2 h-4 w-4" />
64+
Go to Memories
65+
</Command.Item>
66+
<Command.Item
67+
onSelect={() =>
68+
runCommand(() => router.push("/integrations"))
69+
}
70+
>
71+
<IconPlugConnected className="mr-2 h-4 w-4" />
72+
Go to Integrations
73+
</Command.Item>
5874
<Command.Item
5975
onSelect={() =>
6076
runCommand(() => router.push("/settings"))
@@ -67,15 +83,7 @@ const CommandPalette = ({ open, setOpen }) => {
6783

6884
<Command.Group heading="Actions">
6985
<Command.Item
70-
onSelect={() => {
71-
runCommand(() => router.push("/tasks?action=add"))
72-
}}
73-
>
74-
<IconMessage className="mr-2 h-4 w-4" />
75-
New Chat
76-
</Command.Item>
77-
<Command.Item
78-
onSelect={() => runCommand(() => router.push("/chat"))}
86+
onSelect={() => runCommand(() => router.push("/tasks"))}
7987
>
8088
<IconPlus className="mr-2 h-4 w-4" />
8189
New Task

src/client/components/LayoutWrapper.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { AnimatePresence } from "framer-motion"
1313
import NotificationsOverlay from "@components/NotificationsOverlay"
1414
import { IconMenu2, IconLoader, IconX } from "@tabler/icons-react"
1515
import Sidebar from "@components/Sidebar"
16-
import CommandPalette from "./CommandPallete"
1716
import GlobalSearch from "./GlobalSearch"
1817
import { useGlobalShortcuts } from "@hooks/useGlobalShortcuts"
1918
import { cn } from "@utils/cn"
@@ -47,7 +46,6 @@ export default function LayoutWrapper({ children }) {
4746
// ... (keep all your existing state declarations)
4847
const [isNotificationsOpen, setNotificationsOpen] = useState(false)
4948
const [isSearchOpen, setSearchOpen] = useState(false)
50-
const [isCommandPaletteOpen, setCommandPaletteOpen] = useState(false)
5149
const [isSidebarCollapsed, setSidebarCollapsed] = useState(true)
5250
const [isMobileNavOpen, setMobileNavOpen] = useState(false)
5351
const [unreadCount, setUnreadCount] = useState(0)
@@ -158,7 +156,7 @@ export default function LayoutWrapper({ children }) {
158156
const checkStatus = async () => {
159157
// No need to set isLoading(true) here, it's already true by default.
160158
try {
161-
const res = await fetch("/api/user/data", {method: "POST"})
159+
const res = await fetch("/api/user/data", { method: "POST" })
162160
if (!res.ok) throw new Error("Could not verify user status.")
163161
const result = await res.json()
164162
const data = result?.data || {}
@@ -297,8 +295,10 @@ export default function LayoutWrapper({ children }) {
297295
setUnreadCount(0)
298296
}, [])
299297

300-
useGlobalShortcuts(handleNotificationsOpen, () =>
301-
setCommandPaletteOpen((prev) => !prev)
298+
useGlobalShortcuts(
299+
handleNotificationsOpen,
300+
() => setSearchOpen(true) // New: Pass search open function
301+
// Removed: Command palette toggle is no longer needed
302302
)
303303

304304
// PWA Update Handler
@@ -476,12 +476,6 @@ export default function LayoutWrapper({ children }) {
476476
</button>
477477
</>
478478
)}
479-
{showNav && (
480-
<CommandPalette
481-
open={isCommandPaletteOpen}
482-
setOpen={setCommandPaletteOpen}
483-
/>
484-
)}
485479
<div
486480
className={cn(
487481
"flex-1 transition-[padding-left] duration-300 ease-in-out",

src/client/components/tasks/TaskComposer.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,22 @@ const tabs = [
4848
"For complex projects that require a larger team of AI workers.",
4949
icon: <IconUsersGroup size={18} />,
5050
isProFeature: true
51-
},
52-
{
53-
id: "long_form",
54-
label: "Long-Form",
55-
description:
56-
"For complex, multi-step tasks that run over an extended period.",
57-
icon: <IconClock size={18} />,
58-
isProFeature: false // Free feature for now (considered for Pro in future)
5951
}
52+
// {
53+
// id: "long_form",
54+
// label: "Long-Form",
55+
// description:
56+
// "For complex, multi-step tasks that run over an extended period.",
57+
// icon: <IconClock size={18} />,
58+
// isProFeature: false // Free feature for now (considered for Pro in future)
59+
// }
6060
]
6161

62-
const longFormPlaceholders = [
63-
"Organize my upcoming business trip to New York next week.",
64-
"Help me plan and execute a marketing campaign for our new product launch.",
65-
"Onboard the new hire, John Doe, by setting up his accounts and sending him the required documents."
66-
]
62+
// const longFormPlaceholders = [
63+
// "Organize my upcoming business trip to New York next week.",
64+
// "Help me plan and execute a marketing campaign for our new product launch.",
65+
// "Onboard the new hire, John Doe, by setting up his accounts and sending him the required documents."
66+
// ]
6767

6868
const oncePlaceholders = [
6969
"Draft a follow-up email to the client about the new proposal.",
@@ -392,13 +392,12 @@ const TaskComposer = ({
392392
)}
393393
>
394394
<TextLoop>
395-
{(activeTab === "long_form"
396-
? longFormPlaceholders
397-
: activeTab === "once"
398-
? oncePlaceholders
399-
: activeTab === "recurring"
400-
? recurringPlaceholders
401-
: swarmPlaceholders
395+
{(activeTab === "once"
396+
? // ? longFormPlaceholders
397+
oncePlaceholders
398+
: activeTab === "recurring"
399+
? recurringPlaceholders
400+
: swarmPlaceholders
402401
).map((p) => (
403402
<span key={p}>{p}</span>
404403
))}

src/client/hooks/useGlobalShortcuts.js

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ import { usePathname, useRouter } from "next/navigation"
77
* Custom hook to manage global keyboard shortcuts.
88
* It intelligently adds/removes listeners based on the current route.
99
* @param {function} onNotificationsOpen - Callback to open notifications.
10-
* @param {function} onCommandPaletteToggle - Callback to toggle the command palette.
10+
* @param {function} onSearchOpen - Callback to open the global search.
1111
*/
12-
export function useGlobalShortcuts(
13-
onNotificationsOpen,
14-
onCommandPaletteToggle
15-
) {
12+
export function useGlobalShortcuts(onNotificationsOpen, onSearchOpen) {
1613
const router = useRouter()
1714
const pathname = usePathname()
1815

@@ -21,27 +18,44 @@ export function useGlobalShortcuts(
2118

2219
const handleKeyDown = useCallback(
2320
(e) => {
21+
// Use e.code for physical key presses, ignoring layout/shift changes for the key itself
2422
if (e.ctrlKey) {
25-
switch (e.key.toLowerCase()) {
26-
case "t":
27-
router.push("/tasks")
28-
break
29-
case "b":
30-
onNotificationsOpen()
31-
break
32-
case "k":
33-
onCommandPaletteToggle()
34-
break
35-
case "m":
36-
router.push("/chat")
37-
break
38-
default:
39-
return
23+
if (e.shiftKey) {
24+
switch (e.code) {
25+
case "Digit1":
26+
router.push("/chat")
27+
break
28+
case "Digit2":
29+
router.push("/tasks")
30+
break
31+
case "Digit3":
32+
router.push("/memories")
33+
break
34+
case "Digit4":
35+
router.push("/integrations")
36+
break
37+
case "Digit5":
38+
router.push("/settings")
39+
break
40+
case "KeyE": // E for Events/Notifications
41+
onNotificationsOpen()
42+
break
43+
default:
44+
return
45+
}
46+
} else {
47+
switch (e.code) {
48+
case "KeyK": // K for Kommand/Search
49+
onSearchOpen()
50+
break
51+
default:
52+
return
53+
}
4054
}
4155
e.preventDefault()
4256
}
4357
},
44-
[router, onNotificationsOpen, onCommandPaletteToggle]
58+
[router, onNotificationsOpen, onSearchOpen]
4559
)
4660

4761
useEffect(() => {

0 commit comments

Comments
 (0)