Repository navigation
fix(ui): Setup opens each email template locale as its own member - #27036
Draft
objectstack-fleet[bot] wants to merge 4 commits into
Draft
objectstack-fleet[bot] wants to merge 4 commits into
objectstack-fleet[bot] wants to merge 4 commits into
Conversation
Claude-Session: https://claude.ai/code/session_01JQwxbXSXt7nn6pE5WVHGgq Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · 席位意见:只对声明了 member 字段的类型(目前只有邮件模板)生效,其它类型的链接和请求不变;发布/重置/放弃草稿也带上 member,否则在中文页点重置会删掉英文那条,这一扩展是对的。
|
This branch has not been deployed
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 Warren · project thread
Fixes #26649
Clause-②: no
Metadata-protocol: none
维护者速读
?member=语言;编辑页把这个 member 传给读取(分层视图、草稿)和写入(发布、重置、放弃草稿)。/layers?member=已由 feat(metadata): the layered read takes the bundle member selector #26861 落地)。email_template);其它类型的链接和请求逐字节不变。回滚 = revert 本 PR。ResourceEditPage.tsx(读写都带 member,尤其重置/发布那几处)、ResourceListPage.tsx(行链接与语言列)、metadata-client.ts(五个方法的member参数)。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage.bundleMember-26649.test.tsx,预期 5 个用例全绿;或在 Setup → Email Template 里点 zh-CN 那一行,地址栏带member=zh-CN,打开的是中文内容。What changes
registry.ts,default-schemas.ts): a resource config may declarebundleMemberField, the body field that tells two members of one name apart;email_templatedeclareslocale.BUNDLE_MEMBER_PARAM(member) andbundleMemberOflive beside it. The server serves no bundle member key: its table (ITEM_KEY_DISCRIMINATORS) lives in@objectstack/metadata-core, which no ui package depends on, and aGET /meta/email_templaterow carries only the body's ownlocale. So the field is declared UI-side, on the registry entry.ResourceListPage.tsx): for such a type, a Locale column sits second (label fromengine.list.col.locale, en + zh rows ini18n.ts), and each row links./NAMEplus the existing suffix (?scope=environment/?package=) plusmember=LOCALE. A row with no locale (the canonical member) links by name alone, as before. Every other type's columns and links are unchanged.ResourceEditPage.tsx,DraftConflictDialog.tsx):?member=is read once and passed to the load's layered and draft reads (ruling 6444406836), and to the post-save, post-publish, post-reset and post-discard re-reads. It is also passed to the page's by-name writes,publish,resetand the draft discard: each of those doors addresses the canonical member when named none, so without it Reset on thezh-CNpage would remove theen-USoverlay and Publish would promote theen-USdraft. The save sends no member (it is addressed by its body'slocale).readDraftForSavegains an optionalmember.metadata-client.ts,@object-ui/data-objectstack, patch changeset):layered,get,getDraft,publishandresettake an optionalmember, sent as?member=beside?package=, omitted (never empty) when absent.getDraftwith a member skips the draft read when the ledger lists that name only as another member's draft.Tests
metadata-client.bundleMember-26649.test.ts(8): each method sends?member=, beside?package=; no member means no parameter on every door; the ledger skip and its control.ResourceListPage.bundleMember-26649.test.tsx(4): two members of one template are two rows whose links differ bymemberand keepscope=environment; the canonical row links by name; the Locale column with each row's value; CONTROL:page(no members, body carryinglocale) gets no column and nomember.ResourceEditPage.bundleMember-26649.test.tsx(5): the real page over a realMetadataClientand an in-memory server keyed by(name, member). Opening?member=zh-CNreads that member's layers and draft and shows its body; CONTROL with nomembersends no selector; Publish, Discard draft and Reset each sendmember=zh-CNand change only thezh-CNrows.Ablation, once: the load's layered read without
member(ablation-replace.mjs, anchor 1 to 0, blob64744a88to55c8f52b) turns 2 of the 5 editor tests red ("reads the member's layers and draft…", "Reset removes the opened member's overlay…":expected null to be 'zh-CN'); restored, blob equals HEAD,git diff HEADempty. A first attempt whose replacement text already occurred in the file was refused by the tool before any test ran.Acceptance notes
/meta/types), so the ui declaresemail_template's field itself. A served key would let this registry row go.localefield of an existing template in the editor and saving writes another member (the save is body-addressed); the page keeps addressing the member in its URL. The create form asks for no locale, so a create lands on whatever the body defaults to.Verification
Gates and suites are recorded below at the head this body names.
All at head
6b9ab868(origin/main7eb613c3merged in; no incoming file overlaps this diff):pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' buildunder the verify lock: exit 0.pnpm --dir ui exec vitest run packages/data-objectstack/ packages/app-shell/src/views/metadata-admin/(pre-merge head3cbf7325): 726 files / 8020 tests passed, 1 skipped.vitest run packages/data-objectstack/plus the metadata-adminResourceListPage*,ResourceEditPage*andDraftConflictDialog*files: 153 files / 1491 tests passed.pnpm --filter @object-ui/data-objectstack --filter @object-ui/app-shell run type-check: exit 0.pnpm --dir ui run type-check:scripts: exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 derived families, each run, all exit 0 (includingnode scripts/check-sdui-manifest.mjsand its--self-test, andpnpm --dir ui exec vitest run scripts/);--ranreconciliation: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.pnpm --dir ui run check:new-line-citations: 0 new citations, exit 0.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (No formatter ran; the repo-wide lint is CI's run, not measured locally.)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code