Skip to content

Conversation

lucasbordeau
Copy link
Contributor

This PR improves the sub-field selection UX in advanced filters.

  • Now using the icon of the field instead of the field type
  • Now using the label of the field instead of the field type
  • Removed now useless constant ICON_NAME_BY_ANY_SUB_FIELD
  • Now selects a default value (any or default sub-field for type) when clicking on the field, instead of waiting for the user to select the sub-field

Fixes twentyhq/core-team-issues#1005

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Enhanced the advanced filters sub-field selection with better UX and cleaner code implementation.

  • Refactored AdvancedFilterSubFieldSelectMenu to use field-specific icons and labels instead of type-based ones
  • Added immediate field selection in useSelectFieldUsedInAdvancedFilterDropdown with smart defaults (e.g., 'amountMicros' for CURRENCY)
  • Inverted and renamed utility from isCompositeTypeFilterableByAnySubField to isCompositeTypeNonFilterableByAnySubField for better clarity
  • Improved performance by moving field selection logic before composite type checks in AdvancedFilterFieldSelectMenu
  • Removed redundant ICON_NAME_BY_ANY_SUB_FIELD constant map to reduce code complexity

5 files reviewed, 5 comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Jun 10, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:39870

This environment will automatically shut down when the PR is closed or after 5 hours.

@bosiraphael bosiraphael self-assigned this Jun 10, 2025
Copy link
Contributor

@bosiraphael bosiraphael left a comment

Choose a reason for hiding this comment

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

LGTM

@lucasbordeau lucasbordeau merged commit f0f0d85 into main Jun 10, 2025
52 checks passed
@lucasbordeau lucasbordeau deleted the fix/sub-field-name-and-icon branch June 10, 2025 12:00
abdulrahmancodes pushed a commit to abdulrahmancodes/twenty that referenced this pull request Jun 10, 2025
This PR improves the sub-field selection UX in advanced filters.

- Now using the icon of the field instead of the field type
- Now using the label of the field instead of the field type
- Removed now useless constant ICON_NAME_BY_ANY_SUB_FIELD
- Now selects a default value (any or default sub-field for type) when
clicking on the field, instead of waiting for the user to select the
sub-field

Fixes twentyhq/core-team-issues#1005
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.

Update Sub-fields menu names & icons
2 participants