fix(contacts): bind list Role column to contact_type, not title #230
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-368-contact-role-column-rebind"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The contact list "Role" column header did not match its cell data. The cell rendered each contact's free-text
title(a job title like "IT Manager") under a header that reads Role, so the header and the data disagreed about which field the column shows (PMS-368, external Claude Chrome review #2 finding #11).Fix
contact_type(Primary / Technical / Billing / Other) is the field that actually classifies a contact's role, and the server already serializes it on the contact response. Bind the column tocontact_typeand keep the existing "Role" header. This is scenario (b) from the issue: the header was correct, the binding had drifted.Both contact lists are corrected because both decode the shared
RemoteContactstruct:Reuses the existing
humanize_contact_typehelper for the label. The now-unusedtitlefield is dropped fromRemoteContact; the free-text title is still surfaced on the contact detail page, which decodes its own struct.Scope
mokosh-apps only. No server change needed: the wire already carries
contact_type(snake_case) on theContact/ContactResponseshape. PMS-368 was filed against mokosh-server but the bug is entirely in the frontend.Tests
contact_type_humanizes_canonical_setcovering the canonical set plus pass-through of unknown/empty values.cargo fmt --all --check,cargo clippy --target wasm32-unknown-unknown --lib -- -D warnings, and the lib test suite all pass.Follow-up (AC #2, not in this PR)
The issue also asks for a sweep of other list pages (tickets, companies, projects, assets, invoices) for header/cell drift. Not done here; worth a separate pass.
#PMS-368