c8485313264201f3c70c9efed95b9eb3b84d981e
Replaces the static template list with a working multi-entity command
palette tied to the active workspace.
Server (lib/appwrite/search-actions.ts):
- globalSearchAction(query): runs after the user has typed >= 2 chars.
Pulls up to 200 rows per entity for the active tenant via requireTenant
and admin SDK, then in-memory filters on:
customers: name, email, phone, taxId
invoices: number, notes, customer name (via id->name map)
tasks: title, description
services: name, description
software: name, version, description
calendar events: title, description
finance entries: description, customer name, amount string
- Returns at most 8 hits per group. Each hit has { title, subtitle, url,
group } so the client doesn't need extra lookups. Turkish-aware
toLocaleLowerCase('tr-TR').
Client (components/command-search.tsx):
- Rewritten. cmdk Command with shouldFilter=false (we provide filtered
results from the server).
- 220ms debounce on input; spinner during fetch.
- Ordered groups: Müşteriler / Faturalar / Görevler / Takvim / Finans /
Hizmetler / Yazılımlar — each with its own icon.
- Static groups always evaluated client-side from the typed query:
* Sayfalar (8 nav items)
* Hızlı aksiyonlar (5 — yeni müşteri / fatura / görev / etkinlik /
finans girişi)
* Ayarlar (3 — şirket bilgileri / ekip / profil)
- Empty-state message ('Sonuç bulunamadı') only shown when the query
is non-trivial AND nothing matches anywhere.
- Footer hint row with ↵/↑↓/Esc/⌘K legend.
- Invoice hits navigate to /invoices/[id]; other entity hits go to the
list page (no per-id detail routes for those yet).
Trigger button (SearchTrigger): localized to 'Hızlı ara...'.
Description
No description provided
Languages
TypeScript
99.5%
CSS
0.5%