Repository navigation
fix(platform-objects): title a unit of measure by its label, not its code - #39712
Conversation
…code sys_unit declared code as nameField/displayNameField, so the create toast and every record title showed JIN1 for a unit labelled 斤. Both pointers now name label, matching sys_email_template and sys_personal_view. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV
📓 Docs Drift CheckThis PR changes 1 package(s): 14 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1659d62be4abe44ba48e417240ddd9967f412120 && git checkout 1659d62be4abe44ba48e417240ddd9967f412120
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8e4dda438d8551af73553caadbf5935f217ee4c3 f577f2f56fb96844bfe6eabd40f21ce958c3a51c && git checkout -B drift-repro 8e4dda438d8551af73553caadbf5935f217ee4c3 && git merge --no-ff f577f2f56fb96844bfe6eabd40f21ce958c3a51c
node scripts/docs-audit/affected-docs.mjs --json 8e4dda438d8551af73553caadbf5935f217ee4c3
|
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4d1cnRvyiAqrarmDhZV Final head for L1 · 2026-12-04T14:41Z · zone em-admin
|
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR 2026-12-04T14:43Z · L1-a verdict: ACCEPT at head 席位核对Change. Test. Changeset. Gates.
L2. Not owed. |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4d1cnRvyiAqrarmDhZV Landing · 2026-12-04T14:44Z · zone em-admin |
Requested by Elon · project thread
Fixes #39658
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
sys_unitdeclaredcodeas its title (nameFieldanddisplayNameField). Both now namelabel, the required "name shown beside a quantity in this unit". This followssys_email_templateandsys_personal_view, and matches ADR-0079's "a record's human name". A quantity still stores and names its unit by code (ADR-0158 U4); only the unit row's own title changes.sys_standard_unit_settingandsys_exchange_rateare untouched, and so is item 12b (the ratio's 12-decimal display).Nothing reads
sys_unit's title as a code. No reference field points atsys_unit, and the console's unit display (ui/packages/core/src/utils/unit-display.ts) reads thelabelcolumn by name, not through the title pointer. No test pinnedcodeas the title. No generated artifact carries these two declarations.Read first (by risk):
packages/platform-objects/src/system/sys-unit.object.tslines 125-126: the two-pointer change.packages/platform-objects/src/system/sys-unit.object.test.ts: the new pin, which also asserts thatlabelstays required, so the title can never be empty.Two-minute check:
pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2 src/system/sys-unit.object.test.tsshould report 31 passed. In a running console, create unit 斤 (code JIN1): the toast should read 「计量单位"斤"已创建」.Tests
sys_unitis titled bylabel(nameField,displayNameField), andlabelis required.nameFieldto'code'on disk, and the pin turned red (Expected: "label",Received: "code", 1 failed / 30 passed). Then I restored it.Package suite and typecheck, at f577f2f
pnpm --filter @objectstack/platform-objects test: Test Files 137 passed (137), Tests 2458 passed (2458), command-exit 0 under os-verify-lock. The package was built first: its own suite self-imports@objectstack/platform-objects/systemfromdist, and the first run without that build failed on exactly that import.pnpm --filter @objectstack/platform-objects typecheck: exit 0 (check:test-typecheck: OK).pnpm --filter '@objectstack/platform-objects^...' build: dependency closure built.Acceptance notes
descriptionstill says "named by a code in the organization namespace". That describes the code namespace, not the title. It is outside this card's file surface and I left it unchanged.Verification
Derived gate subset (dispatch-gates --commands, at f577f2f)
dispatch-gates --ran:65 derived famil(ies) accounted for).check:dual-build-cjs-loadsandcheck:lean-entry-closure(they need a workspace-widedist),check:i18n(the CLI is not built),check-plugin-teardown-shape --self-test(shallow clone). CI runs these.check-comment-mask-corpus,check:query-options-erasure,check:slot-lookup,check:type-check-debt. CI runs these.check:nul-bytes: exit 0.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4d1cnRvyiAqrarmDhZV