Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
improvement(search): align cmd+k action icons + highlight with the design system#5114
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -42,7 +42,7 @@ export const HighlightedText = memo( | ||
| <> | ||
| {buildSegments(text, positions).map((segment, index) => | ||
| segment.hit ? ( | ||
| <span key={index} className='font-semibold text-[var(--text-body)]'> | ||
| <span key={index} className='font-medium'> | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| {segment.text} | ||
| </span> | ||
| ) : ( | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,28 +3,26 @@ | ||
| import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from 'react' | ||
| import { createLogger } from '@sim/logger' | ||
| import { Command } from 'cmdk' | ||
| import { Scan } from 'lucide-react' | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| import { useParams, useRouter } from 'next/navigation' | ||
| import { useTheme } from 'next-themes' | ||
| import { usePostHog } from 'posthog-js/react' | ||
| import { createPortal } from 'react-dom' | ||
| import { Library } from '@/components/emcn' | ||
| import { | ||
| Calendar, | ||
| Database, | ||
| Expand, | ||
| Duplicate, | ||
| File, | ||
| FolderPlus, | ||
| HelpCircle, | ||
| Home, | ||
| Integration, | ||
| Link, | ||
| Palette, | ||
| Play, | ||
| Plus, | ||
| Settings, | ||
| Table, | ||
| Upload, | ||
| Users, | ||
| User, | ||
| } from '@/components/emcn/icons' | ||
| import { Search } from '@/components/emcn/icons/search' | ||
| import { cn } from '@/lib/core/utils/cn' | ||
| @@ -102,7 +100,6 @@ export function SearchModal({ | ||
| const [mounted, setMounted] = useState(false) | ||
| const { navigateToSettings } = useSettingsNavigation() | ||
| const { config: permissionConfig } = usePermissionConfig() | ||
| const { resolvedTheme, setTheme } = useTheme() | ||
| const invokeCommand = useInvokeGlobalCommand() | ||
| const posthog = usePostHog() | ||
| @@ -201,7 +198,8 @@ export function SearchModal({ | ||
| /** | ||
| * Verbs the palette can run directly. Entity navigation lives in the groups | ||
| * below; this list is for "do something" intents (create, import, toggle). | ||
| * below; this list is for "do something" intents (run, create, import, copy, | ||
| * invite). | ||
| */ | ||
| const actions = useMemo((): ActionItem[] => { | ||
| const list: ActionItem[] = [] | ||
| @@ -248,7 +246,7 @@ export function SearchModal({ | ||
| id: 'fit-to-view', | ||
| name: 'Fit workflow to view', | ||
| keywords: 'zoom center recenter canvas reset', | ||
| icon: Expand, | ||
| icon: Scan, | ||
| shortcut: '⌘⇧F', | ||
| context: 'workflow', | ||
| run: () => invokeCommand('fit-to-view'), | ||
| @@ -257,7 +255,7 @@ export function SearchModal({ | ||
| id: 'copy-workflow-url', | ||
| name: 'Copy workflow link', | ||
| keywords: 'url share clipboard', | ||
| icon: Link, | ||
| icon: Duplicate, | ||
| context: 'workflow', | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| run: () => { | ||
| navigator.clipboard.writeText(window.location.href).catch((error) => { | ||
| @@ -269,18 +267,10 @@ export function SearchModal({ | ||
| id: 'invite-teammates', | ||
| name: 'Invite teammates', | ||
| keywords: 'members people add user organization', | ||
| icon: Users, | ||
| icon: User, | ||
| context: 'global', | ||
| run: () => navigateToSettings({ section: 'teammates' }), | ||
| }) | ||
| list.push({ | ||
| id: 'toggle-theme', | ||
| name: 'Toggle theme', | ||
| keywords: 'dark light mode appearance color', | ||
| icon: Palette, | ||
| context: 'global', | ||
| run: () => setTheme(resolvedTheme === 'dark' ? 'light' : 'dark'), | ||
| }) | ||
| return list | ||
| }, [ | ||
| canEdit, | ||
| @@ -289,8 +279,6 @@ export function SearchModal({ | ||
| onImportWorkflow, | ||
| invokeCommand, | ||
| navigateToSettings, | ||
| resolvedTheme, | ||
| setTheme, | ||
| ]) | ||
| const [search, setSearch] = useState('') | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Match highlight missing design tokens
Low Severity
HighlightedTextmarks fuzzy matches with onlyfont-medium, while knowledge-base and code search useSearchHighlight’sbg-[var(--highlight-match-bg)]andtext-[var(--highlight-match-text)]with no extra weight. Cmd+k search hits therefore look different from the rest of search UI and from what this change describes.Reviewed by Cursor Bugbot for commit 58f90ed. Configure here.