diff --git a/package.json b/package.json index af764c7..72d3181 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,10 @@ "nuqs": "^2.1.2", "react": "19.0.0-rc-02c0e824-20241028", "react-dom": "19.0.0-rc-02c0e824-20241028", + "react-hotkeys-hook": "^4.6.1", "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", + "ts-key-enum": "^3.0.13", "vaul": "^1.1.1", "yaml": "^2.6.0", "zod": "^3.23.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3008ed9..f606335 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -68,12 +68,18 @@ importers: react-dom: specifier: 19.0.0-rc-02c0e824-20241028 version: 19.0.0-rc-02c0e824-20241028(react@19.0.0-rc-02c0e824-20241028) + react-hotkeys-hook: + specifier: ^4.6.1 + version: 4.6.1(react-dom@19.0.0-rc-02c0e824-20241028(react@19.0.0-rc-02c0e824-20241028))(react@19.0.0-rc-02c0e824-20241028) tailwind-merge: specifier: ^2.5.4 version: 2.5.4 tailwindcss-animate: specifier: ^1.0.7 version: 1.0.7(tailwindcss@3.4.14) + ts-key-enum: + specifier: ^3.0.13 + version: 3.0.13 vaul: specifier: ^1.1.1 version: 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@19.0.0-rc-02c0e824-20241028(react@19.0.0-rc-02c0e824-20241028))(react@19.0.0-rc-02c0e824-20241028) @@ -2049,6 +2055,12 @@ packages: peerDependencies: react: 19.0.0-rc-02c0e824-20241028 + react-hotkeys-hook@4.6.1: + resolution: {integrity: sha512-XlZpbKUj9tkfgPgT9gA+1p7Ey6vFIZHttUjPqpTdyT5nqQ8mHL7elxvSbaC+dpSiHUSmr21Ya1mDxBZG3aje4Q==} + peerDependencies: + react: '>=16.8.1' + react-dom: '>=16.8.1' + react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -2312,6 +2324,9 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + ts-key-enum@3.0.13: + resolution: {integrity: sha512-2J5QVm+HLfToI6IpJQADzYYWvJQ0P9i8qV0loewy5UQ9PBcwILkw09te/+NPu6aw8OXIn9jVYOT6xCBZnGg8Yg==} + tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} @@ -4495,6 +4510,11 @@ snapshots: react: 19.0.0-rc-02c0e824-20241028 scheduler: 0.25.0-rc-02c0e824-20241028 + react-hotkeys-hook@4.6.1(react-dom@19.0.0-rc-02c0e824-20241028(react@19.0.0-rc-02c0e824-20241028))(react@19.0.0-rc-02c0e824-20241028): + dependencies: + react: 19.0.0-rc-02c0e824-20241028 + react-dom: 19.0.0-rc-02c0e824-20241028(react@19.0.0-rc-02c0e824-20241028) + react-is@16.13.1: {} react-remove-scroll-bar@2.3.6(@types/react@18.3.12)(react@19.0.0-rc-02c0e824-20241028): @@ -4822,6 +4842,8 @@ snapshots: ts-interface-checker@0.1.13: {} + ts-key-enum@3.0.13: {} + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6d72417..e44b130 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,6 +6,7 @@ import { ThemeProvider } from "next-themes"; import { NuqsAdapter } from 'nuqs/adapters/next/app' import { AppLayout } from "@/components/layout/app-layout"; import { AlertsProvider } from "@/contexts/alerts"; +import { TooltipProvider } from "@/components/ui/tooltip"; export const dynamic = "force-dynamic"; @@ -53,13 +54,15 @@ export default async function RootLayout({ enableSystem disableTransitionOnChange > - - - - {children} - - - + + + + + {children} + + + + diff --git a/src/components/alerts/group-select.tsx b/src/components/alerts/group-select.tsx index 9317391..c37def0 100644 --- a/src/components/alerts/group-select.tsx +++ b/src/components/alerts/group-select.tsx @@ -1,10 +1,11 @@ "use client"; -import { Label } from "@/components/ui/label"; -import { Check, ChevronDown } from "lucide-react"; import { useState } from "react"; +import { Boxes, Check, ChevronDown } from "lucide-react"; import { useQueryState } from "nuqs"; +import { useHotkeys } from "react-hotkeys-hook"; import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; import { Command, CommandEmpty, @@ -15,6 +16,7 @@ import { } from "@/components/ui/command"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { cn } from "@/lib/utils"; +import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip"; type Props = { labels: string[]; @@ -27,9 +29,25 @@ export default function GroupSelect(props: Props) { const [open, setOpen] = useState(false); const [value, setValue] = useQueryState('group', { defaultValue, history: 'push' }); + useHotkeys('g', (e) => { + e.preventDefault(); // Prevent typing in input field + setOpen(true) + }, []); + return (
- + + + + + + + Refresh + R + +