Skip to content

docs(sales): 用真实的视图名册重写 accounts / leads / contacts / quotes 四页的「标准列表视图」 - #768

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-758-list-view-rosters
Aug 5, 2026
Merged

yinlianghui merged 1 commit into
mainfrom
claude/issue-758-list-view-rosters

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #758

延续 PR #757(opportunities.mdx)的写法:以各对象的 src/views/*.view.ts 声明为唯一事实来源,逐个视图对账过滤条件、排序和入口,按现状描述行为,不为散文加钉子测试。四个页 × 三个语言 = 12 个文件,改动限定在列表视图小节 + 幽灵视图引用,其余小节没动。

逐页对账结果(基线 origin/main = c55aaf5)

四页没有一页是准确的,#758 的前提全部成立:

页 文档原先写的 仓库里真正声明的
accounts My Accounts、All Customers、Top Accounts by Revenue、Inactive Accounts、By Industry、Recently Updated All Accounts、Account Cards、Accounts by Location、Enterprise Accounts、My Accounts、🔄 Upcoming Renewals、⚠️ At-Risk Accounts(7 个,全部在 list.tabs 里,可达)
leads My Open Leads、Hot Leads、Today's Follow-ups、Recently Created、By Source All Leads、My Leads、🔥 Hot Leads、High Priority、Suspected Duplicates、Lead Pipeline、Lead Calendar、Lead Cards(8 个;该列表没有 tabs,切换器列出全部)
contacts My Contacts、Primary Contacts、Decision Makers、By Title、Recently Added All Contacts、People Directory、Primary Contacts(3 个)
quotes My Quotes、Active Quotes、Expiring This Week、Won Quotes、By Account All Quotes、Quote Pipeline、Quote Calendar(3 个)

对得上的只有 accounts 的 My Accounts、leads 的 Hot Leads(名字对、阈值写错)和 contacts 的 Primary Contacts。

散文里的幽灵视图(#757 同款顺带清扫)

  • leads.mdx 给销售代表的提示曾写「填下次跟进日期——它驱动 Today's Follow-ups 视图」。该视图不存在;这个日期真正驱动的是 🔥 Hot Leads 的排序,且由 lead_assignment 在入库时盖章(四星及以上明天、其余三天后),schedule_followup 会按新建任务的到期日重新盖章。三个语言页都已改写。
  • leads.zh-Hant.mdx:81 把视图叫「疑似重複潛在客戶」,语言包里是「疑似重复线索」——改为「疑似重複線索」,并在小节开头一句说明:视图名依产品界面中文名写作「線索」,与本页行文的「潛在客戶」是同一件事。
  • leads.mdx:81 / zh-Hans 引用的 Suspected Duplicates 视图核对属实(lead.view.ts:398),未动。

三处值得单独看的实测结论

  • 🔥 Hot Leads 按现状写,不按直觉写。 它的过滤是 rating >= 4.5(lead.view.ts:358),而 rating 是 Field.rating(5)、打分钩子 Math.round 到整星,所以它实际上是五星队列;四星线索在 High Priority 里。文档因此明确写「四星的线索没有丢,它在 High Priority」。阈值本身与路由流 Hot Lead (rating ≥ 4) 的分叉是 src 侧问题,另立 🔥 Hot Leads 视图的 rating ≥ 4.5 与整星评分/路由流的「hot = rating ≥ 4」不一致:被判定为 hot、发了告警的四星线索永远进不了这个队列 #766,本 PR 不碰 src/**。
  • Enterprise Accounts 是营收切,不是客户分层。 annual_revenue >= 10000000(account.view.ts:129),与 tier: 'enterprise' 无关——种子数据里 Acme(tier=enterprise、营收 500 万)就不在这个视图里。文档写明了这一点。同理 Accounts by Location 的图钉取自 office_location,不是账单地址。
  • 空列表按声明解释,不编空态文案。 Upcoming Renewals / At-Risk Accounts 都先按 type = customer 过滤,再读手工维护、无默认值的 health_score / next_renewal_date——空是数据缺口而非过滤条件坏了,页面这样写。Quotes 三个视图都没有声明 emptyState,而报价只能从商机生成,所以新组织看到的就是一张空网格;文档如实说明,没有替它虚构一段解释文案(与 opportunities 的 closing_this_quarter 有真实 emptyState 的情况不同)。

语言

英文页用 metadata label;zh 页用 src/translations/zh-CN.ts 的 _views 译名(zh-Hant 为对应繁体写法),跨节链接按语言前缀。机械核对:四个对象声明的全部 21 个视图名在对应英文页中均出现;21 个中文/繁体译名在对应 zh 页中均出现;原先 18 个不存在的视图名在 12 个文件里已一个不剩。

验证

pnpm hygiene    ✓ source hygiene clean(含 no raw control bytes)
pnpm typecheck  ✓ tsc --noEmit 无输出
pnpm test       Test Files 62 passed (62) / Tests 1475 passed | 1 skipped (1476)

首轮 pnpm test 是红的,而且红得有价值:docs-drift.test.ts 的 callout 平价守卫抓到我在 zh-Hant 版 leads 页多加了一个 > … 说明框(3 vs 英文页的 2)。那段说明是繁体页特有的术语提示,不是「别人踩过的坑」,因此并入小节开头的正文而不是保留成 callout——不是为了让检查变绿而删英文页的框。第二轮全绿。

变更集:.changeset/sales-list-view-rosters.md。未触碰 content/docs/releases/、opportunities.mdx(#757 刚定稿)、guides/**(#756 在飞)、index.mdx 与 src/**;平台版本保持 17.0.0-rc.2。

顺带发现(均已另立单,本 PR 不修)


Generated by Claude Code

…ections against the shipped views (#758)

The "Standard list views" section on all four pages (and their zh-Hans /
zh-Hant siblings) listed views that do not exist. Accounts named five
phantoms and omitted every one of Account Cards, Accounts by Location,
Enterprise Accounts, Upcoming Renewals and At-Risk Accounts; Contacts and
Quotes advertised five views where three exist; Leads advertised five, one
of which was real.

Each roster is now measured against the object's *.view.ts declaration --
filter, sort and entry point per view -- plus the behaviour that makes an
empty list readable: the two account customer-success queues are scoped to
Type = Customer and read hand-maintained fields, and a fresh org has no
quotes at all until the first Generate Quote.

Two corrections worth calling out:

- Hot Leads is documented as it behaves. Its cut is 4.5 stars against a
  whole-star rating, so it is the 5-star queue; a 4-star lead is on High
  Priority. The old page called Hot Leads "rating >= 4 stars", which is
  the other view's filter. The threshold divergence itself is filed
  separately -- the docs describe the current behaviour.
- The rep tip pointing at a nonexistent "Today's Follow-ups" view now says
  what the Next Follow-up Date really drives: the sort order of Hot Leads,
  stamped on intake and re-stamped by Schedule Follow-up.

Enterprise Accounts is also clarified as a revenue cut (>= $10M), not the
Customer Tier field, and the map plots Office Location, not the billing
address.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 5, 2026 6:18pm

Request Review

@yinlianghui
yinlianghui marked this pull request as ready for review August 5, 2026 18:23
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 440db01 Aug 5, 2026
9 checks passed
yinlianghui added a commit to yinlianghui/hotcrm that referenced this pull request Aug 10, 2026
…≥ 4) (objectstack-ai#774)

* fix(leads): one definition of "hot" — align the Hot Leads view to the routing flow (objectstack-ai#766)

The `hot_leads` list view cut at `rating >= 4.5` while the `lead_assignment`
flow's hot branch (edge `e2`) cuts at `>= 4`. `rating` is a whole-star field —
`lead.hook.ts` rounds the computed score, `Field.rating(5)` renders as a star
widget with no half steps, and the one seeded 4.5 was deleted for the same
reason (objectstack-ai#591) — so `>= 4.5` was `== 5` on every row that can exist.

A 4-star lead was therefore routed hot, stamped with the 1-day SLA, and its
owner alerted "Hot lead — assign within 24h", while the queue that alert points
at could never contain it.

The flow is the semantics producer (its verdict has user-visible consequences),
so the view follows it: threshold `>= 4`. The comment crediting an
`auto_flag_hot_lead` workflow is removed — no such automation exists in this
repo — and replaced with a reference to the real producer.

`test/hot-lead-threshold-parity.test.ts` derives both thresholds from the
shipped metadata and pins their agreement, including a truth table that asks
the real AutomationEngine and the real view filter, for every rating a lead can
carry, whether "routed hot" and "in the queue" give the same answer.

Docs: the Hot Leads / High Priority rows on leads.mdx and its zh-Hans /
zh-Hant siblings described the pre-fix behaviour (objectstack-ai#768 wrote them against the
old threshold) and now match what ships.

Fixes objectstack-ai#766

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa

* test(leads): drop the unused high_priority binding from the parity guard

CodeQL flagged `highPriorityView` as unused, and it was: the file compares the
hot_leads threshold against the lead_assignment hot branch, and high_priority
carries no part of that invariant.

Removed rather than given an assertion to justify it. Post-objectstack-ai#766 high_priority
holds the same filter as hot_leads, so the only assertion available would pin
that sameness — a guard over an open product decision (objectstack-ai#775: merge the two
views, or re-differentiate high_priority on a non-rating criterion), either
outcome of which would turn it red with nothing broken. A comment now records
why the binding is absent, so the next reader does not re-add it.

No assertion changed: 16 tests before and after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

同一缺陷类:accounts / leads / contacts / quotes 四个 sales 页的「标准列表视图」列的也是仓库里不存在的视图名

2 participants