feat(contacts): free-text Title/Department with server-sourced suggestions (PMS-583) #390

Merged
longjacksonle merged 1 commit from feat/PMS-583-contact-field-suggestions into main 2026-06-30 18:21:18 +02:00

PMS-583 (frontend half)

Title and Department on the contact form stay free-text, but now suggest from the tenant's own past entries (server-sourced, not browser cache, not a fixed dropdown). This is the agreed direction from the ticket discussion: job titles in particular are open-ended, so a closed dropdown is the wrong tool; the suggestion list nudges consistency without blocking new values.

Change

  • New reusable SuggestInput component (src/components/suggest_input.rs): wraps the shared Input and adds a server-fed suggestion dropdown. Modelled on CompanyPicker but it never forces selection. Typing updates the value directly; picking a suggestion just fills the text. Fetches GET /contacts/field-values?field=<field>&q=<text> and lists the matches; a suggestion equal to the current text is dropped.
  • Wired into the contact form's Title (field: "title") and Department (field: "department") fields, each with help text noting the values come from the workspace.

No migration

Existing free-text values are exactly what the endpoint suggests from. Nothing to migrate.

Dependency

Needs the mokosh-server GET /contacts/field-values endpoint (companion PR). The dev server is already running that branch, so this is testable end to end now.

Test

Contacts -> New (or edit) -> focus Title and type a letter that matches existing titles: a dropdown of the workspace's past titles appears; click one to fill, or keep typing a brand-new title (preserved). Same for Department.

🤖 Generated with Claude Code

## PMS-583 (frontend half) Title and Department on the contact form stay free-text, but now suggest from the tenant's own past entries (server-sourced, not browser cache, not a fixed dropdown). This is the agreed direction from the ticket discussion: job titles in particular are open-ended, so a closed dropdown is the wrong tool; the suggestion list nudges consistency without blocking new values. ## Change - New reusable `SuggestInput` component (`src/components/suggest_input.rs`): wraps the shared `Input` and adds a server-fed suggestion dropdown. Modelled on `CompanyPicker` but it never forces selection. Typing updates the value directly; picking a suggestion just fills the text. Fetches `GET /contacts/field-values?field=<field>&q=<text>` and lists the matches; a suggestion equal to the current text is dropped. - Wired into the contact form's Title (`field: "title"`) and Department (`field: "department"`) fields, each with help text noting the values come from the workspace. ## No migration Existing free-text values are exactly what the endpoint suggests from. Nothing to migrate. ## Dependency Needs the mokosh-server `GET /contacts/field-values` endpoint (companion PR). The dev server is already running that branch, so this is testable end to end now. ## Test Contacts -> New (or edit) -> focus Title and type a letter that matches existing titles: a dropdown of the workspace's past titles appears; click one to fill, or keep typing a brand-new title (preserved). Same for Department. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(contacts): free-text Title/Department with server-sourced suggestions (PMS-583)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 1m20s
Create release / Create release from merged PR (pull_request) Has been skipped
bb5c534029
Title and Department on the contact form stay free-text, but now offer a suggestion list drawn from the tenant's own past entries (via GET /contacts/field-values), not the browser's autofill cache and not a fixed dropdown. Picking a suggestion fills the text; typing any new value is preserved. This nudges consistency without blocking the open-ended values (job titles especially) that a closed dropdown would fight.

Adds a reusable SuggestInput component (wraps the shared Input + a server-fed suggestion dropdown, modelled on CompanyPicker but never forcing selection) and wires it into the contact form's Title and Department fields. No data migration: existing values are exactly what the endpoint suggests from.

Companion to the mokosh-server PR that adds the field-values endpoint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/PMS-583-contact-field-suggestions 2026-06-30 18:21:18 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!390
No description provided.