Repository navigation
feat(studio): the All metadata lists mark a base's customizations, with an only-customizations filter and tile counts - #28667
Merged
Conversation
…(wip) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
… and counts Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
… outside the zh base-term census Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
Contributor
Author
|
domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y 席位核对 · ACCEPT · 2026-11-01T13:24ZHead-sha:
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.
Requested by Steedos · project thread
Fixes #28568
Clause-②: no
Metadata-protocol: none
维护者速读
hotcrm.custom的项。被覆盖的项标「已定制(HotCRM)」,定制包新增的项标「新增」;列表多一个「仅看定制(n)」筛选;目录页每个类型卡片显示已定制数(对象卡片另计扩展字段等),页头显示基础包的定制总数。跨包视图(~all)里,定制包的项标「HotCRM 的定制」。GET /api/v1/packages/:id/customizations,不做任何比对或推断;读取中或失败时不画标记、不显示数字(失败时显示服务器原话),绝不显示 0;Setup 页面完全不变、也不发这个请求。回滚即还原本 PR。ui/packages/app-shell/src/views/studio-design/customizationMarks.ts(哪一行标什么的规则)、ResourceListPage.tsx里列表范围加入定制包那一行、CustomizationMark.tsx(全控制台唯一的标记组件,N-19 复用)。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/metadataAreaHost.customizations-28568.test.tsx packages/app-shell/src/views/studio-design/customizationMarks.test.ts,预期 2 个文件、16 个测试全绿。What changes
studio-design/packageCustomizations-io.tsgainsfetchPackageCustomizations(baseId). It returns the whole answer ofGET /api/v1/packages/:id/customizations, judged byGetPackageCustomizationsResponseSchema. The landing'sfetchPackageCustomizationCountsnow calls it, so there is still one request path, one schema check and one failure-text rule (readEnvelopeFailureText). The pair-id refusal before any request is kept.studio-design/customizationMarks.tsdecides which mark a row carries, from two served facts:overrides(type, name and, for a type identified by a pair such asemail_template's locale, itsmember);_packageIdthe list serves the row under. A served override is served under the base's id (ADR-0146 D8 item 2). An item of the pair that overrides nothing is served under the pair's id.A row the read lists as an override is
customized, whether it is served under the base or the pair. Any other row of the pair isadded. The base's other rows and every other package carry nothing. There is no diff and nobasedOnverdict (D2, D6). The same module counts by type for the directory: the overrides of the type, plus the extension members onobject. The header total is served overrides plus served extensions, the landing's "customized" figure.studio-design/CustomizationMark.tsxexportsCustomizationMark(kindscustomized,added,customizationOf) andusePackageCustomizations(baseId). The hook has four states: off, loading, failed with the server's sentence, and read. It names the base from the package list the area already reads, shared throughpackages-io.ts, and falls back to the id. N-19's pillar rails can reuse both.ResourceListPage.tsx).pkg === activePackage || pkg === pairId).BASE.customid is labelled "Customization of BASE" (customizationBasePackageId).DirectoryPage.tsx). Each tile shows the type's served customization count, and only when it is above zero. The header shows the base's total. A failed read shows the sentence and no number.null, so no read is made and no pair row is admitted.@object-ui/i18n's studio namespace, inenandzh:engine.customizationMark.*,engine.directory.customizations.*andengine.list.customizations.only. The placeholders arebase,pair,customized,markedandmessage. There is nocounttoken.Tests
metadataAreaHost.customizations-28568.test.tsxruns the real list, the real directory and the real reader under an area provider. Onlyfetchand the metadata client are stubbed. The fixture is base HotCRM with one overridden translation, one added email template, one extension field, and an override of a different email-template member. The cases are the card's five plus three controls:renewal_noticemarked "Added". The base'swelcomeinenis unmarked, because the read overrides only itszh-CNmember.customizationMarks.test.tspins the pure rule (10 cases): override under the base or the pair, member identity, type identity, other packages, a pair id that has no pair, the per-type counts and the total.Acceptance notes
object. An "added" item of the pair is marked and filterable in its list, but no tile or header counts it, because N-15's read does not list items the pair adds. So a list's "Only customizations (n)" can be larger than its tile's number. Counting added items needs the read to serve them (a change to N-15's declaration), or a second count, which the card rules out ("from N-15's served counts").useGlobalDiagnosticsinuseMetadata.ts) is scoped to one package. A type that only the pair holds therefore draws no tile on the base's directory, and a tile's item count does not include the pair's rows. That type's list does show them. Closing this needs a second, pair-scoped sweep inuseMetadata.ts, which is outside the claimed file surface. It is left for the seat to card or carry.?package=PAIR(the row's owning package, ADR-0048), and the area re-roots a?package=naming another package onto that package (areaLocationRedirect). An added item therefore opens writable, in/studio/PAIR/metadata/.... This is the area's existing rule, unchanged here.:typeis matched against the read's canonical singulartype. Both come from the same registry vocabulary, so no alias is folded.locales/*packs), so the claim'sClause-②: noholds.Verification
Readings are at head
879da8ff, unless a step names another head.f42f397b, the head after it, changes only the changeset text.New and neighbouring suites · 39 files · 356 tests
The set is every ui test file that names
DirectoryPage,ResourceListPage,packageCustomizations-io,CustomizationMark,customizationMarks,metadataAreaHostorStudioMetadataArea(git grep -l), the two new files included. It ran underos-verify-lockwith--maxWorkers=2: Test Files 39 passed (39), Tests 356 passed (356). This is a declared narrowing; CI's Test UI shards run the rest of app-shell.Ablations · both red
Both ran through
scripts/ablation-replace.mjsagainst the committed fix. Each restored the file with blob equal to HEAD and an emptygit diff HEAD.member: 2 failed (the member-identity unit case and the email-template list case).Type-check and lint
pnpm --filter @object-ui/app-shell run type-check: exit 0, at52eb6b11and again at879da8ff.pnpm --filter @object-ui/i18n run type-check: exit 0.eslinton the nine touched files: 0 errors (warnings only).Derived gates · `dispatch-gates --commands` · 34 commands
Every command exited 0.
f42f397b, 31 of them ran, the PR-body gates against this body among them.52eb6b11, and the later commits touch none of their inputs beyond one five-line refactor inResourceListPage.tsx:pnpm --dir ui exec vitest run scripts/: 169 files and 4900 tests passed, 2 skipped;check:query-options-erasure;check:type-check-debt, under the lock.dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jSKpVAotd33JtFuXkP
Generated by Claude Code