mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 03:01:26 +02:00
Both QuickInputBar (InputBar.svelte), CommandBar.svelte, and GlobalSpotlight were duplicating syntax highlighting and the 150ms search debounce. Pull these into a new `packages/shared-ui/src/search-core/` module so the two input surfaces stay in sync on feel and matching rules. - search-core/highlight.ts — HighlightPattern type, locale-aware getHighlightPatterns(), and the shared highlightText() (HTML-escape + span wrap). Patterns were previously in quick-input/highlightPatterns.ts + inline in CommandBar.svelte. - search-core/config.ts — SEARCH_DEBOUNCE_MS = 150. Used from InputBar, CommandBar, GlobalSpotlight, and apps/mana web SearchEngine. - quick-input/highlightPatterns.ts + types.ts become thin back-compat re-exports. - Public surface: @mana/shared-ui now exports getHighlightPatterns, highlightText, SEARCH_DEBOUNCE_MS, and the HighlightPattern type. No UX change. UIs still live in their own files (per earlier split recommendation: shared backend, separate surfaces). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9 lines
277 B
TypeScript
9 lines
277 B
TypeScript
/**
|
|
* Shared configuration for search/command input surfaces.
|
|
*
|
|
* Both QuickInputBar and GlobalSpotlight debounce their input with the same
|
|
* 150ms window — keep them in sync so the feel of the two surfaces doesn't
|
|
* diverge.
|
|
*/
|
|
|
|
export const SEARCH_DEBOUNCE_MS = 150;
|