Skip to content

Add OTP field & unify popover touch/hover behavior#945

Open
Pante wants to merge 9 commits intomainfrom
feautre/unify-popover-touch-hover
Open

Add OTP field & unify popover touch/hover behavior#945
Pante wants to merge 9 commits intomainfrom
feautre/unify-popover-touch-hover

Conversation

@Pante
Copy link
Copy Markdown
Member

@Pante Pante commented Mar 29, 2026

Describe the changes

  • Add FOtpField widget with support for dividers, labels, descriptions, error messages, and form validation.
  • Add FOtpController for programmatic control of OTP input state.
  • Unify popover menu submenu item & tile hover behavior across touch and desktop platforms.

Checklist

  • I have read the CONTRIBUTING.md.
  • I have included the relevant unit/golden tests.
  • I have included the relevant samples.
  • I have updated the documentation accordingly.
  • I have added the required flutters_hook for widget controllers.
  • I have updated the CHANGELOG.md if necessary.

Copilot AI review requested due to automatic review settings March 29, 2026 05:36
@Pante Pante force-pushed the feautre/unify-popover-touch-hover branch from 23a9b8b to 7f0cf50 Compare March 29, 2026 05:38
@Pante Pante linked an issue Mar 29, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new OTP input widget to Forui while aligning cursor behavior across text-like inputs, and simplifies popover submenu interaction by unifying hover/tap handling across platforms.

Changes:

  • Introduce FOtpField, FOtpController, OTP item/divider widgets, styles, docs snippets, and golden/unit tests.
  • Add cursorWidth and cursorOpacityAnimates to FTextFieldStyle (and propagate to related styles/usages).
  • Remove hover configuration from FPopoverMenu/submenu APIs and adjust submenu trigger logic + tests accordingly.

Reviewed changes

Copilot reviewed 29 out of 62 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
forui/test/src/widgets/popover_menu/submenu_tile_test.dart Updates submenu tile tests for unified hover/tap behavior and adds a regression test for tap on hover-opened submenu.
forui/test/src/widgets/popover_menu/submenu_item_test.dart Updates submenu item tests for unified hover/tap behavior and adds a regression test for tap on hover-opened submenu.
forui/test/src/widgets/popover_menu/popover_menu_golden_test.dart Updates popover menu golden tests to reflect removal of hover parameter.
forui/test/src/widgets/otp_field/otp_field_golden_test.dart Adds comprehensive golden coverage for FOtpField across themes/states (divider/disabled/error/RTL/etc.).
forui/test/src/widgets/otp_field/otp_field_control_test.dart Adds unit tests for FOtpController selection/focus/traversal behavior (incl. truncation cases).
forui/test/src/widgets/otp_field/caret_golden_test.dart Adds golden tests for caret blinking behavior (animated opacity vs discrete blink).
forui/test/golden/macos/otp-field/neutral-light/single-item.png Adds new macOS golden asset for OTP field.
forui/test/golden/macos/otp-field/neutral-light/basic.png Adds new macOS golden asset for OTP field.
forui/test/golden/macos/otp-field/neutral-dark/basic.png Adds new macOS golden asset for OTP field.
forui/test/golden/macos/otp-field/caret-opacity-animates.png Adds new macOS golden asset for caret opacity animation.
forui/test/golden/macos/otp-field/caret-discrete-blink.png Adds new macOS golden asset for discrete caret blink.
forui/lib/widgets/otp_field.dart Adds public OTP field library exports (widget/control/style/items).
forui/lib/src/widgets/tile/tile_mixin.dart Removes submenu hover plumbing from tile shorthand API.
forui/lib/src/widgets/text_field/text_field_style.dart Adds cursor width + cursor opacity animation style knobs.
forui/lib/src/widgets/text_field/input/input.dart Applies new cursor style knobs to underlying TextField and refactors dispose placement.
forui/lib/src/widgets/popover_menu/submenu_tile.dart Removes hover parameter and updates trigger behavior to unify hover/tap handling.
forui/lib/src/widgets/popover_menu/submenu_item.dart Removes hover parameter and updates trigger behavior to unify hover/tap handling.
forui/lib/src/widgets/popover_menu/popover_menu.dart Removes hover configuration from menu/scope and unifies callbacks for hover + press.
forui/lib/src/widgets/otp_field/otp_item.dart Implements OTP item scope + rendering and adds divider widget.
forui/lib/src/widgets/otp_field/otp_field_style.dart Introduces FOtpFieldStyle + variant-driven item styling.
forui/lib/src/widgets/otp_field/otp_field_control.dart Adds FOtpFieldControl and FOtpController selection/traversal logic.
forui/lib/src/widgets/otp_field/otp_field.dart Implements FOtpField widget with form integration + error fade behavior.
forui/lib/src/widgets/otp_field/caret.dart Adds custom caret widget to mimic platform cursor blink behaviors.
forui/lib/src/widgets/item/item_mixin.dart Removes submenu hover plumbing from item shorthand API.
forui/lib/src/widgets/item/item.dart Minor style cleanup (uses .fromSTEB shorthand).
forui/lib/src/widgets/autocomplete/autocomplete_style.dart Propagates new cursor style knobs through autocomplete field style.
forui/lib/src/theme/theme_data.dart Adds otpFieldStyle to theme data and lerp/delta plumbing.
forui/lib/forui.dart Exports widgets/otp_field.dart from the package barrel.
forui/bin/commands/style/style.dart Extends style CLI generation to include OTP field styles and new cursor style properties.
forui/CHANGELOG.md Documents new OTP field and new text field cursor style properties; removes hover mention under popover menu.
docs_snippets/lib/usages/widgets/popover_menu.dart Updates popover menu usage snippets to remove hover argument.
docs_snippets/lib/usages/widgets/otp_field.dart Adds OTP field usage snippet for docs generation.
docs_snippets/lib/main.dart Adds routes for OTP field examples in snippets app.
docs_snippets/lib/examples/widgets/otp_field.dart Adds default + divider OTP field example pages.
docs/content/docs/form/otp-field.mdx Adds OTP field documentation page with preview/code/CLI/usage/examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@auto-maid
Copy link
Copy Markdown
Contributor

auto-maid bot commented Mar 29, 2026

Documentation Preview

Latest Commit SHA 6cef500
Preview URL https://a90feec6-forui-docs-dev.duobase.workers.dev/docs

You're seeing this because the docs/samples were updated.

Pante and others added 3 commits March 29, 2026 13:59
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Input OTP

2 participants