feat(spec)!: promote userFilters.allowAddTab,随后收紧 UserFiltersSchema (#5073) - #5237
Merged
Merged
Conversation
…sSchema (#5073) `UserFiltersSchema` was the last shape #4001 批 18 left open in `ui/view.zod.ts` whose blocker was a capability question rather than a strictness one. objectui's renderer reads `config.allowAddTab` and renders an add-tab affordance from it (`plugin-list/src/UserFilters.tsx:182`/`:742`), and its own schema declared the key — the difference between the two shapes was exactly that one key. Because `saveMetaItem` validates with `safeParse` but persists the ORIGINAL body, the stripped key still reached the renderer, so the capability worked. Closing without declaring it would have 422'd a shipped config with a message naming a key the author was right to write (finding 7), not converted a silent failure into a loud one. Maintainer adjudication (2026-08-04) chose promote-then-close in one PR: - `allowAddTab` is DECLARED, so the capability is discoverable from the contract (JSON Schema / Studio SchemaForm / AI authors) instead of one React file. The `.describe()` is scoped to what the renderer really does — it renders the affordance; the button carries no click handler today, filed separately, and promising more would be PD#10. - `UserFiltersSchema` closes behind it, in the same change, so there is no state where the key is declared but its neighbours still vanish silently. Closing flips `ObjectUserFiltersSchema` (`.omit()`ed off the base, and `.omit()` inherits posture) from dropping the page-only keys to rejecting them — 批 6e's question, and the wanted answer: the CLI lint already reported them, so the two doors now agree. But `.omit()` also inherits the base's error map, whose `knownKeys` still listed the omitted keys: measured on the flip, `tab` was answered "Did you mean `tab` -> `tabs`?", steering the author at the one key that surface refuses. The object variant now builds its map over the OMITTED shape (shape still derived by `.omit()`, so #2231 holds) with `guidance` pointing all three page-only keys at `listViews`. Ledger: view.zod.ts Class 6 -> 5 authorable; counts regenerated via `gen:strictness-ledger` (ui/ strict 117 -> 119, strip 76 -> 75, sites 50 -> 51). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
…rfilters-allowaddtab
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…rfilters-allowaddtab
#5221) The merge with origin/main brought in #5221 (`chart.zod.ts` gains `ChartDrillDownSchema`). Git text-merged the GENERATED counts file cleanly and WRONGLY — the ledger's own documented failure mode: each side's row deltas do not overlap, so the subtotals merge clean while naming a tree neither branch ever had (483/199, missing #5221's site). Regenerated via `gen:strictness-ledger` from the merged tree, which is the only state in which the numbers are right: 484 sites / ui 200, strict 244 / ui 120. Both hand-written prose rows survive untouched — `view.zod.ts` (this PR) and `chart.zod.ts` (#5221) are different rows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 107 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…er row Both spots described the add-tab button's missing click handler as "filed separately" without the number, which is the shape AGENTS.md #13 warns about — a decision nobody can find. Now the reader of either surface can reach the evidence. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
xuyushun441-sys
marked this pull request as ready for review
August 4, 2026 12:24
xuyushun441-sys
pushed a commit
that referenced
this pull request
Aug 4, 2026
…-1) → 15 合并队列以 MERGE_CONFLICT 踢出后重新同步 origin/main(merge,非 rebase)。 #5237(#5073 allowAddTab)与本批从两个不同目录改这份台账,散文行不重叠, git 干净合并;数字零手改,counts.md 按 merge=os-regen 从合并后的树整体重生成。 重算结果 15 = `ui/` 7 → 6(#5237)+ `data/` 22 → 9(批 20),两边分支都没写过 这个数——正是 #5107 拆分要达到的效果。这一条也补进 data/ 段落:它是第十二次 实例,也是第一次没让任何人付出代价。 #5237 对 `ui/app.zod.ts` 的改动(`apis` 墓碑文案)与本批的 BaseNavItemSchema 判定互不相干,两侧都在;它对 scripts/strictness-ledger.test.ts 的 view 计数 5 也是它自己的领地。 门:spec 308 文件 / 7929 测试通过;typecheck 通过;check:generated 9/9; check:strictness-ledger 通过(484 站点,authorable 剩 15)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
This was referenced Aug 4, 2026
Merged
This was referenced Aug 4, 2026
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 #5073
按本单已记录的维护者裁决 A(2026-08-04)执行:promote
allowAddTab进 spec 的UserFiltersSchema,同 PR 完成该 schema 的收紧。没有重新论证选项,也没有留中间态。实施前重新实测了裁决所依赖的前提,与 issue 记载一致:HEAD 上
UserFiltersSchema仍是z.object(strip),spec 声明{element, fields, tabs, showAllRecords},objectui 的packages/types/src/zod/objectql.zod.ts:265声明{element, fields, tabs, allowAddTab, showAllRecords}—— 两边差集恰好就allowAddTab一个键。为什么之前不能直接关
objectui 的渲染器真读
config.allowAddTab并据此渲染「新增 tab」入口(plugin-list/src/UserFilters.tsx:182/:742)。而saveMetaItem用safeParse校验后原样存原始 body(丢弃parsed.data,好让 Studio 辅助键活过往返),所以被 strip 掉的只是那份被丢弃的解析结果 —— 存储里键还在,渲染器读得到,能力今天是工作的。直接收紧不是「把静默失效变响亮」(战役的授权),而是把已发布、在用的配置变成 422,且 422 会点名一个作者本来写对了的键 —— finding 7 的形状。落地内容
1.
allowAddTab声明进UserFiltersSchema(additive)。 能力从此可从契约被发现:JSON Schema、Studio SchemaForm、参考文档、AI 作者都看得到,而不是只存在于一个 React 文件里。.describe()刻意收窄到渲染器真做的事 —— 「渲染出新增 tab 的入口」,不承诺点击后能创建预设。因为实测那个按钮没有 click handler(同一个return里预设 tab 有onClick,它没有),写成「终端用户可以新增预设」就是 PD#10 的「宣传运行时不交付的能力」。渲染器那半边已另行立案 #5236(unassigned),不在本 PR 范围。2.
UserFiltersSchema收紧(z.object→strictObject),未知键从静默丢弃变为带处方的拒绝。3. 批 6e 的翻转如期发生,并且补上了它自己制造的坑。
ObjectUserFiltersSchema由UserFiltersSchema.omit()派生,.omit()继承基类姿态,所以基类一关,对象视图上的tabs/showAllRecords/allowAddTab从「丢弃」翻成「拒绝」—— 这个翻转是想要的:CLI lint(packages/lint/src/validate-list-view-mode.ts)早就在报同一个配置,此前两扇门互相矛盾,现在一致。但
.omit()连基类的错误映射一起继承,而那份knownKeys是从基类形状读的、仍然含被 omit 掉的键。实测(改之前):把作者指向这个形状唯一拒绝的键 —— 用 finding 7 的修复制造了一次 finding 7。而这次拒绝正是本 PR 造出来的,所以消息也是本 PR 的责任。对象变体改为携带自己的映射,候选池按 omit 后的形状构建(形状仍由
.omit()派生,#2231 的 derive-by-reference 不变),三个 page-only 键各带guidance指向listViews。现在:未被打扰的既有姿态
ViewFilterRuleSchema(三处豁免:JSDoc +view-filter-rule-wire-id.test.ts钉 + 台账行)—— 未触碰;该文件 7 条断言全绿。批 18 测试文件的头注补了一句,说明它是另一个文件里按另一份证据开着的,别把两组合并。ViewItemSchema×2 /FormFieldBaseSchema/ListView.sort—— 仍按各自的实测理由开着。台账(#5220 之后的新纪律)
gen:strictness-ledger整体重生成,未手改一个数。ui/sites 198→199、strict 117→119、strip 76→75;view.zod.tssites 50→51、strip 6→5(新增的那个 site 是对象变体改用strictObject(的调用,它本身是 strict)。view.zod.ts那一行(feat(spec,lint): 声明 chart segment drill ——ChartDrillDownSchema,挂在真正读它的那一层 (#5022) #5221 动的是chart.zod.ts行,不同行,无冲突)。Class按格式契约的词表从mixed · 6 authorable改为mixed · 5 authorable,并把UserFiltersSchema从「still open」改写成结案记录(含裁定依据、describe 收窄的理由、以及上面那个继承错误映射的坑)。check:strictness-ledger绿。破坏性 + 迁移
.changeset/user-filters-allow-add-tab-promote-and-close.md(major;.changeset/pre.json已确认 mode:pre / tag:rc,v17 窗口开着),正文带 FROM → TO:userFilters上的未知键 → 删除或改成想表达的已声明键(错误信息点名并给候选)。allowAddTab本身不需要迁移 —— 它现在是合法键。userFilters.tabs→ 对象的listViews具名条目;showAllRecords→ 默认列表视图即「全部记录」入口;allowAddTab→ ViewTabBar 自带的新增控件。验证
生成物经
check:generated --fix只重生成被证明陈旧的 2 个(gen:docs/gen:strictness-ledger);authorable-surface.json由 build 带出,新增一行ui/UserFilters:allowAddTab。已合入origin/main(未 rebase / 未 force-push),合并后重跑上述闸门仍全绿。顺带发现(未在本 PR 修)
allowAddTab渲染出的「新增 tab」按钮没有 click handler —— 契约刚声明的能力只交付了一半 #5236 — objectuiallowAddTab渲染的按钮没有 click handler。方向(实现 / 移除)牵扯 ADR-0047 的 session-scoped 承诺与元数据写入权限,按「能力问题立案不猜」交维护者。🤖 Generated with Claude Code
https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
Generated by Claude Code