Skip to content

test(app-shell): three zh tests await the lazy studio catalogue before reading moved strings - #26914

Closed
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-lwzcd3
Closed

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-lwzcd3

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #26863

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:三个 app-shell 测试文件在模块作用域先 await loadStudioCatalogue('zh'),再跑用例:PackageFormDialog.validationTiming、ResourceEditPage.discardDraftLabel-12690、ResourceEditPage.environmentOverlay-12141。只改测试,不动源码,不动 i18n 包。
  • 为什么改:feat(ui): the remaining Studio inspector strings and the package, form and editor strings move into the studio i18n namespace (#25922 slice S3) #26815 把软件包、表单、编辑器文案移进按需加载的 studio 中文包。这三个测试按中文文案找元素(「软件包 ID」「丢弃草稿」「出于安全考虑」),包没到时页面还是英文,Test UI 随机变红,连 main 红修复 PR fix(core): list the spec's disabledReason in the action key inventory #26866 也被拖红。
  • 风险与回滚:极低。三个测试文件各加 6 行,不发布任何包;回滚即还原这三个文件。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/PackageFormDialog.validationTiming.test.tsx(新增的 import 与 await 两行及注释)。
  • 两分钟验证:在仓根跑 pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/PackageFormDialog.validationTiming.test.tsx,应见 5 passed。
  • 需要你做的:无,席位落地。

What changes

Each of the three test files below now loads the lazy studio zh catalogue at module scope (await loadStudioCatalogue('zh') from @object-ui/i18n/namespaces/studio), the shape #26800 used and the twenty siblings #26815 already carry. The cost moves into the import phase, outside any test or hook timeout, per ui/AGENTS.md test discipline.

Test file zh string it reads Studio key (moved by #26815)
PackageFormDialog.validationTiming.test.tsx 软件包 ID, 显示名称 (getByLabelText) engine.packages.create.id, engine.packages.create.name
ResourceEditPage.discardDraftLabel-12690.test.tsx the 丢弃草稿 button (getByRole), then the confirm and toast engine.edit.discardDraft, engine.edit.discardDraftConfirm, engine.edit.draftDiscarded
ResourceEditPage.environmentOverlay-12141.test.tsx the read-only banner (出于安全考虑, 永远不会开放由包提供的条目) engine.edit.readOnlyTypeBanner

No shipped code, no ui/packages/i18n change, no skip, no quarantine, no timeout change. Test-only and publishes nothing, so no changeset (as #26800 had none).

Tests

The sweep. The population is every app-shell test file without the preload that names a zh locale in code or holds a literal found in a studio zh value: 238 files (the card's own file excluded, it was already fixed). They ran with the studio zh loader held never-resolving (scripts/ablation-replace.mjs on ui/packages/i18n/src/namespaces/studio/index.ts, restored, blob equals HEAD): Test Files 2 failed | 236 passed (238), Tests 2 failed | 2368 passed (2370). The two failures are the two ResourceEditPage files above, the same red CI showed for discardDraftLabel-12690 on PR #26877 (Test UI 9/16). Every other file in the population is judged safe on that run: it reads no lazy studio zh row, or it already reads a zh row only after the catalogue has landed.

Red before, green after. The studio zh loader delayed 4000 ms, under the shared verify lock, at head a51a0622:

Leg Preloads Result
A kept Test Files 3 passed (3), Tests 20 passed (20)
B all three removed Test Files 3 failed (3), Tests 5 failed / 15 passed (20): Unable to find a label with the text of: /软件包 ID/ (the card's CI signature), /显示名称/ twice, the 丢弃草稿 button, and expected 'This metadata type is read-only…' to contain '出于安全考虑'

Every mutation was restored and proven (blob == HEAD, git diff HEAD empty).

Cold module graph, alone and in company. Each touched file alone: 5/5, 3/3 and 12/12 tests passed. Each in its full-run Test UI shard's app-shell company, computed with ui/scripts/test-shard-partition.mjs (planShards, the same plan the sequencer uses; it puts validationTiming on shard 10/16, the shard CI showed red): shard 10, 102 files, 755 tests passed; shard 2, 104 files, 1010 tests passed; shard 13, 107 files, 1139 tests passed.

Acceptance notes

  • The company runs are narrowed to the shard's packages/app-shell files. A whole-shard run (369 files across the unit, dom, dom-heavy and console projects) was stopped by hand at 18 min: the non-TTY reporter prints nothing until the end, which read as a stall. CI's Test UI runs the full shards.

Verification

Type-check and derived gates

All at head a51a0622, in a worktree off origin/main a20824f3.

  • pnpm exec turbo run type-check --filter=@object-ui/app-shell --concurrency=2 under scripts/pm/os-verify-lock.sh: VERDICT command-exit 0, 64/64 tasks (app-shell type-check covers its test files).
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 24 commands; every one exited 0. The PR-body gates (check-closing-keyword-parity, plus check-changeset-no-major --base origin/main and check-adr-0087-registration) ran against this body through GITHUB_EVENT_PATH.
  • pnpm check:type-check-debt under the lock: 0 raw tsc error(s) total, none above its recorded number.
  • pnpm --dir ui exec vitest run scripts/ under the lock, after a spec rebuild: Test Files 178 passed | 2 skipped (180), Tests 5065 passed | 2 skipped (5067).
  • dispatch-gates --ran: 24 derived famil(ies) accounted for — 24 run, 0 NOT-MEASURED.
  • pnpm check:new-line-citations (from ui/): 0 new citation(s).

Generated by Claude Code

…tudio zh catalogue

The zh-CN cases read `getByLabelText(/软件包 ID/)` right after the form
renders; that label is `engine.packages.create.id`, a row of the lazy
`studio` i18n namespace since the package/form/editor strings moved
there. Load the zh catalogue at module scope, the shape the other
studio-namespace zh tests in app-shell use.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVTqmjzhQU2Rqq79mu
…zh catalogue

`discardDraftLabel-12690` finds the `丢弃草稿` button
(`engine.edit.discardDraft`) and `environmentOverlay-12141` reads the
read-only banner (`engine.edit.readOnlyTypeBanner`) in zh-CN. Both rows
moved into the lazy `studio` namespace with the editor strings, so each
case raced the zh chunk. Load the catalogue at module scope.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVTqmjzhQU2Rqq79mu
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Seat note (domain:ui seat 4) — head a51a0622, three reds, none from the diff:

  • PR-body guards: the check-single-claim-paths step got GitHub API 500 on pulls/26914/files (PREREQUISITE NOT MET, exit 3). The UNDETERMINED warning above it is the expected thread-branch reading (claude/project-thread-* is not a claude/issue-N-* shape) and is a warning, not the red.
  • filter (CI): "this diff is temporarily unavailable due to heavy server load".
  • Check Changeset: test-only diff releases nothing; the seat applied skip-changeset.

One re-run of each failed run once it completes.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Seat close · domain:ui#4 · session_01QsR2jTfvjNTaR29ehLk26T

Superseded. Main already loads the zh studio catalogue in all three files: #26839 (942ffb21, 20:28Z, Fixes #26705) did PackageFormDialog.validationTiming and ResourceEditPage.discardDraftLabel-12690, and #26855 (c4a4aefc) did ResourceEditPage.environmentOverlay-12141. Both landed after this card was cut. In CI's merge with main, this branch's import is a second loadStudioCatalogue declaration, so Type Check UI fails with Duplicate identifier 'loadStudioCatalogue'. Nothing here is left to add. Closing without merging.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

app-shell: PackageFormDialog.validationTiming test reads the zh label before the lazy studio catalogue loads, and fails intermittently since #26815

2 participants