Repository navigation
fix(app-shell): the Diagnostics page inside a package's Studio area sweeps only that package - #29230
Merged
Merged
Conversation
…nly that package The page asked for the environment-wide sweep even inside one package's Studio "All metadata" area, while the directory beside it is scoped, so another package's invalid item was listed there and its area-relative link opened an unrelated page. It now reads the area host and sends the package; the cross-package leg and Setup keep the environment-wide sweep. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jV7MUKsme1kh4FsABc
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T10:09ZHead-sha:
|
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.
Requested by Steedos · project thread
Fixes #29179
Clause-②: no
Metadata-protocol: none
维护者速读
~all)和 Setup 的诊断页保持全环境扫描不变。DiagnosticsPage.tsx一处改动。ui/packages/app-shell/src/views/metadata-admin/DiagnosticsPage.tsx(读取区域宿主并传packageId那一段);DiagnosticsPage.packageScope-29179.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/DiagnosticsPage.packageScope-29179.test.tsx,预期 5 个用例全绿(在 main 上其中 3 个红)。What changes
MetadataDiagnosticsPagenow reads the Studio area host (useMetadataAreaHost()) and passeshost.packageIdtouseGlobalDiagnosticswhen the area is open on a package, the wayDirectoryPagepasses itsactivePackage. The request becomesGET /api/v1/meta/diagnostics?severity=…&package=PKG, so the page's count matches the directory's and every listed row is an item of the open package, whose area-relative link (../TYPE/NAME) opens that item in its own package's area.Unchanged: the cross-package leg (
/studio/~all/metadata/_diagnostics,packageId: null) and Setup's page (no area host) keep the environment-wide sweep (#28561). No copy, i18n key or exported type changes.Why
Inside
com.example.showcase's area the directory's scoped sweep found 0 issues (no "View all issues" link), while the Diagnostics page's unscoped sweep listedpkga_qa_obj.qa_diag_view, another package's item; its link resolved into the showcase area and landed on an unrelated Interfaces page. The server already filters the sweep bypackageIdat its list read, and diagnostics entries carry no package, so scoping the request is the whole fix.Tests
New
DiagnosticsPage.packageScope-29179.test.tsxruns the realuseGlobalDiagnosticsagainst a fake client that answers as the server does (apackageIdnarrows the sweep), with the page nested atROOT/_diagnosticsas the area and Setup mount it:/studio/PKG/metadata/view/NAME;~allleg and Setup keep the environment-wide request and list the foreign row (preservation pins).Red on main (ea150b7), green on the fix
On
ea150b7fwith the test file alone:Tests 3 failed | 2 passed (5), the three package-area cases failing withexpected [ { severity: 'error' } ] to deeply equal [ { severity: 'error', …(1) } ],expectedthe foreign row's anchor elementto be nullandexpected { severity: 'warning' } to deeply equal { severity: 'warning', …(1) }. The two preservation cases pass on main by design.On the fix (
18d2b4cb), with the two existing Diagnostics page tests:Test Files 3 passed (3) · Tests 12 passed (12).Acceptance notes
./_diagnosticswithout its?package=, so Setup's Diagnostics page stays environment-wide beside a package-scoped directory count. This is outside the card's Studio reach and is left as is (noted, not fixed).Verification
All readings on head
4cfc9074(the fix merged withorigin/main104cd1a) unless stated.Derived gates: 34 derived, 34 run, 0 NOT-MEASURED
node scripts/pm/dispatch-gates.mjs --commandsderived 34 commands; the 33 unlocked ones each exit 0 in one loop, andpnpm --dir ui exec vitest run scripts/ran under the lock:Test Files 169 passed | 2 skipped (171) · Tests 4900 passed | 2 skipped (4902), VERDICT command-exit 0.node scripts/check-sdui-manifest.mjsexit 0.dispatch-gates --ran: "34 derived famil(ies) accounted for — 34 run, 0 NOT-MEASURED".pnpm check:new-line-citations(fromui/):0 new citation(s).Type-check and related tests
pnpm exec turbo run type-check --filter=@object-ui/app-shell --concurrency=2:Tasks: 65 successful, 65 total, VERDICT command-exit 0.DiagnosticsPage/MetadataDiagnosticsPage(git grep -lunderui/packagesandui/apps) plus the threemetadataAreaHost.*tests (22 files):Test Files 22 passed (22) · Tests 294 passed (294). The rest of app-shell is left to CI's Test UI (declared narrowing).Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (repo-wide lint is CI's)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code