Skip to content

feat(app-shell): Setup's and the Studio's navigation editor edits an entry's search keywords - #39236

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-39147-nav-editor-keywords
Dec 3, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-39147-nav-editor-keywords

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #39147

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 管理员在设置的应用编辑器和工作室的导航检查器里,可以直接为每个导航项添加、修改、删除“搜索关键词”,以前只能改源码。
  • 属于“设置专题”:让管理员在改名后仍能被用户用旧名称在控制台搜索中找到入口。
  • 出错时最坏是关键词没存上或搜索找不到该入口,导航本身照常显示和打开;改动可直接撤回。
  • 无

What changes

  • AppNavInspector (the navigation editor Setup's app editor and the Studio's nav inspector share) gains a Search keywords list field, offered wherever navEntryOffersField(type, 'keywords') offers it, so never on a separator.
  • Each edit is judged by the spec's own declaration (ObjectNavItemSchema.shape.keywords.safeParse) before it is written: a refused list (a keyword over 60 characters, a 21st keyword) is not written and the spec's message is shown beside the field (role="alert"). Removing the last keyword removes the key; nothing writes []. An unchanged list writes nothing.
  • NavigationEntryItem (@object-ui/types) declares the optional keywords member, typed by reference from the spec's nav-item base (carried N2 of PR feat(app-shell): the command palette finds a nav entry by its old name and shows its group path #39163), so the editor and the served entry shape agree.
  • Six engine.inspector.appNav.keywords* strings in the Studio namespace (en, zh).
  • Changeset .changeset/39147-nav-editor-keywords.md (patch: @object-ui/app-shell, @object-ui/types, @object-ui/i18n).

Clause-② re-declared from the diff as yes (widening): the published @object-ui/types interface gains a member. The claim carried no; the diff decides. No spec shape, no authorable key, no error code changes; nav-target.ts is untouched (its offer table and retype already carry keywords).

Read first, by risk:

  1. ui/packages/app-shell/src/views/metadata-admin/inspectors/AppNavInspector.tsx — commitKeywords (refusal, empty-list removal, no-op on equal list) and navKeywordsRefusal.
  2. ui/packages/app-shell/src/views/metadata-admin/inspectors/AppNavInspector.keywords-39147.test.tsx — the acceptance pins.
  3. ui/packages/types/src/app.ts — the mirror member.

Tests

AppNavInspector.keywords-39147.test.tsx, 9 tests:

  • add (saved entry carries it, parses with NavigationItemSchema, and paletteNavEntryHit finds the entry by the new word; non-vacuity: not found before the edit), edit, remove (last removal drops the key), unchanged writes nothing;
  • 61-character keyword and 21st keyword refused with the spec's own first issue message, nothing written; CONTROL: 60 characters and a 20th pass;
  • a separator is offered no field; a retype to a separator drops keywords, a retype to dashboard keeps them;
  • a refused draft stays with its own entry: entry A (no keywords) gets pipeline plus a refused 61-character word; on switching to entry B (no keywords) the field is empty, shows no alert and nothing is written to B; the next edit on B writes only B's own word. The field is keyed per entry (key={selection.id}, as in FlowEdgeInspector). This is S1 of contract review on 355e2b57ac, closed by the delta review on d3fac7a692.
Local test readings at 355e2b5 (the final head; test inputs unchanged since 6ec4983)
  • cd ui && pnpm exec vitest run --reporter=verbose packages/app-shell/src/views/metadata-admin/inspectors/AppNavInspector.keywords-39147.test.tsx: Tests 8 passed (8).
  • cd ui && pnpm exec vitest run packages/types/ packages/i18n/ packages/app-shell/src/views/metadata-admin/inspectors/AppNav packages/app-shell/src/chrome/paletteNav: Test Files 507 passed (507), Tests 12437 passed | 13 skipped (12450).
  • pnpm --filter @object-ui/types --filter @object-ui/i18n --filter @object-ui/app-shell run type-check: all three Done, exit 0 (after building the app-shell dependency closure: 72 of 72 tasks).
  • Whole @object-ui/app-shell suite: NOT MEASURED locally (stopped after 80 minutes on two workers); CI Test Core runs it.

Ablation (one-off, restored, git diff HEAD empty after each, via scripts/ablation-replace.mjs):

  1. navKeywordsRefusal made to return null (the spec check removed): red refuses a 61-character keyword with the spec's message and writes nothing (CONTROL: 60 pass) and refuses a 21st keyword with the spec's message and writes nothing (CONTROL: a 20th passes); 6 others green.
  2. The field's navEntryOffersField(entryType, 'keywords') guard made true: red a separator is offered no keywords field; 7 others green.
Fix round at d3fac7a (S1 and nit N1 of the contract review)
  • cd ui && pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/inspectors/AppNavInspector.keywords-39147.test.tsx: Tests 9 passed (9).
  • Ablation 3: key={selection.id} removed: red switching from an entry with a refused draft to another keyword-less entry shows an empty field and writes nothing to it (A's two draft rows shown on B); 8 others green. Restored, blob equal to HEAD.
  • app-shell type-check NOT MEASURED locally (worktree without the built ui closure); green at 355e2b5, and the only source change since is one JSX key prop and a jsdoc sentence. CI Type Check UI is green at d3fac7a.
  • dispatch-gates --ran at d3fac7a: 38 run, 0 NOT-MEASURED.

Acceptance notes

  • The claim's Clause-②: no is re-declared yes (widening) from the diff (published type gains a member).
  • Merged origin/main into the branch (no conflicts), including PR fix(automation)!: a triggered flow whose fan-out or earlier branch reaches a subflow or map whose child can suspend is not armed #39144, which also edits studio/en.ts and studio/zh.ts; overlap-check.mjs reads clean at the final head.
  • check:test-source-alias first failed on the new test (it reaches a dynamic import('@objectstack/lint') through the condition builder). Fixed with the repo's convention: a module-top side-effect import in the test file.
  • The whole @object-ui/app-shell suite on two local workers did not finish in 80 minutes and was stopped: NOT MEASURED locally, left to CI's sharded Test Core. Locally measured instead: types, i18n, every AppNavInspector* file and the palette keyword tests.

Verification

Two-minute check: cd ui && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/AppNavInspector.keywords-39147.test.tsx — expect Tests 9 passed (9). In a running console (not browser-verified in this run): open an app in Setup's app editor, select a page entry in its navigation, and the Search keywords field lists, adds and removes words; select a separator and no such field shows.

Derived gates (dispatch-gates --commands, 38 commands) at 355e2b5 and d3fac7a
  • dispatch-gates --ran: 38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3).
  • All 38 exit 0. check:test-source-alias was red on the first run and is green after the test fix; check:query-options-erasure hit a 300s local timeout once and passed on re-run (exit 0); check:type-check-debt first missed the verify lock (exit 3, NOT MEASURED) and passed on re-run.
  • The three lock-heavy families (pnpm --dir ui exec vitest run scripts/, check:type-check-coverage, check:type-check-debt) ran on 94f7cd5 / 6ec4983; the later main merge changed none of their inputs.
  • Also run: pnpm check:changeset-fixed (roster under .changeset/), exit 0.
  • CI-only families (type-check lanes, roster and wide-population families, pnpm lint) are left to this PR's check-runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2

… pin

check:test-source-alias: the inspector reaches a dynamic import of the
lint package; pay that load at module top, not inside a clocked case.

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 355e2b57ac27213df9e8b96620b695da921363ba
Local-runs: none
Scope: ui/packages/types/src/app.ts + ui/packages/app-shell/src/views/metadata-admin/inspectors/AppNavInspector.tsx
Security-touching: no
Rule-change-verified: none

① Derived judgments

Inputs read: card #39147 body and all seven comments (triage first touch, carried N2 7357012641, unlock, claim 7361464075, the two dispatch notices, os-dev-report 7365216829); PR #39236 body and file list (6 files); the net diff against main at this head; the check-runs on this head.

  • NavigationEntryItem.keywords?: NonNullable<SpecObjectNavItem['keywords']> (@object-ui/types, app.ts). Right. The type comes by reference from the spec's nav-item base, so it is string[] with no restated copy. It is optional, as keywords: navKeywordsSchema().optional() is on BaseNavItemSchema on main. The interface's type already excludes 'separator'. NavigationSeparatorItem maps every other key of NavigationEntryItem to ?: never, so the separator arm now refuses keywords with no edit, which matches the spec's strict separator (id and order only). The objectui zod mirror (ui/packages/types/src/zod/app.zod.ts) already accepted keywords on main, so the runtime accept set does not change. The TS interface now catches up with it, which closes carried N2. The jsdoc's claims hold: the palette reads the key (Command palette finds a Setup page by its old name and shows 「分组 › 页面」 on each result (#39050) #39055), and it is search only.
  • navKeywordsRefusal (AppNavInspector.tsx). Right. It judges an edit with ObjectNavItemSchema.shape.keywords.safeParse, which is the shared base member every non-separator variant spreads. The limits (60 characters, 20 entries, the untrimmed rule) and their messages are therefore the spec's, not a restated copy. The value is read at call time because the schema is lazy. It is a module export only: inspectors/index.ts does not re-export it and the package exports map has only . and ./styles.css, so no public surface is added. The runtime value import from @objectstack/spec/ui follows sibling precedent (FormViewSchema, AiChatNavParamsSchema), and @objectstack/spec is already a dependency.
  • commitKeywords. Right on the accept set. A refused list is not written. An empty list removes the key through patch({}, ['keywords']) and never writes []. A list equal to the stored one writes nothing. Every written value is therefore inside the spec's accept set.
  • Offer gate navEntryOffersField(entryType, 'keywords'). Right. NAV_ENTRY_BASE_KEYS on this head already lists keywords and NAV_SEPARATOR_KEYS is ['id','order'], so the field appears on every type except a separator, as the card asks. A retype keeps the key, or drops it on a separator.
  • Per-entry state: see S1 under ③.
  • Gate verdicts (the check-runs on this head). Concluded green: Check Changeset, Test Core, Build UI Deps, Governed Surface Queue Guard, PR-body guards, Dogfood Regression Gate, Check PR Size, Auto Label, filter. The rest are skipped as opt-in or by path. Still in_progress when read, so no verdict yet: Type Check UI, Lint UI, Test UI (1/16 to 16/16), Build & E2E UI, Live E2E UI, the Type Check · lanes (workspace, source gates, debt ledger, consumer gates) and the Lint · lanes. This record judges the contract only. Those verdicts belong to the lane seat's ACCEPT, which waits for them.

② Semver level

The changeset .changeset/39147-nav-editor-keywords.md gives patch to @object-ui/app-shell, @object-ui/types and @object-ui/i18n, and these are exactly the three packages the diff moves. It declares Clause-②: yes (widening) and Metadata-protocol: none, and the PR body declares the same two lines. AGENTS.md says a non-protocol change, widening or breaking, ships patch. Metadata-protocol: none is right: what a metadata author can write was added by #39052 in the spec, and this diff adds no key, value or metadata type. The level matches what the diff publishes.

The open question (keep yes (widening), or no because the mirror type follows an already-published spec key): keep Clause-②: yes (widening) (option A). The Clause-② line declares the change to the diff's own published surface, and that surface grows. A consumer object literal typed NavigationEntryItem that carries keywords was refused as an excess property before this head and is accepted now. The fact that the member mirrors a spec key published by #39052 is what Metadata-protocol: none records. It does not make the @object-ui/types surface unchanged. The claim's no was a prediction, and re-declaring from the diff was correct.

③ Boundary flags

  • Open question (os-dev-report open_questions[0], Clause-②): answered in ②. Keep yes (widening).
  • Carried N2 (7357012641): taken. NavigationEntryItem and the editor now agree with the served entry shape. Confirmed in the tree, not from the body.
  • Dev flags: security_findings: none and out_of_scope_findings: []. Nothing to answer.
  • SQL push-down: not applicable. The diff is a client-side editor field and a type member. It adds no data read, no id materialisation and no in-app join.

S1 (should-fix) — AppNavInspector.tsx: refused draft rows carry over to the next entry and can be written to it. FlowStringListField keeps its rows in local state and resets them only when useMemo(() => toList(value), [value]) produces a new list. The inspector host (ResourceEditPage.tsx, the InspectorComponent render) does not remount the inspector when the selection changes, and the new field has no key. Steps: select an entry that has no keywords, then add pipeline and a 61-character word. The list is refused and nothing is written, which is correct. Then select another entry that also has no keywords. value is undefined both times, so the memo does not recompute and the effect does not reset the rows. Entry B now shows A's two draft rows, and because the refusal message is scoped to A's id, the neutral hint shows instead. Removing the long word on B calls flush(['pipeline']), and commitKeywords writes keywords: ['pipeline'] to B, a word the admin typed for A. The PR already scopes the refusal message per entry (keywordsRefusal.id) but not the rows. Fix: give the field a fresh instance per entry, key={selection.id} on FlowStringListField. This is the repo's own precedent (FlowEdgeInspector.tsx: "A fresh editor per edge: its rows are that edge's."). Pin it with a test that rerenders with a second selection after a refusal and asserts that the field is empty and that nothing is written to the second entry.

  • nit N1 — FlowStringListField's rowsToList trims every row and drops blank rows before navKeywordsRefusal runs. The spec's rule that a keyword is refused rather than trimmed, and its message, therefore never appear in this editor: " crm " is stored as crm. The stored value is still inside the accept set and the field shows what was stored, so this is cosmetic. A one-line note in the commitKeywords jsdoc would stop a reader from expecting that refusal here.
  • nit N2 — The field and its hint ("Other words people may type in search to find this entry") also appear on action and doc entries. The spec accepts the key there, but the spec's own jsdoc says nothing reads it there yet (Navigation keywords on action and doc entries are accepted but nothing reads them (#39050) #39168). Offering the field matches the accept set, so it is correct. Only the hint promises more than those two types deliver until Navigation keywords on action and doc entries are accepted but nothing reads them (#39050) #39168 lands.

④ Design judgment

Not owed (declaration face).

Implemented-by: claude/issue-39147-nav-editor-keywords
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

A refused keywords draft carried over to the next keyword-less entry
selected and could then be written to it: the list field resets its rows
only when its value changes, and two entries without keywords share an
undefined value. Key the field by the selection, as FlowEdgeInspector does.

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: TIER_DEFAULT
Head-sha: d3fac7a69252eb40f34c52c6fc2bb4d3a976af79
Local-runs: none
Scope: ui/packages/types/src/app.ts + ui/packages/app-shell/src/views/metadata-admin/inspectors/AppNavInspector.tsx
Security-touching: no
Rule-change-verified: none

① Derived judgments

This is a delta review of 355e2b57ac..d3fac7a692. The delta is one commit, d3fac7a692 (fix(app-shell): a fresh keywords field per nav entry), with no merge of main. It touches two files: AppNavInspector.tsx (+6/−1) and AppNavInspector.keywords-39147.test.tsx (+42). The changeset is unchanged and so is ui/packages/types/src/app.ts, so the published NavigationEntryItem.keywords member and every judgment on it in the record at 355e2b57ac still stand.

  • FlowStringListField now carries key={selection.id}. Right. Each selected entry gets a fresh field instance, so the local rows start from that entry's stored keywords and a refused draft cannot outlive its entry. The repo's precedent does the same: FlowEdgeInspector.tsx, key={selection.id}. The refusal message was already scoped per entry (keywordsRefusal.id), so the rows and the message now agree. No accept-set change and no public-surface change: commitKeywords and navKeywordsRefusal are untouched apart from jsdoc.
  • commitKeywords jsdoc gains one sentence: the list field trims each row and drops blank ones before this runs, so the spec's untrimmed-word refusal never shows in this editor. It is accurate against FlowStringListField.rowsToList on this head. This closes nit N1.
  • New pin: "switching from an entry with a refused draft to another keyword-less entry shows an empty field and writes nothing to it". It checks the exact S1 path. Both entries have no keywords, so value is undefined before and after the switch, the same condition that kept the stale rows before the key was added. After the rerender it asserts that the field has no rows, that the empty label shows, that there is no alert and that nothing is written to entry B. It then asserts that B's next edit writes only ['leads'], and that the saved entry parses clean. The pin is not vacuous. The test reads stale rows on the second selection, and only a remount clears them.
  • Gate verdicts (check-runs on this head): 45 success, 15 skipped by path or opt-in, none failed and none pending. The success set includes Type Check UI, Lint UI, all 16 Test UI shards, Build & E2E UI and Check Changeset. The gates still pending at 355e2b57ac have all concluded green here.

② Semver level

Unchanged from the record at 355e2b57ac. The delta adds no published surface, so patch on @object-ui/app-shell, @object-ui/types and @object-ui/i18n still matches. Clause-②: yes (widening) stands, as answered there, and so does Metadata-protocol: none.

③ Boundary flags

S1: closed.

  • nit N1: closed by the jsdoc sentence above.
  • nit N2 (the field and its hint on action and doc entries, which nothing reads until Navigation keywords on action and doc entries are accepted but nothing reads them (#39050) #39168): not taken in this round. It stays a nit and does not reopen the round.
  • os-dev-report 7366113569: open_questions is empty and out_of_scope_findings is empty. Its security_findings reads withheld, not none. The delta's hunks are a React key, one jsdoc sentence and a test, and none of them teaches permission, sharing, credential, token or authentication behaviour. The flag is answered by the tree, and Security-touching: no holds.
  • SQL push-down: not applicable. The delta adds no data read, no id materialisation and no join.

No must-fix, no should-fix.

④ Design judgment

Not owed (declaration face).

Implemented-by: claude/issue-39147-nav-editor-keywords
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

L1 ACCEPT · PR #39236 (#39147, epic #39050) · head d3fac7a69252eb40f34c52c6fc2bb4d3a976af79 · read 2026-12-03T03:24Z

席位核对

ACCEPT · repo:objectstack@os-justin · head d3fac7a69252eb40f34c52c6fc2bb4d3a976af79

  1. Shape. Fixes #39147 is right. Merging delivers the whole card: an administrator can add, edit and remove an entry's search keywords in the navigation editor that Setup and Studio share, on every entry type except a separator. The objectui mirror NavigationEntryItem declares the key, which takes carried N2 of PR feat(app-shell): the command palette finds a nav entry by its old name and shows its group path #39163. The body has no other closing keyword and no other open card number next to a verb.
  2. Contract review. The first record at TIER_DEFAULT (head 355e2b57ac) carried S1 (should-fix): a refused draft carried over to the next keyword-less entry and could be written to it. The fix round keyed the field per entry (key={selection.id}, the FlowEdgeInspector precedent) and added a pin, which the dev ablated red. The delta record at this head reads S1: closed. and PASS. Nit N1 is closed by a jsdoc sentence. Nit N2 (the hint on action and doc entries promises a reader that Navigation keywords on action and doc entries are accepted but nothing reads them (#39050) #39168 delivers) is accepted as a deviation, because Navigation keywords on action and doc entries are accepted but nothing reads them (#39050) #39168 is claimed by this seat and in flight.
  3. Declarations. Clause-②: yes (widening) replaces the claim's no, as the dev re-declared from the diff and the review answered: the published @object-ui/types interface gains an optional member. Metadata-protocol: none holds; the key was published by Navigation items accept search aliases, per locale (Setup redesign #39050) #39052. Each of the three packages gets a patch, and l1-face reads a changeset for every published package touched.
  4. Changeset, read sentence by sentence against the diff. The editor is shared by Setup and Studio (AppNavInspector.tsx). The last removal drops the key (patch({}, ['keywords'])), and nothing writes []. Each edit is checked with ObjectNavItemSchema.shape.keywords.safeParse, and the spec's message is shown. The six engine.inspector.appNav.keywords* strings are in studio/en.ts and studio/zh.ts. All four sentences hold.
  5. Scope. All six files sit within claim 7361464075's surface (nav-target.ts untouched). No content/docs/releases/ path.
  6. Tests. Tests 9 passed (9) at this head for the per-card file. Three ablations each turned exactly their own case red, with blob-equal restores. The app-shell type-check was not run locally on the fix-round worktree; CI Type Check UI is green at this head. The whole app-shell suite was not run locally; CI Test UI (16 shards) is green.
  7. Gates. Lint & Repo Gates and TypeScript Type Check: success at this head. l1-face: every check green or an expected skip. check-governed-merges: NOT governed, 358 lines. Dogfood battery not owed (no !, no narrowing).

Clause-②: yes (widening) · Metadata-protocol: none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup's and Studio's navigation editors let an admin edit an entry's search keywords (#39050)

2 participants