Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .changeset/duplicate-banner-one-per-verdict.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
'hotcrm': patch
---

Split the lead detail page's duplicate banner into **one `record:alert` per
verdict**, so each one states the next step its verdict actually has.

### One banner could not state either next step

#1207 gated a single banner on `duplicate_status == "suspected"`; #1289 widened
it to every verdict the field carries. Widening was right, but a `record:alert`
carries one `visible` and one title/body pair, and `pickLocalized` picks by
LANGUAGE, not by row — so one component covering both verdicts had to choose
copy that named **neither**, or it would have mislabelled every lead in the
other state.

Since #1288 the two verdicts have opposite next steps:

| verdict | at conversion | what the rep should do |
|:--|:--|:--|
| `suspected` | warns, conversion **proceeds** | compare against the linked record, then convert or disqualify |
| `confirmed` | **refused** (`refuse_confirmed_duplicate`) | cannot convert — disqualify, naming the survivor |

So the neutral banner announced that something was wrong without saying what to
do, and the rep had to scroll to the Duplicate Status chip to find out which
situation they were in. The `confirmed` case was worse than that: nothing on the
record said the Convert button would refuse them, so they learned it by pressing
it.

### What ships

Two components, two predicates, two next steps, in all four locales. The
`confirmed` banner is the only place a rep is warned about the refusal before
they press Convert, and it ships at `error` severity — which the renderer maps
to `role="alert"` / `aria-live="assertive"` rather than the polite `role=
"status"` every other level gets. `suspected` stays `warning`, because
conversion still goes through.

A lead carrying a value neither option declares now raises **no** banner, where
the widened predicate raised the neutral one. That matches what the conversion
flow already does with such a row — its `e22` Clean edge converts it — so the
page and the flow now agree about the same lead.

⛔ Nothing here changes what the app refuses. That was ruled by #1288 and
shipped by PR #1555; this card changes only what the record page tells the rep.
203 changes: 139 additions & 64 deletions src/pages/lead_detail.page.ts

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/translations/en/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ export const appSurface: Omit<TranslationData, 'objects'> = {
title: '{first_name} {last_name}',
subtitle: '{company}',
components: {
lead_duplicate_alert: { label: 'Duplicate Flagged' },
lead_duplicate_alert_confirmed: { label: 'Confirmed Duplicate Alert' },
lead_duplicate_alert_suspected: { label: 'Suspected Duplicate Alert' },
lead_highlights: { label: 'Key Information' },
lead_path: { label: 'Lead Status Path' },
main_tabs: { label: 'Lead Information Tabs' },
Expand Down
3 changes: 2 additions & 1 deletion src/translations/es-ES/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ export const appSurface: Omit<TranslationData, 'objects'> = {
title: '{first_name} {last_name}',
subtitle: '{company}',
components: {
lead_duplicate_alert: { label: 'Aviso de duplicado' },
lead_duplicate_alert_confirmed: { label: 'Aviso de duplicado confirmado' },
lead_duplicate_alert_suspected: { label: 'Aviso de duplicado sospechoso' },
lead_highlights: { label: 'Información Clave' },
lead_path: { label: 'Progreso del Estado del Prospecto' },
main_tabs: { label: 'Pestañas de Información del Prospecto' },
Expand Down
3 changes: 2 additions & 1 deletion src/translations/ja-JP/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ export const appSurface: Omit<TranslationData, 'objects'> = {
title: '{first_name} {last_name}',
subtitle: '{company}',
components: {
lead_duplicate_alert: { label: '重複マークの警告' },
lead_duplicate_alert_confirmed: { label: '重複確定の警告' },
lead_duplicate_alert_suspected: { label: '重複の疑いの警告' },
lead_highlights: { label: '重要情報' },
lead_path: { label: 'リードステータスの進捗' },
main_tabs: { label: 'リード情報タブ' },
Expand Down
3 changes: 2 additions & 1 deletion src/translations/zh-CN/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ export const appSurface: Omit<TranslationData, 'objects'> = {
title: '{first_name} {last_name}',
subtitle: '{company}',
components: {
lead_duplicate_alert: { label: '重复标记提醒' },
lead_duplicate_alert_confirmed: { label: '已确认重复提醒' },
lead_duplicate_alert_suspected: { label: '疑似重复提醒' },
lead_highlights: { label: '关键信息' },
lead_path: { label: '线索状态进度' },
main_tabs: { label: '线索信息标签页' },
Expand Down
Loading
Loading