Skip to content

Commit d7fd040

Browse files
authored
improvement(search): align cmd+k action icons + highlight with the design system (#5114)
* improvement(search): align cmd+k action icons + highlight with the design system - Each Actions verb now uses the exact icon from its real location: Fit to view -> Scan (workflow-controls), Copy workflow link -> Duplicate (nav context menu), Invite teammates -> User (settings teammates nav). Run/Create/Import already matched. - Remove the Toggle theme action and its now-dead useTheme wiring. - Matched-text highlight now uses the design-system search tokens (--highlight-match-bg / --highlight-match-text), matching the SearchHighlight component used in knowledge-base and code search, instead of an ad-hoc font-semibold. * improvement(search): use font-medium for matched-text emphasis in cmd+k Drop the colored background highlight in favor of the design system's standard emphasis weight (font-medium, used by Button/Label/Input/Table). Lighter than the previous semibold and avoids a background, keeping the palette's clean, undecorated text style.
1 parent 9e9f2b9 commit d7fd040

2 files changed

Lines changed: 9 additions & 21 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/components/command-items/command-items.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const HighlightedText = memo(
4242
<>
4343
{buildSegments(text, positions).map((segment, index) =>
4444
segment.hit ? (
45-
<span key={index} className='font-semibold text-[var(--text-body)]'>
45+
<span key={index} className='font-medium'>
4646
{segment.text}
4747
</span>
4848
) : (

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,26 @@
33
import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import { Command } from 'cmdk'
6+
import { Scan } from 'lucide-react'
67
import { useParams, useRouter } from 'next/navigation'
7-
import { useTheme } from 'next-themes'
88
import { usePostHog } from 'posthog-js/react'
99
import { createPortal } from 'react-dom'
1010
import { Library } from '@/components/emcn'
1111
import {
1212
Calendar,
1313
Database,
14-
Expand,
14+
Duplicate,
1515
File,
1616
FolderPlus,
1717
HelpCircle,
1818
Home,
1919
Integration,
20-
Link,
21-
Palette,
2220
Play,
2321
Plus,
2422
Settings,
2523
Table,
2624
Upload,
27-
Users,
25+
User,
2826
} from '@/components/emcn/icons'
2927
import { Search } from '@/components/emcn/icons/search'
3028
import { cn } from '@/lib/core/utils/cn'
@@ -102,7 +100,6 @@ export function SearchModal({
102100
const [mounted, setMounted] = useState(false)
103101
const { navigateToSettings } = useSettingsNavigation()
104102
const { config: permissionConfig } = usePermissionConfig()
105-
const { resolvedTheme, setTheme } = useTheme()
106103
const invokeCommand = useInvokeGlobalCommand()
107104
const posthog = usePostHog()
108105

@@ -201,7 +198,8 @@ export function SearchModal({
201198

202199
/**
203200
* Verbs the palette can run directly. Entity navigation lives in the groups
204-
* below; this list is for "do something" intents (create, import, toggle).
201+
* below; this list is for "do something" intents (run, create, import, copy,
202+
* invite).
205203
*/
206204
const actions = useMemo((): ActionItem[] => {
207205
const list: ActionItem[] = []
@@ -248,7 +246,7 @@ export function SearchModal({
248246
id: 'fit-to-view',
249247
name: 'Fit workflow to view',
250248
keywords: 'zoom center recenter canvas reset',
251-
icon: Expand,
249+
icon: Scan,
252250
shortcut: '⌘⇧F',
253251
context: 'workflow',
254252
run: () => invokeCommand('fit-to-view'),
@@ -257,7 +255,7 @@ export function SearchModal({
257255
id: 'copy-workflow-url',
258256
name: 'Copy workflow link',
259257
keywords: 'url share clipboard',
260-
icon: Link,
258+
icon: Duplicate,
261259
context: 'workflow',
262260
run: () => {
263261
navigator.clipboard.writeText(window.location.href).catch((error) => {
@@ -269,18 +267,10 @@ export function SearchModal({
269267
id: 'invite-teammates',
270268
name: 'Invite teammates',
271269
keywords: 'members people add user organization',
272-
icon: Users,
270+
icon: User,
273271
context: 'global',
274272
run: () => navigateToSettings({ section: 'teammates' }),
275273
})
276-
list.push({
277-
id: 'toggle-theme',
278-
name: 'Toggle theme',
279-
keywords: 'dark light mode appearance color',
280-
icon: Palette,
281-
context: 'global',
282-
run: () => setTheme(resolvedTheme === 'dark' ? 'light' : 'dark'),
283-
})
284274
return list
285275
}, [
286276
canEdit,
@@ -289,8 +279,6 @@ export function SearchModal({
289279
onImportWorkflow,
290280
invokeCommand,
291281
navigateToSettings,
292-
resolvedTheme,
293-
setTheme,
294282
])
295283

296284
const [search, setSearch] = useState('')

0 commit comments

Comments
 (0)