Skip to content

Vaadin Flow Components V25.2.2

Choose a tag to compare

@vaadin-bot vaadin-bot released this 24 Jul 10:00
· 72 commits to 25.2 since this release
8b15b4b

Vaadin Flow Components 25.2.2

This is a release of the Java integration for Vaadin Components to be used from the Java server side with Vaadin Flow.

Changes in Flow Components from 25.2.1

Changes in All Components

  • Chore:
    • ⧉ Increase Web-Component version
    • ⧉ Increase Web-Component version

Changes in vaadin-ai-components-flow

  • Breaking Changes:
    • ⧉ Switch form filler value options to items-based resolution (#9564) (CP: 25.2). PR:9627

      This PR cherry-picks changes from the original PR #9564 to branch 25.2. --- #### Original PR description > ## Description > > In form filler DX test sessions, the return type of value options APIs was a pain point. Even after updating examples and clarifying it in the documentation, it still was not intuitive: the developer had to think in labels (strings) when the rest of their codebase thought in domain objects, and had to supply a toValue converter that re-encoded the label-to-value mapping the field's ItemLabelGenerator already expressed. > > This PR replaces that shape with an items-based resolution path: > > - Registrations now carry the domain objects, not pre-rendered labels. Aligned with how the rest of the codebase models selection options. > - Labels for the LLM are derived through one ItemLabelGenerator. By default, the controller reflects the field's own setItemLabelGenerator(...) so common cases need no extra wiring; an explicit one can be supplied on ValueOptions for custom components or cases where the LLM should see a different label than the UI. > - When the LLM picks a label, the controller walks the registration's items, applies the same generator per item, and writes the first matching item to the field. The bijection lives in one place — the label generator — and the toValue converter is no longer needed and has been removed. > > Changed in ValueOptions: > - options(Collection<String>) → options(Collection<V>) > - options(BiFunction<String, Integer, List<String>>) → options(BiFunction<String, Integer, List<V>>) > > New in ValueOptions: > - itemLabelGenerator(ItemLabelGenerator<V>) — optional; falls back to the field's own labeler, then to String.valueOf(item). > > Changed in FormAIController: > - fieldValueOptions(ValueOptions<String>) → fieldValueOptions(ValueOptions<V>) > - fieldValueOptions(ValueOptions<V>, Function<String, V> toValue) removed. > > Other behavior: > - Items with duplicate labels resolve to the first in registration order; a fixed-options registration logs a warning at registration so the developer notices. > - A query-mode fill_form that arrives before any query_field_options call is rejected with a reason naming query_field_options so the LLM can recover on the next turn. > > > [!WARNING] > > The two-argument fieldValueOptions(ValueOptions, Function<String, V>) overload and the String-only generics on the single-argument variant are gone. > > Based on DX test findings. > > No related issue. > > ## Type of change > > - [ ] Bugfix > - [x] Feature > > ## Checklist > > - [x] I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview > - [x] I have added a description following the guideline. > - [ ] The issue is created in the corresponding repository and I have referenced it. > - [x] I have added tests to ensure my change is effective and works as intended. > - [x] New and existing tests are passing locally with my change. > - [x] I have performed self-review and corrected misspellings. > - [ ] Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

Changes in vaadin-combo-box-flow

  • Breaking Changes:

    • ⧉ Update multi-select-combo-box to synchronize on change (#9631) (CP: 25.2). PR:9683

      This PR cherry-picks changes from the original PR #9631 to branch 25.2. --- #### Original PR description > ## Description > > Fixes #9611 > > With @Push and two push frames around a server-side setValue, MultiSelectComboBox could reset its value to empty because the selected-items-changed notification also fires for programmatic changes and gets echoed back as a spurious client value change. > > - Synchronized the value on the web component change event instead of selected-items-changed, so only genuine user gestures are treated as client changes > - Updated TestBench helpers to dispatch change (and deselectAll to use clear()) > - Added integration tests for the push scenario and user value commits > > > [!WARNING] > > Client-side changes to the web component selectedItems property no longer synchronize to the server unless a change event is dispatched. Server-side setValue and end-user interactions are unaffected. > > ## Type of change > > - Behavior altering fix > > --- > > 🤖 Generated with Claude Code >

  • Fixes:

    • ⧉ Assign data provider after $connector function are defined (#9625). PR:9635

      This PR cherry-picks changes from the original PR #9625 to branch 25.2. --- #### Original PR description > The connector assigned comboBox.dataProvider near the start of initLazy, before $connector.requestPage and the other $connector functions were defined. Since Vaadin 25.2 the web component runs the dataProvider property observer synchronously, so the assignment immediately triggered a first-page load that called back into $connector.requestPage while it was still undefined. The resulting error aborted connector initialization, leaving the dropdown stuck on the loading spinner with empty items. > > Assign the data provider last, after all $connector functions exist, so the synchronous first-page load can safely call back into the connector. > > Fixes #9622 >

Changes in vaadin-context-menu-flow

  • Fixes:
    • ⧉ Store composed path for deferred context menu open (#9645). PR:9647

Changes in vaadin-grid-flow

  • Fixes:
    • ⧉ Render grid data when cache is populated before attach (CP: 25.2). PR:9704

      This PR cherry-picks changes from the original PR #9689 to branch 25.2. The connector on this branch doesn't have resolvePendingCallbacks, so the fix sets _hasData in $connector.confirm instead, which is where pending callbacks are resolved here. --- > When the connector receives data while the grid is still detached from the DOM, for example when a grid is rendered inside another grid's component renderer, there is no data provider call, so nothing sets the grid's _hasData property. After attaching, the grid then doesn't render the cached rows (the _flatSizeChanged observer only updates the virtualizer when _hasData is set) and also sends an unnecessary data request to the server. This change makes the connector set _hasData when resolving pending callbacks, which covers this case since populating the cache always ends with a confirm call. > > Fixes #9674

    • ⧉ Keep scroll position when setting item selectable provider (#9644). PR:9654

      This PR cherry-picks changes from the original PR #9644 to branch 25.2. --- #### Original PR description > This PR changes setItemSelectableProvider to use refreshViewport() instead of dataCommunicator.reset() to avoid resetting TreeGrid's scroll position and adds a corresponding test to TreeGridScrollPositionIT.

    • ⧉ Keep scroll position when toggling Grid enabled state (#9649). PR:9650

      This PR cherry-picks changes from the original PR #9649 to branch 25.2. --- #### Original PR description > This PR changes onEnabledStateChanged to use refreshViewport() instead of dataCommunicator.reset() to avoid resetting TreeGrid's scroll position and adds a corresponding test to TreeGridScrollPositionIT. >

Compatibility

  • This release use Web Components listed in Vaadin Platform 25.2.2
  • Tested with Vaadin Flow version 25.2.1