Repository navigation
feat(custom-fields): add searchable option for custom fields - #584
Conversation
There was a problem hiding this comment.
ℹ️ No critical issues — a few minor suggestions inline, plus a small docs gap.
Reviewed changes
- Migration
000069_custom_field_use_in_search.sql— addscustom_field_definitions.use_in_search BOOLEAN NOT NULL DEFAULT FALSE. - API plumbing — threads
use_in_searchthrough the domain entity, create/update inputs, HTTP DTOs, handler, and the repository column list, INSERT, UPDATE and response mapping. - Task search —
applyTaskFilteradds anOR EXISTSover the project's flagged definitions, matching the stored JSON value withILIKE(array/object values via::text, scalars via->>). Existing title /#number/ content matching is unchanged. - Web — "Use in search" toggle in the create/edit dialogs, a new settings-table column, updated
CustomFieldDefinitiontypes and payloads, and translations for all 9 locales. - Docs & tests — schema and HTTP docs touched; new e2e
TestE2ETaskSearch_CustomFieldUseInSearch(real Postgres).
ℹ️ Custom-field examples in http-design.md don't show use_in_search
The API now returns use_in_search on every custom-field definition and accepts it on create, but neither the GET /custom-fields response example nor the POST /custom-fields request example was updated — only the PATCH "mutable fields" line and the schema doc were. The two examples are now stale.
Technical details
# Stale custom-field examples in docs/api/http-design.md
## Affected sites
- docs/api/http-design.md:1336-1352 — `GET /custom-fields` response example omits `use_in_search`.
- docs/api/http-design.md:1362-1372 — `POST /custom-fields` request example omits `use_in_search`.
## Required outcome
- The response and request examples reflect the `use_in_search` field the API
now reads and returns.deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (564b03c → bfae8f4). The new commit resolves all three inline threads and touches four files.
- Reworked the custom-field toggles to use the shared
Switch— the "Required" and "Use in search" toggles in the create and edit dialogs now render@/components/ui/switchinstead of the hand-rolled button, matching the pattern already used inPolicyEditor.tsxandJevSettings.tsx. - Simplified migration
000069— dropped theIF NOT EXISTSguard and the inaccurate "re-runs on startup" comment; a plain one-shotADD COLUMNis correct under the ledger-based runner. - Made the non-searchable e2e assertion meaningful — the unflagged field now stores
ONLY-IN-SECRETand the second subtest searchesonly-in-secret, rather than a value that returned nothing regardless of the flag. - Disambiguated the e2e switch selectors — the custom-fields spec now targets the toggles by accessible name, since two switches share the dialog.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (bfae8f4 → c69d57a, 5 files).
- MCP
use_in_searchsupport —useInSearchis now on thecreate_custom_field/update_custom_fieldzod schemas and their tool JSON schemas, threaded through the client payloads, added to theCustomFieldDefinitionand create/update input types, and surfaced in theget_custom_fieldformatter. This closes the gap the PR previously listed as out of scope. - Migration
000069adds a partial index —idx_custom_field_definitions_use_in_search ON custom_field_definitions (project_id) WHERE use_in_search, matching the search predicate, withIF NOT EXISTSguards on both statements (consistent with the repo's other migrations). - New unit test —
TestUpdateCustomFieldDefinition_UseInSearchcovers create setting the flag, an omitted field preserving it, and an explicitfalseclearing it. - Comment correction — the search-clause comment now notes that object JSON text also includes key names and punctuation.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Summary
Closes #576. Custom fields can now be flagged Use in search; when the task search box is used, it also matches the value stored in those fields (e.g. tracking numbers or client ids entered in a custom field).
Changes
API
000069_custom_field_use_in_search.sqladdscustom_field_definitions.use_in_search BOOLEAN NOT NULL DEFAULT FALSE(idempotent).use_in_searchis accepted on create/update and returned in the custom field definition response.applyTaskFilter) adds anOR EXISTSclause over the project's flagged definitions, case-insensitiveILIKEon the stored value. Array values (multi-select) are matched on their JSON text. Existing title /#number/ content matching is unchanged.Web
use_in_searchadded to theCustomFieldDefinitiontype and create/update payloads.Docs
database-schema.mdandhttp-design.mdupdated.Testing
TestE2ETaskSearch_CustomFieldUseInSearch(real Postgres): a flagged field's value is found case-insensitively; the same value in an unflagged field is not.go build, API unit tests, webtsc, Biome and the settings vitest suite pass.Notes
apps/mcp) types/tools don't exposeuse_in_searchyet.ILIKEper flagged field with no index, so it scans the project's tasks like the existing title search does.