feat(components): page:tabs honors item-level visibleWhen — conditional tabs (framework#2606) - #2516
Merged
Merged
Conversation
…al tabs (framework#2606) Filters page:tabs items by their visibleWhen CEL predicate: FALSE removes the whole tab (header + panel), not just the panel content. Evaluation binds the same environment as page-component visibleWhen (record fields bare and via record./data., user/current_user, page.<var>) and re-evaluates live as page variables change. The strip is now controlled: when the ACTIVE tab's predicate flips false, selection falls back to the first visible tab instead of leaving a blank panel; the user's own selection is restored if the tab reappears. Canonical ADR-0089 key only — the deprecated visibility/visibleOn aliases are not read on this new surface. Items without visibleWhen behave as before. 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
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 15, 2026 14:55
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.
背景
framework#2606(条件 tab)的渲染器落地,配套 spec PR:objectstack-ai/objectstack#2967。基于 ADR-0089 重新评估后,item 级字段采用规范名
visibleWhen(不读visibility/visibleOnalias——新表面无存量元数据,只认规范键)。改动(
page:tabs渲染器)visibleWhen求值为 FALSE → 整条 tab(头 + 面板)从 tab 条移除;区别于子组件自身的visibleWhen(只隐藏面板内容、留下空 tab 头)。visibleWhen一致:record 字段(裸标识符及record./data.)、user/current_user、page.<var>;page 变量变化时响应式重算。谓词解析失败时 fail-open(保持可见),与 SchemaRenderer 的组件级语义一致。接受裸 CEL 字符串和 spec parse 产出的{ dialect, source }信封。visibleWhen的 item 行为完全不变;过滤后的 items 数组在可见性未变化时保持引用稳定,避免 count-probe memo/effect 无谓重跑。测试
新增
page-tabs-visibility.test.tsx(6 例):静态 false 隐藏整条 tab、无谓词 item 不受影响、page 变量驱动的响应式显隐、Expression 信封形式、激活 tab 被隐藏时回落到第一个可见 tab、visibilityalias 不被读取。components 包全量 29 files / 263 tests 通过;
turbo build --filter=@object-ui/components(含依赖)通过;eslint 0 errors。Refs framework#2606, framework#2579, ADR-0089.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FmuuXkuW3JH9LYXHHRnoQV
Generated by Claude Code