feat: initial implementation - #2
Conversation
paodb
left a comment
There was a problem hiding this comment.
Other commets for review:
- .vaadin/copilot/vaadin-copilot.properties should not be commited in my opinion. It belongs in .gitignore.
- 3 files still say Copyright (C) 2023 (DemoView, EasyFormDemoView, and one more) while inceptionYear is 2026 and everything else says 2026. Should we stick to the original year this was started or to the current one?
|
All finding are fixed, please review again @javier-godoy @paodb |
javier-godoy
left a comment
There was a problem hiding this comment.
API design review
The shape is right for this kind of add-on: one entry point, a fluent per-field wrapper, sensible defaults, and escape hatches (getBinder(), getFormLayout(), getComponent()). Javadoc coverage is unusually good. The problems are concentrated in a few places, and two of them (the inline comments on getField(String) and setFieldOrder) are the kind that are painful to change after a 1.0 release.
Anchored findings are in the inline comments. The rest, which isn't tied to a particular line:
Gaps
- No events. No status/validity listener, so there's no supported way to enable Save only when the form is valid or dirty — the single most common thing consumers want. Expose
addStatusChangeListener/addValueChangeListener. - No extension points. The class isn't final but everything is private and the constructor does full discovery + binding, so a subclass can't influence label generation, property filtering, or component decoration. For a shared add-on, add protected
createComponent(name, type)/createLabel(name)/includeProperty(PropertyDescriptor). - No i18n story.
"Save"/"Cancel"are hardcoded andSharedUtil.camelCaseToHumanFriendlylabels aren't overridable in bulk. AsetLabelGenerator(...)plus the usual VaadinsetI18n(...)would cover it. - No collection accessor.
getFieldNames()/getFields(), and afindFieldreturningOptionalalongside the throwinggetField. - No nested properties.
Bindersupports"address.street"; discovery here is flat, so it just fails. Worth documenting even if not supported. addButtonhas noremoveButton, and the icon overload takes a singleButtonVariantwhere varargs is the Vaadin convention.- Consider
HasStyleandHasEnabled(disabling the whole form is a real use case) alongside the currentHasSize.
Smaller / naming
EasyFormuses void setters whileEasyFormFieldis fluent — two vocabularies in one API. Pick one, or at least make the form-level configuration chainable too.EasyForm.EasyFormFieldstutters. As a public type it'd read better as a top-levelEasyFormFieldin the same package, or asEasyForm.Field.getFieldreturning a config wrapper rather than the component will surprise people;getField(name).getComponent()is the actual component.configureField(name)orfield(name)would signal it better.
javier-godoy
left a comment
There was a problem hiding this comment.
I noted two comments in pom.xml that have been flagged as "resolved" but couldn't find them applied in the latest commits.
https://github.com/FlowingCode/EasyFormAddon/pull/2/changes#r3760649019
https://github.com/FlowingCode/EasyFormAddon/pull/2/changes#r3737473057
javier-godoy
left a comment
There was a problem hiding this comment.
Automated review of EasyForm.java at 14b1b5c. Each finding below was reproduced with a throwaway probe test against this commit (probes deleted; the 101-test suite is green). Two more findings from an earlier pass are already resolved here: the partial-mutation bug in the old hideFields/readOnlyFields (now setVisibleFields, which validates via requireKnownProperties before mutating), and setFieldOrder no longer rebinding every field.
|
All comments are addressed |
javier-godoy
left a comment
There was a problem hiding this comment.
Approved. Please squash WIPs.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (24)
💤 Files with no reviewable changes (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughChangesEasyForm feature and project integration
Estimated code review effort: 5 (Critical) | ~120 minutes Merge Risk: ⚪ Minimal · up to The change is merge-ready after normal checks and review; no actionable merge-blocking risk remains. 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. Comment |
a518a97 to
b4a81ba
Compare
Summary by CodeRabbit
New Features
Documentation
Chores