Skip to content

feat(example-showcase): demo field conditional rules on Invoice (B2)#1653

Merged
xuyushun441-sys merged 1 commit into
mainfrom
b2-showcase-conditional-rules
Jun 7, 2026
Merged

feat(example-showcase): demo field conditional rules on Invoice (B2)#1653
xuyushun441-sys merged 1 commit into
mainfrom
b2-showcase-conditional-rules

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

What

Exercises the B2 dual-side field conditional rules end-to-end on the showcase Invoice header:

issued_on: Field.date({ requiredWhen: "record.status in ['sent', 'paid']" }),
tax_rate:  Field.number({ readonlyWhen: "record.status == 'paid'" }),
paid_on:   Field.date({
  visibleWhen:  "record.status == 'paid'",   // UX-only — hidden until paid
  requiredWhen: "record.status == 'paid'",   // enforced client AND server
}),

Verification

Drives the objectui field-conditional-rules live e2e (Status → paid/sent/draft re-gates each dependent field). Example-only change; no published package affected.

🤖 Generated with Claude Code

Adds visibleWhen / readonlyWhen / requiredWhen to the showcase Invoice header
to exercise the full dual-side conditional-rule feature end to end:
- issued_on.requiredWhen = "record.status in ['sent', 'paid']"
- tax_rate.readonlyWhen  = "record.status == 'paid'"  (server also strips writes)
- paid_on.visibleWhen / requiredWhen = "record.status == 'paid'"

Drives the objectui field-conditional-rules live e2e.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 7, 2026 1:15pm

Request Review

@github-actions github-actions Bot added the size/s label Jun 7, 2026
@xuyushun441-sys xuyushun441-sys merged commit 4284557 into main Jun 7, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the b2-showcase-conditional-rules branch June 7, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants