mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-25 02:33:05 +00:00
Staff Início posts to /campanha/home-search with scoped word-start matches, shared readout component, and simplify hardening (messages, fetch busy, malformed response guard).
16 lines
559 B
TypeScript
16 lines
559 B
TypeScript
/** Debounce for Início omnibox — shorter than list search (1000 ms RSC round-trips). */
|
|
export const HOME_SEARCH_DEBOUNCE_MS = 250
|
|
|
|
/** Minimum trimmed length before focused mode and result providers run. */
|
|
export const HOME_SEARCH_MIN_QUERY_LENGTH = 2
|
|
|
|
export type HomeSearchQuery = {
|
|
raw: string
|
|
debounced: string
|
|
isActive: boolean
|
|
}
|
|
|
|
export const homeSearchQueryIsActive = (trimmedDebounced: string): boolean =>
|
|
trimmedDebounced.length >= HOME_SEARCH_MIN_QUERY_LENGTH
|
|
|
|
export const normalizeHomeSearchRaw = (raw: string): string => raw.trim()
|