docs(client): require multilingual fuzzy matching in user-facing search

Refs #6681
This commit is contained in:
turtle1999 committed 2026-11-13 12:39:20 +08:00
1 parent 230c7b4288
commit 505b2bc0e6
2 files changed
+13

No files matched your search

+1
View File
@@ -15,6 +15,7 @@ These package-specific rules supplement the repo-wide [conventions](../AGENTS.md
- **Write model-facing contracts from the model's perspective.** Prompts, tool schemas, results, and diagnostics contain only task-relevant concepts, not UI, transport, or implementation vocabulary. Pin stable model-visible text verbatim and dynamic behavior through snapshots or end-to-end coverage.
- **Enforce a decision in the operation that makes it.** Schema omission, prompt filtering, facades, wrappers, and listener order are not enforcement when direct or alternate callers can bypass them; test denial through the executor.
- **Publish state only at its commit point.** Emit each notification and update derived state only after the operation succeeds; derive caches, prompts, UI echoes, replay, and query views from one authoritative source.
- **User search follows the [Client search rule](client/AGENTS.md#search-and-filter),** including a Host search that supplies a Client list.
- **Apply bounds to the complete result.** Enforce byte, token, item, and time limits where the complete emitted or retained value, including wrappers and metadata, is known; test tiny and exact limits, oversized single chunks, and multibyte byte limits.
- **Registry contributions prove disposal** through the HMR-safety test required by [testing policy](../docs/testing.md): dispose the fiber and observe removal.
- **Specs run concurrently** in forked workers beside other gate processes. Own each acquired port, path, and child process through teardown; a spec that passes only when run alone is a defect in the spec ([execution model](../docs/testing.md#how-specs-execute)).
+12
View File
@@ -123,6 +123,18 @@ Menus use `Menu` or `MenuSurface`, including custom listboxes, except the explic
Every product-visible string—including text, accessibility names, tooltips, placeholders, status/unit formatters, and primitive chrome—lives in a typed locale dictionary and reaches components through the standard `t` seat or an already-localized prop. Cordis-free primitives require complete label props and own no fallback copy. Keep user/model/wire data and code tokens verbatim; internal matching uses discriminants or stable ids, never localized text. `pnpm run verify-client-ui-i18n` enforces source ownership ([decision](../../.agents/notes/implemented/architecture/2026-08-23-locale-owned-client-ui-copy.md)).
## Search and filter
User search queries over a list follow one rule, so a query finds the same item in every list. Unlike internal matching above, user query matching reads localized text:
- Rows display the current locale; matching covers every language the value carries. A `LocalizedText` carries all of its languages; text resolved through `t()` carries only the active one.
- Matching covers the text a row shows or the user can copy: names, titles, labels, descriptions, and ids. A menu whose default highlight spans several sources, such as the `/` menu, matches names and labels only, so a description hit in one group cannot take Enter from the name another group matched.
- Names, titles, labels, and readable ids match as substrings or as fuzzy subsequences that start at a word start, so `cpt` finds `compact`. Descriptions, prompts, paths, and opaque ids such as UUIDs match only as contiguous substrings. Matching ignores case, width, and diacritics, and every space-separated term must match.
- Results rank name prefix, then name substring, then fuzzy name, then text substring; equal matches keep the list's own order.
- Facet selections, such as status, category, or label filters, stay exact.
The rule covers lists filtered in memory, including a Host search that supplies a Client list, such as `@` Session candidates. Searches backed by their own index keep their matcher: Session content search runs literal SQLite full-text terms over Session text, and the plugin market ranks its paged index on the Host. The sidebar's title, Workspace, and id matching follows this rule; only its content results use the full-text matcher.
## Testing and coverage
The GUI test structure (three tiers, lane map) is settled in the [GUI testing system reference](../../docs/testing.md); repo-wide policy in [docs/testing.md](../../docs/testing.md).