Skip to content

test(i18n): case and deal milestone rows read in the organization's language (#2817) - #2891

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-2817-milestone-summaries-locale
Dec 1, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-2817-milestone-summaries-locale

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Part of #2817

Clause-②: no
Metadata-protocol: none
Metadata-impact: reviewer — no metadata under src/ changes; one new test and one empty-frontmatter changeset

维护者速读

  • 用户能看到什么变化:用户无感。工单升级、解决、关闭和商机赢单、输单这五条时间线记录,在中文组织里已经显示中文(随升级到 ObjectStack 19 一起上线),这次只补一个测试把它固定下来。
  • 为什么做:属于「记录时间线跟随组织语言」这张卡的里程碑那一半;记录通话、记录会议那一半由另一张在做的卡负责。
  • 出错会怎样:只加测试,不改任何应用内容;万一以后有人删掉或写错这五条译文,测试会变红,用户侧没有任何影响,随时可撤回。
  • 要你做什么:无。

What changes

The milestone half of #2817 turned out to be delivered already. #2820 (c6e64ee, the move to ObjectStack 19) added objects.OBJECT._milestones.FIELD.VALUE.summary to the zh-CN, ja-JP and es-ES packs for all five rows: case escalated, resolved and closed, and deal won and lost. The platform slot from objectstack#37524 (PR objectstack-ai/objectstack#37582) ships in the 19.0.0-next.3 pin. Nothing pinned it, so this PR adds one suite:

  • test/org-locale-milestone-timeline.test.ts boots the shipped app twice, once per organization language (zh-CN, en). Each boot sets the organization's Localization language through PUT /api/settings/localization, the route the Setup page writes. It drives the five transitions as real people (a service agent on a case, a sales rep on two deals) and reads sys_activity as that person. A zh-CN organization reads the zh-CN pack template with its {subject} / {name} token filled. An en organization reads the authored sentence. Each expected value comes from the object's activityMilestones and the pack, not from hard-coded literals.
  • .changeset/2817-milestone-timeline-locale.md is an empty-frontmatter changeset, because nothing ships to users.

No file under src/ changes, including case.object.ts and opportunity.object.ts, so this PR cannot conflict with #2870's opportunity edit.

The Log a Call / Log a Meeting summary half of #2817 is carried by #2582 (src/sales/actions/activity-actions.ts) and is not touched here. Whichever of the two lands last closes the card.

Read first (by risk):

  1. test/org-locale-milestone-timeline.test.ts: the beforeAll settings write and the contextFor locale assertion. The suite depends on these: the reader's language comes from the organization setting, not from the app default (see Acceptance notes).
  2. test/org-locale-milestone-timeline.test.ts: milestoneRows, which drops the created row and sorts by timestamp.

Two-minute check: pnpm exec vitest run test/org-locale-milestone-timeline.test.ts. Expect 6 passed: three per organization (the case escalated, resolved and closed; the deal won; the deal lost).

Tests

  • New suite: 6 passed (zh-CN 3, en 3) on the merged head ebc018a.
  • Ablation (the suite's own behaviour). I wrote en as the zh-CN organization's Localization language and dropped the locale assertion, which would otherwise trip first. The zh-CN half went red, 3 failed / 3 passed, receiving Case escalated — Line down 1 where 工单已升级 — Line down 1 was expected, and Deal won — Milestone Deal 2 where 赢单 — Milestone Deal 2 was expected. After restoring, the file was byte-identical (compared against the kept copy).
Local readings
  • pnpm exec vitest run --maxWorkers=2 test/org-locale-milestone-timeline.test.ts on ebc018a: Test Files 1 passed (1), Tests 6 passed (6), VERDICT command-exit 0.
  • pnpm exec tsc --noEmit on ebc018a: exit 0, no error TS. --listFiles on 25976c5 lists the new test, so typecheck covers it.
  • pnpm hygiene: exit 0, source hygiene clean.
  • Probe before writing the suite (not committed), on 19.0.0-next.3. A zh-CN organization member read 工单已升级 / 工单已解决 / 工单已关闭 — SUBJECT and 赢单 / 丢单 — NAME, and an en organization member read the authored sentences. In both organizations the stored row read as the system is the authored English sentence.

Acceptance notes

  • Premise: the card's milestone half says the five summaries are English in a zh-CN organization. That held on 18.6.0, when the card was filed. On main at 19.0.0-next.3 it no longer holds, because feat!: move to ObjectStack 19.0.0-next.2 and protocol 19 #2820 already translated them. What this PR adds is the pin.
  • The reader's language comes from the organization setting, not the app's default language (observation, measured; no card). The platform composes the row at read time from the request context's locale. That locale is the organization's Localization setting, else en-US, and an Accept-Language header overrides it per request. The app's i18n.defaultLocale is not consulted. A boot declaring defaultLocale: 'zh-CN' with no Localization setting gave a member context locale en-US, and the member read Case escalated — …. Stored text written through ctx.text (zh-CN org: automatic case escalation writes English reasons ("Auto-escalated: critical priority", "... SLA due date breached") #2494, zh-CN org: tasks created automatically carry English subjects ("Activate new customer for opportunity …", 5 hooks and flows) #2522) falls back to the app default instead, so the two can disagree in an organization whose admin never set the Localization language. The platform documents the ctx.text fallback only, and I found no declared contract for the reader fallback, so I filed nothing. carrier: none.
  • The stored sys_activity.summary stays the authored English sentence by platform design (objectstack#37582). Only person reads are composed in the reader's language.
  • Not measured: browser verification of the console timeline. In particular, I did not check whether the console sends Accept-Language from its UI language.

Verification

  • CI runs the full pnpm verify chain (validate, typecheck, lint, hygiene, build, test). Locally I ran the new suite, typecheck and hygiene. validate, lint and build read only src/ and config, which this diff does not touch.

🤖 Generated with Claude Code

https://claude.ai/code/session_017xRBcUpajguxop2zMyDN9K

…anguage

The five activity-milestone timeline rows (case escalated, resolved,
closed; deal won, lost) are translated in the zh-CN, ja-JP and es-ES packs
under objects.OBJECT._milestones.FIELD.VALUE.summary since the move to
ObjectStack 19 (#2820), and the platform composes the row at read time in
the reader's language (objectstack#37524).

Nothing pinned it. This suite boots the app twice, sets the organization's
Localization language through the Settings route (the reader's language
falls back to en-US, not to the app's i18n.defaultLocale), drives each
transition as a person, and reads the timeline as that person: zh-CN reads
the pack template with its token filled, en reads the authored sentence.

Claude-Session: https://claude.ai/code/session_017xRBcUpajguxop2zMyDN9K
@vercel

vercel Bot commented Dec 1, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Dec 1, 2026 12:28pm UTC

Request Review

@github-actions github-actions Bot added the ci/cd CI plumbing and the verification pipeline label Dec 1, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:hotcrm@sunhaolin · sunhaolin · session_017xRBcUpajguxop2zMyDN9K

席位核对 · L1 ACCEPT · head ebc018ad9f · 2026-12-01T12:40Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 1, 2026 12:40
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 9a8da44 Dec 1, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants