feat(kanban): accept CEL { condition, style } conditional-formatting rules (#1584 follow-up)#2550
Merged
Conversation
…rules (#1584 follow-up) Since #1584 moved kanban card styling onto the shared CEL evaluator, the runtime already accepts the spec `{ condition, style }` rule shape — but the type and zod schema still only allowed the native `{ field, operator, value }` shape, so a CEL kanban rule failed validation for something that worked at runtime. Widen `KanbanConditionalFormattingRule` (now a union with `SpecConditionalFormattingRule`) and `ObjectKanbanSchema`'s zod to accept both shapes, matching list/grid `conditionalFormatting` and the runtime. The four plugin-kanban type sites now reference the shared `@object-ui/types` type. Back-compat: the native shape keeps validating unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LwrWThBJgvcfPtqNHpstB
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
Summary
Follow-up to #1584 (merged in #2544). That PR moved kanban card styling onto the shared CEL evaluator (
resolveConditionalFormatting), so the runtime already accepts the spec{ condition, style }rule shape on kanban cards — but the type + zod schema still only allowed the native{ field, operator, value }shape. So an author who wrote a CEL kanban rule got a validation error for something that works at runtime. This closes that type/runtime gap.What changed
@object-ui/typesKanbanConditionalFormattingRuleis now a union:KanbanNativeConditionalFormattingRule | SpecConditionalFormattingRule(the native field/operator/value shape, or the spec{ condition, style }CEL shape) — matching list/gridConditionalFormattingRule.ObjectKanbanSchema's zodconditionalFormattingwidened to az.unionof both shapes.KanbanNativeConditionalFormattingRule.@object-ui/plugin-kanban— the four narrow local/inlineconditionalFormattingtypes (KanbanImpl, KanbanEnhanced, types.ts, index.tsx) now reference the shared@object-ui/typestype instead of duplicating a narrow shape.Back-compat
The native
{ field, operator, value }shape keeps validating and type-checking unchanged; the change is purely additive (a union arm).Tests
packages/types/.../kanban-conditional-formatting.test.ts— zod accepts native, CEL{ condition, style }, and a mixed list; type-level assertion thatKanbanConditionalFormattingRuleadmits both shapes. Full types + plugin-kanban suites pass (187 tests);turbo type-checkgreen.Context — other #1584 follow-ups considered
While scoping this, I evaluated the follow-ups I'd suggested and made deliberate calls:
@objectstack/formula): measured, not warranted. Benchmark showed CEL formatting at ~155µs/row (3 rules) vs ~26µs/row legacy — ~31ms for a 200-row × 3-rule full pass, i.e. single-digit ms at realistic page sizes / with virtualization. Not a hotspot; no framework change.visible/disabledand field*Whenalready get Studio CEL authoring viaConditionBuilder. Better tracked under Studio: CEL editor (validate + autocomplete) for field conditional rules (visibleWhen/readonlyWhen/requiredWhen) #1582 than shipped speculatively.🤖 Generated with Claude Code
Generated by Claude Code