Repository navigation
feat(studio): 全部类型 All types ends the 高级 fold, and the type directory lists every type a package could hold - #37380
Draft
objectstack-fleet[bot] wants to merge 3 commits into
Draft
objectstack-fleet[bot] wants to merge 3 commits into
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
…y lists every type of the six groups The fold's last row, under no group, opens the area's type directory. On a package the directory now lists the types the package holds as before and, after them, every other type of the menu's six groups, marked "None yet" with the state word for what can be done there. The fold's own rule is unchanged. ADR-0084 gains the dated amendment line. Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-Authored-By: Claude <noreply@anthropic.com>
…ory lists its not-held types Two pins written before the row existed are rewritten on purpose: the area's root is now the current page of 全部类型 All types, and a package that holds none of the served types lists each as held by none yet instead of "No matches". Adds the changeset. Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-Authored-By: Claude <noreply@anthropic.com>
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.
Fixes #37360
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Implements ruling A on #37360 (ruling record comment 7177310364, maintainer, verbatim: 「37360 同意」).
/studio/PKG/metadata), and on that page it is the current entry, so the fold opens by itself there without writing its cookie. A menu search lists it last when its name matches.~organd~alldraw no fold and no row. The row is not part ofbuildStudioMenu's groups, so the fold's rule does not change: a 高级 type is drawn when the package holds one, and appears there by itself once it does.scopeDirectoryEntriesrule is untouched, so the menu and the directory still agree on what a package holds) and, after them in each group, every other served type of the menu's six groups (directoryNotHeldEntries). Each of those is marked "None yet" / 「还没有」 in place of an item count, with the existing state word for what can be done there (read-only / can be customized / can be added / writable). A tile opens the type's list, which carries New. A failed diagnostics sweep says nothing about what the package holds, so then nothing is marked or added. The cross-package leg and Setup's directory list as before.engine.studio.menu.allTypes,engine.directory.notHeld,engine.directory.notHeldTitle,engine.directory.notHeldReadOnlyTitle. The palette's entry-icon map gains the new entry kind (the palette lists only the menu's groups, so it draws nothing new).Read first (by risk):
ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.tsx—directoryNotHeldEntriesand thenotHeldEntriesmemo (thediagErrorguard), and the tile's not-held badge.ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx—renderAllTypesinside the fold region, afterrenderGroups(tiers.advanced, 'advanced'), andcurrentIsAdvanced.ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts—studioMenuAllTypesEntryand the area-root branch ofstudioMenuCurrentKey.Tests
Pins (each ablated once, below):
StudioMenu.test.tsx› 全部类型 All types: the last link of the fold region, after everystudio-menu-advanced-group-*, inside nodata-sidebar="group"and under no group label; href/studio/PKG/metadata. Model pins instudioMenuModel.test.ts(package only; in no group of the menu or either tier).DirectoryPage.allTypes-37360.test.tsx: held types first with their counts and no mark; then each group's not-held types marked "None yet" with no count and the right state word (apiread-only,docaddable,email_templatewritable); a type outside the six groups and the hiddenfieldare never listed; a failed sweep marks nothing; the cross-package leg is unchanged.email_templatetile routes to/studio/PKG/metadata/email_template?package=PKG, where the real list page rendersmetadata-list-create.StudioMenu.test.tsx(rendered:email_templateandpositionserved, held by none, absent from the open fold while 全部类型 is there) andstudioMenuModel.test.ts(the shared rule plusbuildStudioMenu).Rewritten on purpose (each marked in place):
studioMenuModel.test.ts"nothing at the directory" → the directory's current entry isallTypes;StudioDesignSurface.metadataArea-28561.test.tsx"The directory is no one entry's page" → the current link isstudio-menu-entry-allTypes;metadataAreaHost.scope-28561.test.tsxkernel-package directory read "No matches" → it lists the kernel package's not-held types, scoped to it, URL unrepaired.Ablations (one per pin, each through
scripts/ablation-replace.mjs, anchor hit 1 → 0, blob changed, restored to the HEAD blob withgit diff HEADempty; tests import the source by relative path, so nodist/is involved):Unable to find an element by: [data-testid="studio-menu-entry-allTypes"]directoryNotHeldEntriesreturns nothingexpected [ 'hook', 'object' ] to deeply equal [ Array(5) ].hrefassertionalwayslist becomes every served typeexpected ... to be nullonstudio-menu-entry-type:email_templateReadings are in the details blocks under Verification.
Acceptance notes
.custompair (ADR-0146 D3), so the list can still make a first item.StudioPaletteGroups.tsx(one icon row, required by its typed map), and two test files whose pins described the old directory (StudioDesignSurface.metadataArea-28561.test.tsx,metadataAreaHost.scope-28561.test.tsx), each rewritten on purpose.Verification
Two-minute check: open Studio on a new, empty app, expand 「高级」 and click its last row 「全部类型」; expect every type under its group, e.g. 邮件模板 tile with 「还没有」 and 「可写」, and clicking it opens the empty email-template list with 「新建」.
All readings on head
45ed0a4bf5cunless noted.Affected package tests (narrowed, declared)
ui:pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/studio-design/ packages/app-shell/src/views/metadata-admin/DirectoryPage packages/app-shell/src/views/metadata-admin/metadataAreaHost packages/i18n/on122de301019— Test Files 2 failed / 397 passed, Tests 2 failed / 4399 passed / 13 skipped: the two failures were the pins that described the old directory, rewritten on purpose in8c09070ce61.45ed0a4bf5cof those two files plus the three new-pin files: Test Files 5 passed (5), Tests 90 passed (90), lock VERDICT command-exit 0.uithat names the menu, the palette or the directory (22 files: the consoleAppContent.*landings,UnifiedSidebar.studioNoHome-12113,ResourceListPage.setupPosture-12606,check-i18n-call-site-keys, …) on45ed0a4bf5c: Test Files 22 passed (22), Tests 607 passed (607), lock VERDICT command-exit 0.@object-ui/app-shell's suite (about 2,000 files that import none of the changed modules) is left to CI's Test UI.Type check
pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run type-checkon45ed0a4bf5c: bothDone, lock VERDICT command-exit 0. (The first run, before45ed0a4bf5c, was red on the palette's entry-icon map,TS2741 Property 'allTypes' is missing; fixed there.)Derived gate families
node scripts/pm/dispatch-gates.mjs --commandson45ed0a4bf5c: 48 commands, all run, each exit 0 (exit captured before any pipe), includingpnpm --dir ui exec vitest run scripts/(Test Files 172 passed / 2 skipped).--ranreconciliation: "48 derived famil(ies) accounted for — 48 run, 0 NOT-MEASURED (a DERIVED zero — all 48 recorded an exit code and none of them is 3)".node scripts/pm/overlap-check.mjson45ed0a4bf5c: origin/main merges cleanly; #37368 and #37362 (share the studio catalogues) merge cleanly; VERDICT clean exit 0.Ablations
Each through
node scripts/ablation-replace.mjs --file F --anchor A --replacement R -- (the pin's test, under the verify lock); every leg printed "ok mutation landed: anchor 1 -> 0" and "ok restored: blob == HEAD … andgit diff HEADis empty"; tree clean after (0 changed paths).StudioMenu.tsxrow render →{null}: Tests 1 failed —Unable to find an element by: [data-testid="studio-menu-entry-allTypes"].directoryNotHeldEntries→return []: Tests 1 failed —expected [ 'hook', 'object' ] to deeply equal [ Array(5) ].to={notHeld ? '.' : href}: Tests 1 failed — the tile'shrefassertion.studioMenuData.tsalways:→ every served type: Tests 1 failed —expected … to be null(the fold drewtype:email_template).Generated by Claude Code