feat(spec): conditional tabs — page:tabs items accept a visibleWhen CEL predicate (#2606) - #2967
Merged
Merged
Conversation
…EL predicate (#2606) Re-evaluated #2606 under ADR-0089: the proposal predates the ADR, which made visibleWhen the single canonical conditional-visibility key and demoted visibility/visibleOn to deprecated aliases. The new item-level key therefore ships as visibleWhen from day one; the aliases are NOT accepted on this new surface (no legacy metadata to alias for — Prime Directive #12, one strict contract over N dialects). Semantics: when the predicate evaluates FALSE the whole tab (header + panel) is omitted, unlike a child component's own visibleWhen which hides only the panel content and leaves an empty tab header. Binds the same environment as page-component visibleWhen: record + current_user + page.<var>. Additive, back-compatible (optional field) → minor. Renderer lands in objectui (item filtering + active-tab fallback to the first visible tab). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FmuuXkuW3JH9LYXHHRnoQV
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 98 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…surface ledger (#2606) The ADR-0058 D7 / ADR-0060 conformance ratchet re-discovers every ExpressionInputSchema field in packages/spec/src and fails the build if any is unclassified. The new tab-item visibleWhen surface (ui/component.zod.ts) needs a ledger row: it belongs to cel-ui (interpret, fail-soft-log) alongside the page/view visibility predicates — evaluated by the objectui page:tabs renderer. Fixes the Test Core / Dogfood Regression Gate failures on this branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FmuuXkuW3JH9LYXHHRnoQV
os-zhuang
marked this pull request as ready for review
July 15, 2026 14:56
os-zhuang
added a commit
that referenced
this pull request
Jul 16, 2026
…estore PageTabsProps (#2978) (#3012) * fix(spec): stop gen:schema silently unpublishing transform-bearing schemas (#2978) PageTabsProps vanished from json-schema/ when #2967 added an ExpressionInputSchema (.transform) field — zod's toJSONSchema cannot represent transforms in the default output mode, and build-schemas.ts silently skipped it, so the next gen:docs run would have deleted the published PageTabsProps reference section. Two-part fix: 1. io:'input' fallback — when output-mode conversion fails on a transform, retry with io:'input'. These JSON Schemas describe what authors WRITE, and the input side of a transform pipe is plain data, so it is representable (for PageTabsProps.visibleWhen it emits the correct `anyOf: [string, expression envelope]` authoring shape). Rescued schemas are marked `x-io: "input"`. This restores PageTabsProps and 149 other transform-blocked public contracts (ObjectSchema, FieldSchema, FlowSchema, PageSchema, ActionSchema, …); only 18 truly unrepresentable schemas (function/Date/BigInt/custom) remain skipped. 2. Disappearance ratchet — json-schema/ is gitignored, so the committed json-schema.manifest.json records every schema key ever emitted. A key present in the manifest but absent from a build now fails gen:schema loudly with remediation steps; deliberate retirements must remove the key in the same PR. Silent skip remains only for types that have never been representable. Also escape literal `|` in the description cell of generated property tables (build-docs.ts) — rescued schemas surfaced descriptions with pipes that split GFM table rows. Closes #2978 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fn6qMKtJeVbs2KzouWDHhB * docs(references): regen from restored JSON Schemas (#2978) gen:docs over the post-fix json-schema/ output. PageTabsProps keeps its section (now including the visibleWhen items shape from #2967), and the 149 schemas rescued by the io:'input' fallback gain reference sections — previously delivered-but-undeclared contracts (Prime Directive #10). Existing table rows with literal pipes in descriptions are re-emitted with GFM escaping. Verified: `pnpm docs:build` compiles all regenerated MDX. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fn6qMKtJeVbs2KzouWDHhB * fix(spec): address CodeQL alerts in gen:schema/gen:docs scripts (#3012) - build-schemas.ts: read the ratchet manifest directly and treat ENOENT as first-run bootstrap instead of existsSync-then-read (TOCTOU). - build-docs.ts: escape backslashes before pipes in table-cell descriptions — an existing `\|` would otherwise decay into an escaped backslash followed by a live pipe, splitting the GFM cell. No output changes: regenerated json-schema/ and references/ are byte-identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fn6qMKtJeVbs2KzouWDHhB --------- Co-authored-by: Claude <noreply@anthropic.com>
68 tasks
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.
背景:基于 ADR-0089 对 #2606 的重新评估
#2606(2026-07-05)提出给
page:tabs的 item 加visibility(CEL)。该提案早于 ADR-0089(2026-07-14 接受),重新评估结论:ExpressionInputSchema(CEL)、不进对象层、加性可选字段 → minor。这些设计边界与 ADR-0085 / 详情页相关子表:降低对自定义 page 的依赖(relatedList 三态 + 列派生 + 确定性排序) #2579 一致,不受 ADR-0089 影响。visibleWhen,visibility/visibleOn降级为@deprecatedalias(仅为存量元数据保留)。因此本字段从第一天起就叫visibleWhen。visibility/visibleOnalias(Prime Directive Add comprehensive test suite for Zod schema validation #12:一个严格契约优于 N 种方言)。测试中显式固化了这一点。改动
PageTabsProps.items[]新增可选visibleWhen: ExpressionInputSchema:visibleWhen(只隐藏面板内容、留下空 tab 头)。visibleWhen一致 ——record+current_user,外加page.<var>(page 变量变化时响应式重算)。visibleWhen的 item 行为完全不变。测试
{ dialect: 'cel', source }信封;信封形式直接接受。visibilityalias 在 tab item 上不被折叠(新表面只认规范键)。@objectstack/specbuild(含 DTS)通过。配套
渲染器落地在 objectui 同名分支 PR(item 过滤 + 激活 tab 被隐藏时回落到第一个可见 tab)。
Closes #2606. Refs #2579, ADR-0089.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FmuuXkuW3JH9LYXHHRnoQV
Generated by Claude Code