Skip to content

feat: support visible_rule for form questions#1891

Open
yballul-bytedance wants to merge 1 commit into
larksuite:mainfrom
yballul-bytedance:feat/form-question-visible-rule
Open

feat: support visible_rule for form questions#1891
yballul-bytedance wants to merge 1 commit into
larksuite:mainfrom
yballul-bytedance:feat/form-question-visible-rule

Conversation

@yballul-bytedance

@yballul-bytedance yballul-bytedance commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Form questions can now carry a visible_rule (display condition) so a question is shown only when earlier questions satisfy the rule. The rule shares the exact same structure as the view filter, so that structure is extracted into a single shared reference that both +view-set-filter and visible_rule point to.

Changes

  • Document visible_rule in the --questions flag help for +form-questions-create / +form-questions-update, and transcribe the questions body (including visible_rule) into dry-run output so the preview reflects what is actually sent.
  • Add a shared filter-condition reference (skills/lark-base/references/lark-base-filter-condition.md) as the SSOT for the {logic, conditions} structure; lark-base-view-set-filter.md now references it instead of duplicating it.
  • Add visible_rule sections to the form-questions create/update refs (only needed when the user asks for a display condition; note that +form-questions-list returns it verbatim), and wire the new ref into SKILL.md.
  • Tests: pin flag help, verbatim visible_rule passthrough on create/update/list, and add dry-run E2E coverage.

Test Plan

  • Unit tests pass (go test ./shortcuts/base/, dry-run E2E under tests/cli_e2e/base/)
  • Manual local verification confirms the lark-cli base +form-questions-create/-list flow works against a real Base (BOE), including creating and reading back a question with a visible_rule

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Form questions now support conditional visibility via visible_rule.
    • List/create/update and create/update dry-run previews now include questions[].visible_rule in the request payload.
    • visible_rule can be cleared by setting it to null.
  • Documentation

    • Added shared visible_rule/filter-condition reference with structure, operators, and examples.
    • Updated form question and view filter docs to reference the shared condition format.
  • Tests

    • Added/extended unit and CLI e2e tests to confirm visible_rule is passed through verbatim and dry-run output matches.
    • Updated E2E coverage tracking.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aaaaddab-a1e0-4492-96f2-59cff578e410

📥 Commits

Reviewing files that changed from the base of the PR and between 0fd0d04 and f753d1f.

📒 Files selected for processing (11)
  • shortcuts/base/base_form_execute_test.go
  • shortcuts/base/base_form_questions_create.go
  • shortcuts/base/base_form_questions_update.go
  • shortcuts/base/base_shortcuts_test.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-filter-condition.md
  • skills/lark-base/references/lark-base-form-questions-create.md
  • skills/lark-base/references/lark-base-form-questions-update.md
  • skills/lark-base/references/lark-base-view-set-filter.md
  • tests/cli_e2e/base/base_form_questions_dryrun_test.go
  • tests/cli_e2e/base/coverage.md
🚧 Files skipped from review as they are similar to previous changes (9)
  • shortcuts/base/base_form_questions_create.go
  • tests/cli_e2e/base/base_form_questions_dryrun_test.go
  • skills/lark-base/SKILL.md
  • shortcuts/base/base_shortcuts_test.go
  • skills/lark-base/references/lark-base-view-set-filter.md
  • skills/lark-base/references/lark-base-form-questions-create.md
  • shortcuts/base/base_form_execute_test.go
  • tests/cli_e2e/base/coverage.md
  • skills/lark-base/references/lark-base-filter-condition.md

📝 Walkthrough

Walkthrough

Form question create and update commands preserve visible_rule in API and dry-run payloads. Flag descriptions and Lark Base references document the shared condition protocol, while unit and E2E tests validate list output, request bodies, and dry-run coverage.

Changes

Form visible rule support

Layer / File(s) Summary
Condition contract and command documentation
skills/lark-base/SKILL.md, skills/lark-base/references/lark-base-filter-condition.md, skills/lark-base/references/lark-base-form-questions-*.md, skills/lark-base/references/lark-base-view-set-filter.md
Documents the shared filter condition structure and its use for form question visible_rule, including references, updates, clearing, and supported values.
Command payload and dry-run forwarding
shortcuts/base/base_form_questions_create.go, shortcuts/base/base_form_questions_update.go
Adds visible_rule to flag descriptions and includes parsed questions data in create and update dry-run request bodies.
Passthrough and coverage validation
shortcuts/base/base_form_execute_test.go, shortcuts/base/base_shortcuts_test.go, tests/cli_e2e/base/base_form_questions_dryrun_test.go, tests/cli_e2e/base/coverage.md
Verifies list output, create/update request bodies, dry-run methods and endpoints, and updated coverage entries for visible_rule passthrough.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant BaseFormQuestionsCommand
  participant DryRunAPI
  CLI->>BaseFormQuestionsCommand: Provide questions JSON with visible_rule
  BaseFormQuestionsCommand->>DryRunAPI: Parse questions and attach request body
  DryRunAPI-->>CLI: Print POST or PATCH preview with visible_rule
Loading

Suggested reviewers: calendar-assistant, zhouyue-bytedance, kongenpei

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding visible_rule support for form questions.
Description check ✅ Passed The description follows the template with Summary, Changes, Test Plan, and Related Issues, and the content is sufficiently complete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added domain/base PR touches the base domain size/L Large or sensitive change across domains or core paths labels Jul 14, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/cli_e2e/base/coverage.md (1)

53-56: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Align testcase reference formatting in the Command Table.

For consistency with the rest of the Command Table, please include the filename prefix (base_form_questions_dryrun_test.go::) before the testcase names.

💅 Proposed nitpick fix
-| ✓ | base +form-questions-create | shortcut | TestBaseFormQuestionsCreateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough |
+| ✓ | base +form-questions-create | shortcut | base_form_questions_dryrun_test.go::TestBaseFormQuestionsCreateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough |
 | ✕ | base +form-questions-delete | shortcut |  | none | form workflows not covered |
 | ✕ | base +form-questions-list | shortcut |  | none | form workflows not covered |
-| ✓ | base +form-questions-update | shortcut | TestBaseFormQuestionsUpdateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough |
+| ✓ | base +form-questions-update | shortcut | base_form_questions_dryrun_test.go::TestBaseFormQuestionsUpdateVisibleRuleDryRun | questions[].visible_rule | dry-run: request shape + visible_rule body passthrough |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/cli_e2e/base/coverage.md` around lines 53 - 56, Update the testcase
references in the Command Table entries for form-questions-create and
form-questions-update to prepend base_form_questions_dryrun_test.go:: to each
testcase name, matching the established formatting used elsewhere in the table.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/cli_e2e/base/coverage.md`:
- Around line 53-56: Update the testcase references in the Command Table entries
for form-questions-create and form-questions-update to prepend
base_form_questions_dryrun_test.go:: to each testcase name, matching the
established formatting used elsewhere in the table.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 679a67ee-c059-4f3e-833f-9a2cefb5de69

📥 Commits

Reviewing files that changed from the base of the PR and between 8acd55e and 9e24135.

📒 Files selected for processing (11)
  • shortcuts/base/base_form_execute_test.go
  • shortcuts/base/base_form_questions_create.go
  • shortcuts/base/base_form_questions_update.go
  • shortcuts/base/base_shortcuts_test.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-filter-condition.md
  • skills/lark-base/references/lark-base-form-questions-create.md
  • skills/lark-base/references/lark-base-form-questions-update.md
  • skills/lark-base/references/lark-base-view-set-filter.md
  • tests/cli_e2e/base/base_form_questions_dryrun_test.go
  • tests/cli_e2e/base/coverage.md

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@f753d1f51f85f4485a26515143ca1a45a67aa734

🧩 Skill update

npx skills add yballul-bytedance/cli#feat/form-question-visible-rule -y -g

@yballul-bytedance yballul-bytedance force-pushed the feat/form-question-visible-rule branch from 9e24135 to 0fd0d04 Compare July 15, 2026 02:44
Form questions can now carry a visible_rule (display condition) so a
question shows only when earlier questions match the rule. The rule shares
the exact same structure as the view filter, so extract that structure into
a single shared reference (lark-base-filter-condition.md) that both
view-set-filter and visible_rule point to.

- create/update shortcuts: document visible_rule in --questions help and
  transcribe the questions body (including visible_rule) into dry-run output
- skill refs: add visible_rule sections to form-questions create/update,
  note it is only needed when the user asks for a display condition, and
  that form-questions-list returns it verbatim
- tests: pin flag help, verbatim visible_rule passthrough on
  create/update/list, and add dry-run E2E coverage
@yballul-bytedance yballul-bytedance force-pushed the feat/form-question-visible-rule branch from 0fd0d04 to f753d1f Compare July 15, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant