-
Notifications
You must be signed in to change notification settings - Fork 65
feat: added global modern Spotlight Search #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,7 +19,16 @@ | |||||||||||||||||||
|
|
||||||||||||||||||||
| "use client"; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| import { AppBar, Container, Toolbar, IconButton, Box, Tooltip, Typography } from "@mui/material"; | ||||||||||||||||||||
| import { | ||||||||||||||||||||
| AppBar, | ||||||||||||||||||||
| Container, | ||||||||||||||||||||
| Toolbar, | ||||||||||||||||||||
| IconButton, | ||||||||||||||||||||
| Box, | ||||||||||||||||||||
| Tooltip, | ||||||||||||||||||||
| Typography, | ||||||||||||||||||||
| Button, | ||||||||||||||||||||
| } from "@mui/material"; | ||||||||||||||||||||
| import Image from "next/image"; | ||||||||||||||||||||
| import NavLinks from "./nav-links"; | ||||||||||||||||||||
| import { useTheme } from "../theme-provider"; | ||||||||||||||||||||
|
|
@@ -29,6 +38,7 @@ import GitHubIcon from "@mui/icons-material/GitHub"; | |||||||||||||||||||
| import HomeIcon from "@mui/icons-material/Home"; | ||||||||||||||||||||
| import FolderIcon from "@mui/icons-material/Folder"; | ||||||||||||||||||||
| import MenuBookIcon from "@mui/icons-material/MenuBook"; | ||||||||||||||||||||
| import SearchIcon from "@mui/icons-material/Search"; | ||||||||||||||||||||
| import { usePathname } from "next/navigation"; | ||||||||||||||||||||
| import { useEffect, useState } from "react"; | ||||||||||||||||||||
| import Link from "next/link"; | ||||||||||||||||||||
|
|
@@ -174,6 +184,53 @@ export default function Banner() { | |||||||||||||||||||
| <NavLinks links={links} scrolled={scrolled} /> | ||||||||||||||||||||
| </Box> | ||||||||||||||||||||
|
|
||||||||||||||||||||
| <Box className="flex items-center"> | ||||||||||||||||||||
| <Button | ||||||||||||||||||||
| onClick={() => { | ||||||||||||||||||||
| const event = new KeyboardEvent("keydown", { | ||||||||||||||||||||
| key: "k", | ||||||||||||||||||||
| metaKey: true, | ||||||||||||||||||||
| ctrlKey: true, | ||||||||||||||||||||
|
Comment on lines
+190
to
+193
|
||||||||||||||||||||
| const event = new KeyboardEvent("keydown", { | |
| key: "k", | |
| metaKey: true, | |
| ctrlKey: true, | |
| const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; | |
| const event = new KeyboardEvent("keydown", { | |
| key: "k", | |
| metaKey: isMac, | |
| ctrlKey: !isMac, |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The search button only displays the macOS keyboard shortcut symbol "⌘K" regardless of the user's platform. Windows/Linux users see "⌘K" but should see "Ctrl+K". Update the button to display the correct shortcut based on the platform:
const isMac = typeof navigator !== 'undefined' && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
// Then in the kbd element:
{isMac ? '⌘K' : 'Ctrl+K'}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The kbd styling uses fixed color values that may not provide sufficient contrast in all scenarios. The light mode kbd element uses
color: #555on a background that could vary, potentially violating WCAG contrast requirements. Consider using theme-aware colors or CSS variables that adapt to the theme context to ensure adequate contrast ratios (at least 4.5:1 for text).