mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
1.7 KiB
1.7 KiB
PR9 — Work order comment @mentions
Jira
QA residual
- Parcial / Blocked-BE for notification + structured
mentions[]confirm; token chip polish = P1.
Summary
- Adds
@autocomplete to the internal comments composer on work order detail (/workorders/:id). - Encodes selected users as
@[userId:Display Name]tokens in comment text so mentions stay readable when the backend ignores the optional payload field. - Sends
mentions: string[]onPOST workorders/{id}/commentswhen the composer contains encoded tokens. - Highlights mentions in the comment thread using encoded tokens and/or
mentionsreturned by the API.
Out of scope
- Notification Center deep-linking for mention events.
- Backend notification triggers beyond the FE payload.
BE contract
See docs/work-orders/pending-be-contract.md (Comments section):
| Field | Status |
|---|---|
POST { text, mentions?: string[] } |
FE ready |
| Response includes mentions for highlight | FE ready |
Until BE confirms, encoded tokens in text preserve highlight behavior client-side.
Test plan
- Open a work order detail → Internal tab → type
@and pick a dispatcher from the list. - Submit comment; verify POST body includes
textwith encoded token andmentionsarray. - Reload detail; verify mention is highlighted in the thread (token and/or API
mentions). - Type
@mid-word (e.g. email) — autocomplete should not open. - Run
npm run verify.