Repository navigation
Commit dc4a2cd
Part of #39043
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
-
管理员打开「组织基本信息」表单时:组织还叫系统默认名,名称栏仍是空的,但栏下多一行字说明现在用的是默认名、请填自己的名字;已有自己的名字时照旧预填、不显示这行。
- 属于首次使用清单的体验收尾,按你对第二问「B 留空加说明」的裁决实现;开发模式自动写入时区货币的另一半走单独的 PR。
- 出错最多是这行字该出现时没出现或不该出现时出现,保存规则没动,撤回这个改动即可恢复原样。
- 无
## What changes
This PR does not close the card: half A is still open, and the seat
closes the card by hand once both halves have merged.
Half B of the ruling on the card above (ruling comment 7359875657,
"Ruled terms, B (organization name)"). Half A, retiring the plugin-auth
development seeds, rides its own PR (#39302) on branch
`claude/issue-39043-dev-seeds-retired`; this PR touches nothing under
`packages/plugins/**` or `docs/qa/**`.
- `ui/apps/console/src/pages/settings/FirstRunChecklist.tsx`: while the
organization's stored name is the platform's (`isOrganizationNamed`
false and the name non-empty), the basics form passes one line to the
name field through `SettingsField`'s existing `note` prop. The line
names the current name and asks for the organization's own. With a name
of its own the field is prefilled as before and no line is drawn. It is
a line under the field, wired into the input's `aria-describedby` by the
field itself, not a placeholder. The shared settings field component is
unchanged, and so are the Save rule and its sentence.
- `ui/packages/i18n/src/locales/*.ts`: one new key,
`console.firstRunChecklist.organizationBasics.defaultNameNote`
(interpolates `name`), in the 11 locale packs that carry the
`firstRunChecklist` block: ar, de, en, es, fr, ja, ko, pt-BR, ru,
zh-Hans, zh-Hant. The other three files in that directory (`index.ts`,
`registry.ts`, `rtl.ts`) are not packs. zh-Hant is regenerated from
zh-Hans with `gen:zh-hant`, not hand-written. The zh-Hans text is the
line the maintainer approved on the decision card, with the current name
interpolated.
- `Clause-②: yes (widening)`: the claim carried `no`, on the condition
that this be measured. `@object-ui/i18n` exports `TranslationKeys =
typeof en`. After a build, `ui/packages/i18n/dist/locales/en.d.ts`
carries `readonly defaultNameNote: ...` in that type, so the published
type surface gains one key. That makes it a widening. Metadata protocol:
none. Level: patch.
- Changeset: `.changeset/39043-org-name-default-line.md`
(`@object-ui/console`, `@object-ui/i18n`, patch).
Read first, in order of risk:
1. `FirstRunChecklist.tsx`, the `defaultNameNote` hunk: the condition
that decides when the line shows.
2. `__tests__/FirstRunChecklist.test.tsx`: the new top-level describe
pins both directions.
3. `zh-Hans.ts` / `en.ts`: the wording of the line. Round 2 (head
eea94d3) rewords es/fr/pt-BR to "the name of your organization" (the
earlier wording read as "proper noun") and points the code comment at
`onSave` below.
## Tests
The new pin is a top-level `describe` in the existing harness
`ui/apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx`.
AGENTS.md puts a new pin for a component that already has a shared
harness file into that file. It covers four cases:
- platform name: the field is empty, the line names 「Default
Organization」, the placeholder does not, and the input's
`aria-describedby` includes the line;
- real name: the field is prefilled with 「Acme」 and no line is drawn;
- Save rule unchanged: typing the platform name is refused with the same
sentence, the line stays beside the refusal, and nothing is written;
- zh: the line reads in Chinese and still names the current name.
<details><summary>Readings</summary>
- `pnpm --dir ui exec vitest run --maxWorkers=2
apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx` →
`Tests 99 passed (99)`
- `pnpm --dir ui exec vitest run --maxWorkers=2 packages/i18n/
apps/console/src/pages/settings/` → `Test Files 156 passed (156)`,
`Tests 2388 passed | 13 skipped (2401)`
- Ablation 1 (`node scripts/ablation-replace.mjs`, deletes the
`note={defaultNameNote}` prop): 3 of the 4 new cases red (platform name,
Save rule, zh); the real-name case stays green, as it should. Restored:
blob equals HEAD and `git diff HEAD` is empty.
- Ablation 2 (removes the `!basics.named &&` guard so the line is always
drawn): the real-name case is red, the other 3 green. Restored the same
way.
- `pnpm --filter @object-ui/i18n type-check` → exit 0
- `pnpm --dir ui exec vitest run scripts/` → `Tests 5161 passed | 2
skipped`
- `pnpm check:new-line-citations` (under `ui/`) → `0 new citation(s)`
</details>
## Acceptance notes
- Screenshot of the form both ways: NOT MEASURED. The console was not
booted; the two-way render is pinned in jsdom by the tests above.
- Console `tsc --noEmit`: NOT MEASURED locally, because the
`@object-ui/*` closure is not built in this container (every error is a
missing-module or implicit-any error caused by that). CI's `Type Check
UI` lane owns it.
- `pnpm check:query-options-erasure`: NOT MEASURED locally (killed by a
250 s timeout on a shared box); CI runs it.
- The line shows when the stored name is the platform name. An
organization whose stored name is empty gets no line, because there is
no current name to show; the field is empty and Save asks for a name as
before.
## Verification
Two-minute check: `pnpm --dir ui exec vitest run
apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx -t
"the name field while"` → 4 passed. In a running console on a fresh
database: Setup, 系统概览, 组织基本信息, 设置. The name field is empty and the line
under it reads 「现在用的是系统默认名“Default Organization”,请填你们自己的名字。」.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CbFgiyGToVRBFwedwF)_
<!-- signed: repo:objectstack@os-bill · os-bill ·
session_01Utp6CbFgiyGToVRBFwedwF -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 211c1aa commit dc4a2cd
14 files changed
Lines changed: 94 additions & 0 deletions
File tree
- .changeset
- ui
- apps/console/src/pages/settings
- __tests__
- packages/i18n/src/locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
279 | 290 | | |
280 | 291 | | |
281 | 292 | | |
| |||
368 | 379 | | |
369 | 380 | | |
370 | 381 | | |
| 382 | + | |
371 | 383 | | |
372 | 384 | | |
373 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
684 | 731 | | |
685 | 732 | | |
686 | 733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2860 | 2860 | | |
2861 | 2861 | | |
2862 | 2862 | | |
| 2863 | + | |
| 2864 | + | |
2863 | 2865 | | |
2864 | 2866 | | |
2865 | 2867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2580 | 2580 | | |
2581 | 2581 | | |
2582 | 2582 | | |
| 2583 | + | |
| 2584 | + | |
2583 | 2585 | | |
2584 | 2586 | | |
2585 | 2587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2934 | 2934 | | |
2935 | 2935 | | |
2936 | 2936 | | |
| 2937 | + | |
| 2938 | + | |
2937 | 2939 | | |
2938 | 2940 | | |
2939 | 2941 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2652 | 2652 | | |
2653 | 2653 | | |
2654 | 2654 | | |
| 2655 | + | |
| 2656 | + | |
2655 | 2657 | | |
2656 | 2658 | | |
2657 | 2659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2648 | 2648 | | |
2649 | 2649 | | |
2650 | 2650 | | |
| 2651 | + | |
| 2652 | + | |
2651 | 2653 | | |
2652 | 2654 | | |
2653 | 2655 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2582 | 2582 | | |
2583 | 2583 | | |
2584 | 2584 | | |
| 2585 | + | |
| 2586 | + | |
2585 | 2587 | | |
2586 | 2588 | | |
2587 | 2589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2580 | 2580 | | |
2581 | 2581 | | |
2582 | 2582 | | |
| 2583 | + | |
| 2584 | + | |
2583 | 2585 | | |
2584 | 2586 | | |
2585 | 2587 | | |
| |||
0 commit comments