Skip to content

Move form submission callbacks to submit and improve form samples - #3

Merged
eosobande merged 6 commits into
mainfrom
feat/form-submission-and-integration
Oct 27, 2026
Merged

eosobande merged 6 commits into
mainfrom
feat/form-submission-and-integration

Conversation

@eosobande

@eosobande eosobande commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Supply the success callback at submit instead of storing it on Form. Preserve the existing reactive validation behavior: errors are tracked as inputs change, and submit enables reporting before checking the latest stored errors.

Breaking API for the next release:

  • Remove onSubmit from Form and pass success to submit(onInvalid = { ... }) { ... }. Old submit { ... } trailing lambdas handled invalid input; move those handlers to the named onInvalid argument.
  • Rename shouldShowErrors to isErrorReportingEnabled in constructors, saveable state helpers and property access. This controls error reporting and form validity; validation runs regardless of the flag.

Both submit callbacks receive FormScope, allowing reusable invalid handlers to inspect fields and errors. ValidationEffect.validators now defaults to an empty list, matching FormField.

The existing signup sample demonstrates reusable multiline input with a visible length counter and includes notes in its submitted summary. A short README snippet shows server-error assignment through the existing field API; no backend response simulation or request policy is added. README and KDoc explain the existing reactive-validation boundary and include migration examples.

No validation registry or synchronous submit-time validation is added. Existing CI/CD, Gradle configuration and test cases are preserved; test call sites are migrated to the new signatures. No additional tests or publication-verification infrastructure remain.

Validation: the existing 31 library tests and 1 sample test passed on Android JVM, with no failures or skips. Existing tests exercise a reusable scoped invalid handler and omitted validators. The reactive validation and reporting behavior is preserved.

This PR remains a draft; no version or release-signing changes are included.

@eosobande eosobande changed the title Move form submission callbacks to submit and verify published consumers Move form submission callbacks to submit and improve form samples Oct 26, 2026
@eosobande
eosobande marked this pull request as ready for review October 26, 2026 21:26
@eosobande eosobande self-assigned this Oct 26, 2026
@eosobande
eosobande requested a review from atunwo October 27, 2026 11:02

@atunwo atunwo 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.

This change moves submission callbacks to submit, renames the error-reporting flag, and updates documentation and samples with multiline notes and counters. No blocking issues found. The callback routing, state-saving format, reactive-validation behavior, migrated tests, and sample value flow are consistent with the documented breaking API. Supplied CI reports successful build/test and analysis checks; I did not independently run Gradle tests or verify Android/iOS UI behavior.

@eosobande
eosobande merged commit fd154c6 into main Oct 27, 2026
4 checks passed
@eosobande
eosobande deleted the feat/form-submission-and-integration branch October 27, 2026 11:32
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