Repository navigation
feat(app-shell): author a nav entry's landing, badge, order and visible condition in the Studio inspector - #26977
Merged
Conversation
…le condition in the Studio inspector The Interfaces nav-item inspector offers the keys the spec's nav members declare beyond the target: an object entry's landing (named view, record with open mode, or URL-filtered slice), the shared base's badge and badge variant, order, and the visible condition, authored in the CEL editor every Studio predicate uses and written only once it lints clean. The filters rows editor moves unchanged out of AppNavInspector into its own module so both nav inspectors mount it. Claude-Session: https://claude.ai/code/session_01JQwxbXKcuJdVEkbLwwWgKt Co-authored-by: Claude <noreply@anthropic.com>
… and visible fields Claude-Session: https://claude.ai/code/session_01JQwxbXKcuJdVEkbLwwWgKt Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXKcuJdVEkbLwwWgKt
…d of a local copy The nav inspector declared its own isPlainRecord, which the spec already exports with the same body; check:spec-symbols refuses a hand-written spec-named symbol. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXKcuJdVEkbLwwWgKt
…boboxes in two older tests The inspector now also has a Badge textbox, a Badge style picker and a condition field. railLabels found the Label field as the only textbox, and sharedSelect resolved the inspector's comboboxes against a fixed list of names, so both now name what they mean. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXKcuJdVEkbLwwWgKt
This was referenced Oct 28, 2026
Contributor
Author
席位核对ACCEPT · seat 席位意见:Studio 导航项检查器补齐 spec 已声明的键:对象条目的落点(视图
|
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 #26740
维护者速读
viewName、记录recordId加recordMode、筛选filters),以及badge/badgeVariant、order、visible。没有新增任何键。visible只读,其余根本没有入口),作者只能去 Setup 或手改 JSON。StudioNavItemInspector一个组件,外加把FiltersEditor原样搬到新文件NavFiltersEditor.tsx;i18n 只增 11 行 studio 键。回滚就是 revert 本 PR。StudioDesignSurface.tsx里chooseLanding与onVisibleLint两个处理函数;前者保证 spec 互斥的落点键不会同时写入,后者保证有 CEL 错误的条件不会被写进草稿。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.navItemInspectorKeys-26740.test.tsx,19 条应全绿。What changes
The Studio Interfaces pillar's nav-item inspector (
StudioNavItemInspector) now authors every keyNavigationItemSchemadeclares on the entry's member that the ruling names, and nothing the member does not declare:objectentry, as one choice: the object's default, a named view (viewName, picked from the package's views of that object throughusePackageNavTargets), a record (recordIdplusrecordMode), or a filtered slice (filters, through the same rows editor Setup'sAppNavInspectormounts). Choosing a landing removes the other landings' keys, becauseobjectNavTargetExclusivityrefusesfiltersbesideviewName/recordId; choosing a record also removesrunAction, which the spec refuses besiderecordId. The landing is read off the keys the entry holds (deriveObjectTargetMode, the runtime's precedence).badgeandbadgeVariant: a text field and a picker over the four variants the spec declares. The variant table is keyed by the spec-derived type, so a variant the spec adds or drops stops the file compiling.order: a number field, written as a number; an emptied field removes the key.visible: now edited inCelPredicateField, the control the Data pillar and the page-block inspector already use for predicates, with the roots the console binds for a nav entry (current_user, plusdataonly on an entry that declaresdataSource). Text reaches the entry only while its lint finds no error, so the nav autosave can never send an unparseable condition; until then the entry keeps its previous condition and the field says "Not saved yet". An envelope keeps its envelope (only itssourceis edited). An envelope with no CELsourceis still shown read-only, as before.''.Supporting changes:
FiltersEditoris moved out ofAppNavInspector.tsxintometadata-admin/inspectors/NavFiltersEditor.tsxas a pure move (the only change isexport), so both inspectors mount the same editor.engine.inspector.appNav.*rows in thestudionamespace (en,zh). No row inmetadata-admin/i18n.tsis added or changed.@object-ui/i18npatch.Clause-②: no
Metadata-protocol: none
Why
The spec has declared these keys all along and the running menu honours them, but the Studio inspector offered no way to set them:
visiblewas shown read-only and the rest had no field. Studio builders had to leave for Setup or hand-edit JSON.Tests
New file
StudioDesignSurface.navItemInspectorKeys-26740.test.tsx, 19 tests:pageentry has no landing; aseparatoroffersorderonly; anobjectentry with no object has no landing; each landing shows only its own fields.runAction, back to default).visibleround-trips: shown and left as authored; an envelope keeps its envelope; a condition with a lint error is not written and the hint shows, then the fix is written; emptying removes the key; a non-CEL envelope is read-only.ordermoves an entry in the running menu (NavigationRenderer).Four existing tests change. Three now name the Label textbox they query, because the inspector gained a second textbox (Badge):
navItemInspectorLabel-11196,navItemInspectorLabelMaps-11148,navItemTypes-11790.interfacesNavTree-12455now asserts thevisiblevalue in the editable field, and its control case uses a separator.Ablations, one per control, each through
scripts/ablation-replace.mjs(anchor hit once, blob changed, then restored with blob equal to HEAD). Every one turned the suite red:Acceptance notes
Observations from reading the code; none reproduced through a public door, none filed:
order, while the running menu does (byNavOrder). Once entries carryorder, a drag reorder in the rail can be overridden at runtime.AppNavInspectorderives its target mode from the keys present, so choosing "record" or "view" there is not held until a value is entered.clearedTargetPatchdoes not removerunActionwhen the target becomes a record.Design note: the dispatch asks that
visibleuse Studio's predicate control and validation. The Studio's other blocking predicates block the host autosave throughonBlockingIssuesChange; wiring that here would edit the host outside this card's file surface. Instead the inspector writes the condition only when its lint is clean, which gives the same guarantee (no erroring predicate is ever saved) and says so on the field.Not added, because the ruling does not list them:
requiredPermissions,requiresObject,requiresService,dataSource.Verification
On head
13df6681(main merged in; the merge touched none of this PR's files):StudioDesignSurface.navItemInspectorKeys-26740.test.tsx19/19 pass.AppNavInspectortests: 15 files, 124 tests pass. Before the merge: everymetadata-admin/inspectors/test plus the deep-link and nav-surface tests, 198 files, 2650 pass, 1 skipped.@object-ui/app-shelland@object-ui/i18ntype-check exit 0;@object-ui/i18ntests 89 files, 1373 pass, 13 skipped.dispatch-gates --commandsderived 34 gate families; all 34 ran and exit 0, anddispatch-gates --ranreconciles 34 derived, 34 run, 0 not measured. That includesnode scripts/check-sdui-manifest.mjsandpnpm check:nul-bytes.pnpm --dir ui exec vitest run scripts/, first went red (2 tests incheck-readme-exports.test.ts) because the localplugin-detaildist predated the merge that addedRecordPageColumns. After rebuilding@object-ui/plugin-detailit ran 178 files, 5065 pass, exit 0. This PR does not touch that package.Human Minimum
packages/specholds no runtime logic. (packages/specnot touched.)main, one pull request.packages/spectouched: not applicable.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code