Skip to content

feat: global ⌘K command palette + punctuation-insensitive search everywhere / 全局 ⌘K 命令面板与全站忽略标点搜索 - #930

Open
functionstackx wants to merge 4 commits into
masterfrom
feat/command-palette-and-forgiving-search
Open

feat: global ⌘K command palette + punctuation-insensitive search everywhere / 全局 ⌘K 命令面板与全站忽略标点搜索#930
functionstackx wants to merge 4 commits into
masterfrom
feat/command-palette-and-forgiving-search

Conversation

@functionstackx

@functionstackx functionstackx commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Two usability upgrades aimed at making the app dramatically faster to navigate and search:

1. Global command palette (⌘K / Ctrl+K)

A keyboard-first launcher in the header that jumps to any destination in the app from anywhere:

  • All top-level pages (Home, AgentX, Overview, Comparisons, Articles, About, AI Chips, Rankings, Glossary, Supporter Quotes, API Reference)
  • All primary dashboard tabs (Inference Performance, Accuracy Evals, Historical Trends, TCO Calculator, Fleet Lifecycle, Chip Specs, Submissions)
  • Every active model dashboard (/inference/<model>)
  • Every chip page (/chips/<slug>)
  • Quick actions: switch theme, switch language, star on GitHub

Details:

  • Fully bilingual — on /zh pages the palette renders Chinese labels and navigates to the /zh sibling routes
  • Full keyboard support (↑/↓/Home/End/Enter/Esc), ARIA combobox/listbox semantics, aria-activedescendant, scroll-into-view
  • Uses the same commit-retry navigation as header links (extracted as pushInApp from navigateInApp) so the first dashboard transition commits reliably
  • PostHog events: command_palette_opened / command_palette_selected
  • Trigger button in the header with platform-aware ⌘K / Ctrl K hint (rendered post-mount for hydration safety)

2. Punctuation-insensitive, order-insensitive search everywhere — closes #406

New shared matchesSearch utility (packages/app/src/lib/search-match.ts): lowercases, folds separator punctuation to spaces (CJK preserved), and requires every query token to match. Applied to:

  • SearchableSelect (model/queue pickers) — "B300 vllm" now matches "B300 (vLLM)"
  • MultiSelect (both filter paths)
  • DataTable global filter
  • The new command palette

Tests

  • search-match.test.ts — normalization, tokenization, Search optimizations (Not SEO) / 搜索优化(非 SEO) #406 regression cases, CJK
  • command-palette-items.test.ts — registry pinned against chip-pages.ts, dashboard routes, and model slugs so the palette can't silently drift
  • command-palette.test.tsx — open via trigger/Ctrl+K, filtering, Enter navigation, arrow keys, empty state, /zh behavior
  • searchable-select.test.ts — new parenthesis/word-order case

bun run typecheck ✓ · bun run lint ✓ · bun run fmt ✓ · bun run test:unit ✓ (254 files, 4486 tests)

Verified in a live dev server (desktop 1440px, mobile 375px, / and /zh): palette opens via shortcut and button, filters, navigates to pages/tabs/models/chips, and the header hint renders on one line.

中文说明

两项可用性升级,让站内导航与搜索显著提速:

1. 全局命令面板(⌘K / Ctrl+K)

页眉新增键盘优先的启动器,可从任意位置跳转到应用内所有目标:全部顶层页面、主要仪表板标签页(推理性能、精度评测、历史趋势、TCO 计算器、机队生命周期、芯片规格、提交记录)、每个模型仪表板(/inference/<model>)与每个芯片页面(/chips/<slug>),并提供快捷操作(切换主题、切换语言、GitHub 加星)。

  • 完整双语支持——在 /zh 页面上面板显示中文标签,并跳转到对应的 /zh 路由
  • 完整键盘支持(↑/↓/Home/End/Enter/Esc)与 ARIA combobox/listbox 语义
  • 复用页眉链接的导航重试逻辑(从 navigateInApp 提取为 pushInApp),确保首次仪表板跳转可靠提交
  • PostHog 事件:command_palette_opened / command_palette_selected

2. 全站搜索忽略标点与词序——修复 #406

新增共享工具 matchesSearch:转小写、将分隔标点折叠为空格(保留中文字符)、要求每个查询词均命中。已应用于下拉搜索、多选、数据表格全局筛选与新命令面板。例如 "B300 vllm" 现可匹配 "B300 (vLLM)"。

测试

新增/扩展四组单元测试;typechecklintfmttest:unit(254 个文件,4486 个用例)全部通过,并在本地开发服务器上完成桌面端、移动端与中文站的可视化验证。


Note

Medium Risk
Touches app-wide navigation and in-app routing retry logic, plus search behavior in shared UI controls; risk is mitigated by extensive unit tests but edge cases around dashboard URL state remain possible.

Overview
Adds a global command palette (header trigger + ⌘K / Ctrl+K) that searches and jumps to site pages, dashboard tabs, model routes, and chip pages, with quick actions for theme, locale, and GitHub. Navigation reuses the header’s commit-retry behavior via new pushInApp, preserves dashboard query params (e.g. unofficialruns), skips re-navigating to the current route, and is bilingual on /zh. The palette trigger is hidden below 360px width to keep narrow headers usable.

Introduces shared matchesSearch (token-based, punctuation-normalized, order-independent) and wires it into SearchableSelect, MultiSelect, DataTable filtering, and the palette—fixing #406 (e.g. B300 vllm matches B300 (vLLM)).

TAB_LABELS_EN moves to tab-meta.ts for reuse by tab nav and palette; palette destinations live in test-backed command-palette-items. Unit tests cover search matching, palette behavior, and registry drift vs chip pages and model slugs.

Reviewed by Cursor Bugbot for commit 275bec5. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview Aug 28, 2026 12:46am

Request Review

@blacksmith-sh

This comment has been minimized.

Comment thread packages/app/src/components/ui/command-palette.tsx
Comment thread packages/app/src/components/ui/command-palette.tsx
Comment thread packages/app/src/components/ui/command-palette.tsx Outdated
Adds a Cmd/Ctrl+K command palette in the header that jumps to any page,
dashboard tab, model dashboard, or chip page (bilingual, /zh aware), and
a shared punctuation-insensitive multi-token matcher used by the palette
and every existing search box (searchable-select, multi-select, chart
legend, data table), so queries like "B300 vllm" match "B300 (vLLM)".

Closes #406.

中文:新增全局命令面板(Cmd/Ctrl+K),可从页眉快速跳转到任意页面、仪表板
标签页、模型仪表板或芯片页面(支持中英双语与 /zh 路由);同时引入统一的
忽略标点的多词搜索匹配工具,并应用于所有现有搜索框(下拉搜索、多选、
图表图例、数据表格),例如查询 "B300 vllm" 可匹配 "B300 (vLLM)"。
修复 #406
…r 360px

Cypress component tests pin the 320px header at capacity, and the CI DOM
environment lacks Element.scrollIntoView.

中文:为测试 DOM 环境增加 scrollIntoView 保护,并在窄于 360px 的视口下
隐藏命令面板触发按钮(320px 页眉已无剩余空间)。
… close reset

- Ignore Enter while an IME composition is being confirmed (isComposing /
  keyCode 229), so committing CJK input no longer runs the selection
- Locale action now keeps the current query string and uses the same
  commit-retry push as the header language toggle
- Closing via Cmd/Ctrl+K now routes through handleOpenChange so the next
  open starts with a cleared query

中文:修复 Bugbot 审查发现的三个问题——输入法(IME)确认组合输入时不再
触发选中项;语言切换操作保留当前查询参数并复用页眉语言切换的导航重试
逻辑;通过快捷键关闭面板时同样清空搜索词。

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6fa7e56. Configure here.

Comment thread packages/app/src/components/ui/command-palette.tsx Outdated
Comment thread packages/app/src/lib/command-palette-items.ts
…ard keywords

- Selecting the current page in the palette is now a no-op instead of a
  refetch that wipes dashboard filters (matches header link behavior)
- Dashboard tab jumps carry the unofficialruns param, same as TabNav
- Dashboard destinations are searchable via the header label the user
  actually sees: "dashboard" and 仪表板 in both locales

中文:修复 Bugbot 第二轮审查——在面板中选择当前页面不再重新加载(避免
清空仪表板筛选条件);仪表板标签跳转保留 unofficialruns 参数;仪表板
条目可通过页眉实际显示的「Dashboard/仪表板」关键词搜索到。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search optimizations (Not SEO) / 搜索优化(非 SEO)

1 participant