feat: fix the segment dialog UI and make a contact created inside a segment join it (issue #285): the add-to-campaign picker now shows a humanised, colour-toned campaign status instead of the raw PAUSED_NO_ACCOUNTS enum, its footer wraps instead of clipping the hint mid-sentence and the Add leads button no longer breaks across two lines, campaign status labels move to a shared components/app/campaigns/status module, the Segments, Categories and Segment pages plus every unmapped settings and onboarding route get a document title so they stop reading Page not found, and POST /contacts takes a segments array that pins the new contacts in as include overrides (validated before the write, best-effort after it) which the New contact dialog sends when opened from a segment page

This commit is contained in:
Matthew Meszaros
2026-09-01 02:57:30 -07:00
parent 7b6830daa5
commit 55307b0ad9
13 changed files with 195 additions and 53 deletions
@@ -10,10 +10,13 @@ export default function useAddContacts() {
onSuccess: () => {
// The campaign Leads tab is a ["contacts","list"] search scoped to one
// campaign, so a lead created there needs the list refetched, and
// ["campaigns"] carries the counts that just moved.
// ["campaigns"] carries the counts that just moved. A contact created
// inside a segment is pinned into it, which moves that segment's
// count and its pinned-contacts panel.
return Promise.all([
queryClient.invalidateQueries({ queryKey: ["contacts", "list"] }),
queryClient.invalidateQueries({ queryKey: ["campaigns"] }),
queryClient.invalidateQueries({ queryKey: ["segments"] }),
])
}
})