Skip to content

feat: add a Checkbox template - #997

Open
SmrutiSawant wants to merge 8 commits into
frappe:developfrom
SmrutiSawant:feat-form-checkbox
Open

SmrutiSawant wants to merge 8 commits into
frappe:developfrom
SmrutiSawant:feat-form-checkbox

Conversation

@SmrutiSawant

@SmrutiSawant SmrutiSawant commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

Adds a Checkbox to Form parts.

When you select the checkbox, you can set:

  • Name: what the answer is saved as
  • Value: what gets sent when it's checked
  • Checked: whether it starts checked
  • Required: whether it must be checked before the form can be sent

Demo:

checkbox.mp4

Input, textarea and select fields now show Name and Required in Input
Options, so you no longer have to set them in HTML Attributes. These
settings read customAttributes first, where the form templates keep
them, and keep both copies in sync when edited, since published pages
let customAttributes win. Type is hidden on textareas and selects, and
Placeholder on selects, where they do nothing.

The Label template's input now has the id its label points at.
@greptile-apps

greptile-apps Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with a non-blocking issue around hidden dynamic values.

Reviews (2) · Last reviewed commit: "fix: let labels that wrap blocks accept ..." · Reviewed by Greptile

Comment thread frontend/src/block.ts Resolved
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.19%. Comparing base (10faafe) to head (23c8dce).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #997      +/-   ##
===========================================
+ Coverage    76.07%   76.19%   +0.12%     
===========================================
  Files          131      131              
  Lines        13405    13435      +30     
===========================================
+ Hits         10198    10237      +39     
+ Misses        3207     3198       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

if (!blockController.isBlockSelected()) return false;
// null marks an inherited attribute the instance removed, so it gets no row
const customAttributes = blockController.getFirstSelectedBlock().getCustomAttributes();
return Object.fromEntries(Object.entries(customAttributes).filter(([, value]) => value !== null));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Hidden attributes still use data

Clearing an inherited attribute with a dynamic value now hides its row from HTML Attributes, but leaves that value active. The renderer can add the attribute back, while the panel no longer shows why. Remove the dynamic value before hiding the row, or keep bound rows visible.

Knowledge Base Used: Property and style editing

Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/utils/blockController.ts
Line: 203

Comment:
**Hidden attributes still use data**

Clearing an inherited attribute with a dynamic value now hides its row from HTML Attributes, but leaves that value active. The renderer can add the attribute back, while the panel no longer shows why. Remove the dynamic value before hiding the row, or keep bound rows visible.

**Knowledge Base Used:** [Property and style editing](https://app.greptile.com/frappe/-/custom-context/knowledge-base/frappe/builder/-/docs/property-and-style-editing.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed in 23c8dce

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant