Repository navigation
fix(console): a missing /forms/NAME renders the shared localized not-found state - #27739
Merged
Merged
Conversation
…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>
Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
…-j9w213 Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh 席位核对ACCEPT · head
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
loadInternalFormthrewForm metadata not found: view/NAMEfor every non-OK/meta/view/NAMEread, andFormPagerendered that string verbatim in its error banner, in every session language.FormNotFoundError. The page keeps it in its ownnotFoundflag (not in theerrorstring), and draws the console's shared not-found state: theEmpty/EmptyTitle/EmptyDescriptionlayout of the catch-allRouteNotFoundin app-shell'sAppContent, with its pack keysconsole.notFound.title,console.notFound.descriptionandconsole.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.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.@object-ui/i18nkey is added and no pack value changes (Clause-②: no). All ten packs already carryconsole.notFound.*.Tests
ui/apps/console/src/components/FormPage.notFound-27446.test.tsx, at the real/forms/:nameroute with no provider wrapped around it:页面不存在, the zh description and a返回button, and the page body holds no Latin word;Page not foundandGo back, and noForm metadata not found;FormPage.tsxrestored to the merge base, all 3 cases fail (zh and en find no not-found state; CONTROL finds noCould not load form metadata (500)text). Restored fromHEAD, the file's hash matched the HEAD blob.Local runs (head 722dca5)
pnpm --dir ui exec vitest run apps/console/src/components/FormPage(allFormPage*suites): Test Files 39 passed (39), Tests 366 passed (366).pnpm --filter @object-ui/console run type-check: exit 0 (the console tsconfig includessrc, 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.mjsand the rest of thedispatch-gates --commandslist: exit 0, reconciled with--ran.ui/was grepped forForm metadata not found: the only hit is the messageFormNotFoundErrorkeeps for logging. No test pinned the old text.Acceptance notes
/f/:slugloader (loadPublicForm) also builds an EnglishFailed to load form (STATUS): ...string that the same banner renders. It is the anonymous route and is left unchanged here.loadInternalForm(a form view with noobjecttarget, 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