Skip to content

fix(console): a missing /forms/NAME renders the shared localized not-found state - #27739

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-j9w213
Oct 29, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-j9w213

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh

Requested by Bill · project thread

Fixes #27446

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:控制台 /forms/NAME 打开一个不存在的表单时,不再显示英文原文 "Form metadata not found: view/NAME",改为显示控制台通用的「页面不存在」空状态(按会话语言显示,带「返回」按钮)。
  • 为什么改:中文等非英文会话里这里漏出一句未翻译的英文报错,和控制台其它「找不到」页面不一致。
  • 风险与回滚:只动 FormPage.tsx 的内部表单加载与错误渲染;仅 404 走新状态,其它加载失败照旧显示错误横幅。回滚即 revert 本 PR。
  • 先看:ui/apps/console/src/components/FormPage.tsx 中 FormNotFoundError 与 if (notFound && !loaded) 两处;再看测试 FormPage.notFound-27446.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run apps/console/src/components/FormPage.notFound-27446.test.tsx,预期 3 个用例全绿(zh 显示「页面不存在」且页面无英文)。
  • 需要你做的:无,席位落地。

What changes

  • loadInternalForm threw Form metadata not found: view/NAME for every non-OK /meta/view/NAME read, and FormPage rendered that string verbatim in its error banner, in every session language.
  • A 404 from that read now throws a module-private FormNotFoundError. The page keeps it in its own notFound flag (not in the error string), and draws the console's shared not-found state: the Empty / EmptyTitle / EmptyDescription layout of the catch-all RouteNotFound in app-shell's AppContent, with its pack keys console.notFound.title, console.notFound.description and console.notFound.back (Go back, navigate(-1)). The metadata route answers 404 both for a view that does not exist and for one the caller may not read, so the page says the one thing both mean.
  • Every other non-OK read keeps the error banner. Its text is now Could not load form metadata (STATUS): view/NAME, because after the split the old wording would claim "not found" for a 403 or a 500.
  • No @object-ui/i18n key is added and no pack value changes (Clause-②: no). All ten packs already carry console.notFound.*.

Tests

  • New ui/apps/console/src/components/FormPage.notFound-27446.test.tsx, at the real /forms/:name route with no provider wrapped around it:
    • zh: the state shows 页面不存在, the zh description and a 返回 button, and the page body holds no Latin word;
    • en: Page not found and Go back, and no Form metadata not found;
    • CONTROL: a 500 keeps the error banner and draws no not-found state.
  • Ablation: with FormPage.tsx restored to the merge base, all 3 cases fail (zh and en find no not-found state; CONTROL finds no Could not load form metadata (500) text). Restored from HEAD, the file's hash matched the HEAD blob.
Local runs (head 722dca5)
  • pnpm --dir ui exec vitest run apps/console/src/components/FormPage (all FormPage* suites): Test Files 39 passed (39), Tests 366 passed (366).
  • pnpm --filter @object-ui/console run type-check: exit 0 (the console tsconfig includes src, so the new test is compiled).
  • pnpm --dir ui exec vitest run scripts/: Test Files 169 passed, 2 skipped (171).
  • pnpm check:new-line-citations (ui): 0 new citations.
  • node scripts/check-sdui-manifest.mjs and the rest of the dispatch-gates --commands list: exit 0, reconciled with --ran.
  • Before pushing, ui/ was grepped for Form metadata not found: the only hit is the message FormNotFoundError keeps for logging. No test pinned the old text.

Acceptance notes

  • Read only, not reproduced and not filed: the public /f/:slug loader (loadPublicForm) also builds an English Failed to load form (STATUS): ... string that the same banner renders. It is the anonymous route and is left unchanged here.
  • The other English throws in loadInternalForm (a form view with no object target, a record link naming another object) still render verbatim. They are author or link faults, not "no such form", and are out of this card's scope.

Verification

In a zh-CN session, open /_console/forms/no_such_form: the page shows 页面不存在 / 你访问的链接与该应用中的任何视图都不匹配。 and a 返回 button, with no English text.


Generated by Claude Code

…found state

The internal form loader threw an English 'Form metadata not found' for any
non-OK /meta/view read and the page rendered it verbatim. A 404 now throws a
typed FormNotFoundError and the page draws the console's shared not-found
state (console.notFound.*) in the session language; other load failures keep
the error banner.

Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling labels Oct 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh

席位核对

ACCEPT · head 722dca524fccdd9884f34f2b15b2b8c2f51094ea · 2026-10-29T22:08Z

  • Shape: draft → main, with Fixes #27446 on its own line and no other card number beside a closing keyword. Clause-②: no and Metadata-protocol: none hold: no @object-ui/i18n key was added and no pack value was edited, because the page reuses console.notFound.title / .description / .back. @object-ui/console is private.
  • Change, read: loadInternalForm now throws a module-private FormNotFoundError when /meta/view/NAME answers 404. FormPage stores that case in its own notFound flag, cleared on every load. It draws the same Empty layout and keys as the console's catch-all RouteNotFound, in the session language, with a Go back button. Other non-OK reads keep the error banner, now worded Could not load form metadata (STATUS): view/NAME. The thrown English text is never rendered. This is the triage route (6491542295: 「Use the shared localized not-found state.」).
  • Surface: within claim 6508457825, three files: FormPage.tsx, a new test and a changeset. Seat 1's PR fix(console): a public-form submit the browser blocks replaces the stale Required banner #27578 on the same file is merged, and mergeable_state reads clean.
  • Evidence: the new FormPage.notFound-27446.test.tsx passes 3/3 in a zh session (页面不存在 and 返回, no Latin word on the page), in en, and on the control case, where a 500 keeps the banner. Ablating the change turns 3/3 red, and the file was restored to the HEAD blob. All FormPage* suites pass, 39 files and 366 tests. The console type-check exits 0. A grep of ui/ finds no pin on the old text.
  • Accepted deviations (report 6509237931): the local test run was narrowed to the affected files, and CI's sharded Test UI ran the full suite green on this head. The attribution comment sits on line 2.
  • Noted, not filed (Acceptance notes): the public /f/:slug loader loadPublicForm also renders a raw English Failed to load form (STATUS): …. This was read only and not reproduced, and it is a candidate for its own card.
  • Gates (check-runs on the head): 44 success, 11 skipped, 0 failure. check-governed-merges --pr 27739 reads NOT governed, 167 changed lines.
  • Landing: non-governed, all green and mergeable_state clean, so the seat lands it with pr_ready + automerge_enable.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 29, 2026 22:10
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 29, 2026 22:10
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 6d8372a Oct 29, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-j9w213 branch October 29, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console: /forms/NAME for a missing form renders a raw English "Form metadata not found" in a non-English session

1 participant