Skip to content

Conversation

@InesaFitsner
Copy link
Contributor

@InesaFitsner InesaFitsner commented Aug 23, 2025

Description

Fixes #5561

Test Code

# Test code for the review of this PR

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Screenshots

Additional details

Summary by Sourcery

Add Dropdown text_change event and improve control customization by enriching theme properties and adding new control parameters; expand integration test coverage across core controls using pytest_asyncio fixtures.

New Features:

  • Add on_text_change event to Dropdown control to trigger text_change when user input changes
  • Introduce label_padding property for NavigationBar controls
  • Allow SegmentedButton.selected_icon to accept IconData or Control

Bug Fixes:

  • Fix expand_loose assignment in Dropdown.before_update to only apply when expand is a boolean

Enhancements:

  • Enrich theme classes with detailed docstrings and add new properties (e.g., size_constraints, padding in SearchBar, BoxShadowValue in IconTheme)
  • Refine TabBar documentation and improve property definitions across material controls

Documentation:

  • Add user-facing docstrings for multiple theme properties across SearchBarTheme, SearchViewTheme, NavigationDrawerTheme, NavigationBarTheme, SegmentedButtonTheme, IconTheme, and DataTableTheme

Tests:

  • Revamp integration tests with pytest_asyncio fixtures and function-scoped flet_app
  • Add and enhance integration tests for Icon, NavigationBar, SegmentedButton, NavigationDrawer, and SearchBar covering basic and theme scenarios

Introduces `bar_size_constraints` to the SearchBar control and theme, allowing optional size constraints. Also updates and expands documentation for SearchBar properties and SearchBarTheme overrides for better clarity and developer guidance.
Introduces a new integration test for the SearchBar control, including golden images for its basic and opened states on macOS. The test verifies SearchBar rendering and interaction, ensuring correct UI behavior.
Introduces a new test for SearchBar theming in macOS, including screenshots for normal, hovered, and opened states. Verifies custom theme properties and interaction behaviors.
Introduces viewPadding, viewBarPadding, and shrinkWrap properties to SearchBar and SearchViewTheme for enhanced customization. Updates integration tests and documentation to reflect new options for controlling search view layout and appearance.
Eliminated the handle_tile_click function and its usage in SearchBar integration tests, as the click handler is no longer needed. Also added detailed docstrings to NavigationDrawerTheme fields for improved documentation.
Renamed screenshot files and updated test names for clarity. Added a new test for navigation drawer theme and its corresponding golden image. Refactored fixture usage and screenshot assertions to improve test structure and maintainability.
Introduces the label_padding property to NavigationBar and NavigationBarTheme for customizing label padding. Improves and clarifies documentation for NavigationBar, TabBar, SearchBarTheme, SearchViewTheme, and NavigationDrawerTheme properties, including corrections to property references and expanded descriptions.
Renamed navigation_bar.png to basic.png and added new golden images for themed NavigationBar states. Updated test_navigation_bar.py to include separate tests for basic and themed NavigationBar, verifying appearance under different theme settings and user interactions.
Updated SegmentedButton to support both IconData and Control for selected_icon. Improved integration tests for segmented button, added golden images for macOS, and documented SegmentedButtonTheme options. Also clarified NavigationBarTheme test comments.
Introduces a text change event handler for the Dropdown control in both Dart and Python implementations. The Dart Dropdown now uses a TextEditingController to track input changes, updating properties and triggering the new 'text_change' event. The Python Dropdown class adds an 'on_text_change' callback for handling text input changes.
Renamed and updated the icon test to use function-scoped async fixtures and improved test isolation. Enhanced documentation for IconTheme properties with detailed docstrings. Removed and replaced golden image files for icon and segmented button tests.
Introduces a new integration test for icon theme settings, including screenshot validation. Updates IconTheme's 'shadows' attribute type from list[BoxShadow] to BoxShadowValue for consistency with usage.
Refined docstrings for NavigationDrawerTheme, NavigationBarTheme, SegmentedButtonTheme, and IconTheme to clarify scope as app-wide. Expanded DataTableTheme docstring and added detailed documentation for each property, specifying their purpose and corresponding DataTable attributes.
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@cloudflare-workers-and-pages
Copy link

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: fd5c85e
Status: ✅  Deploy successful!
Preview URL: https://f8fbd6a0.flet-docs.pages.dev
Branch Preview URL: https://inesa-v1-tests-p4.flet-docs.pages.dev

View logs

@FeodorFitsner FeodorFitsner merged commit 3c01a4a into main Aug 23, 2025
5 of 6 checks passed
@FeodorFitsner FeodorFitsner deleted the inesa/v1-tests-p4 branch August 23, 2025 22:49
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.

feature: make it possible to capture typed text (not just selections) in editable Dropdown

3 participants