Skip to content

fix(crm): show retired stage names in list cells - #6041

Merged
synoet merged 2 commits into
mainfrom
synoet/crm-negotiation-stage-label-d71e
Aug 30, 2026
Merged

synoet merged 2 commits into
mainfrom
synoet/crm-negotiation-stage-label-d71e

Conversation

@synoet

@synoet synoet commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Why

PR #4822 trimmed Qualified, Trial, and Negotiation out of the default stage picker. Group headers still resolve those ids through getPropertyOptionLabel, so a Negotiation group still says Negotiation. List cells go through soupPropertyToProperty → formatPropertyValue → formatOptionValueById, and that last step used only property.options. After the trim, SYSTEM_PROPERTY_OPTIONS for Stage is COMPANY_STAGE_OPTIONS (Lead, Demo, Customer, Churned). A stored Negotiation id therefore printed as 00000001-0000-0000-0010-000000000005.

The picker should stay trimmed. The Set-stage modal reads property.options. Putting ALL_COMPANY_STAGE_OPTIONS back on SYSTEM_PROPERTY_OPTIONS would offer retired stages again.

Scope

formatOptionValueById in apps/web/src/features/property/utils/formatting.ts still prefers a match in property.options. If that list has no match, it asks getPropertyOptionLabel before it falls back to the raw id.

apps/web/src/features/entity/extractors-property/property-helpers.test.ts formats Lead, Demo, Customer, Churned, Qualified, Trial, and Negotiation through soupPropertyToProperty + formatPropertyValue.

Out of scope: the Set-stage modal, backend option lists, and group-header labeling.

Tradeoffs

Display labels and picker options stay on two catalogs. ALL_COMPANY_STAGE_OPTIONS is the label table. COMPANY_STAGE_OPTIONS is the picker set. A one-list change would be smaller and would put retired stages back in the modal.

The import is @entity/utils/task-properties, not the @entity barrel, so the extractors → @property/utils cycle does not close.

Blast Radius

Any select cell that formats through formatPropertyValue now can show a catalog label for an id missing from property.options. Unknown ids still print as ids. Current picker stages are unchanged.

CRM users who still have Negotiation, Qualified, or Trial on a company see the name in the list cell, matching the group header.

Verification

Isolated vitest on property-helpers.test.ts: 7 passed, including the three retired stage ids.

Customers list on the local stack, List mode, Group by Stage. gloxco Stage cell shows Negotiation, not the option id. OSC still shows Customer. Qualco and Trialco show Qualified and Trial.

gloxco Stage cell shows Negotiation
customers_list_retired_stage_cells_show_names.mp4

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 30, 2026 00:52
List Stage cells resolve labels from soupPropertyToProperty options.
Qualified, Trial, and Negotiation are retired from that catalog and
currently render as the option UUID.

Co-authored-by: teo <synoet@users.noreply.github.com>
formatOptionValueById now uses getPropertyOptionLabel when the
attached option catalog omits a known system id. Group headers
already did this. Negotiation, Qualified, and Trial keep their
names in Stage cells after the default set was trimmed.

Co-authored-by: teo <synoet@users.noreply.github.com>
@cursor

cursor Bot commented Aug 30, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai

coderabbitai Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5869191f-29d9-4c13-9389-0a78efd9582b

📥 Commits

Reviewing files that changed from the base of the PR and between e56ac85 and 39de836.

📒 Files selected for processing (2)
  • apps/web/src/features/entity/extractors-property/property-helpers.test.ts
  • apps/web/src/features/property/utils/formatting.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved formatting for property option values by displaying the appropriate label when available, with a reliable fallback for unmatched options.
  • Tests

    • Added coverage to verify that system stage options are consistently displayed using their expected labels.

Walkthrough

Updated property option formatting to resolve labels through the shared property-option lookup when option data is unavailable. The formatter still formats matching options and falls back to the raw option ID. Added parameterized tests for all supported stage option IDs through soupPropertyToProperty and formatPropertyValue.

Merge Risk: ⚪ Minimal · up to 39de8

The change restores readable labels for retired CRM stages without re-enabling those stages in the picker or changing stored data, APIs, permissions, or deployment behavior; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the conventional commits format, describes the CRM stage-label fix, and is 48 characters long, which is under the 72-character limit.
Description check ✅ Passed The description clearly explains the retired stage-label issue, the formatting change, test coverage, scope, tradeoffs, and verification results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@synoet
synoet marked this pull request as ready for review August 30, 2026 02:10
@github-actions

Copy link
Copy Markdown

@synoet
synoet merged commit e5ab324 into main Aug 30, 2026
43 of 46 checks passed
@synoet
synoet deleted the synoet/crm-negotiation-stage-label-d71e branch August 30, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants