Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

feat: enhance FieldMenu with grouped field display #6

Merged
caio-pizzol merged 1 commit intomainfrom
caio/sd-535-add-expandable-category-groups-to-field-menu
Oct 9, 2025
Merged

feat: enhance FieldMenu with grouped field display #6
caio-pizzol merged 1 commit intomainfrom
caio/sd-535-add-expandable-category-groups-to-field-menu

Conversation

@caio-pizzol
Copy link
Contributor

@caio-pizzol caio-pizzol commented Oct 9, 2025

Note

Field menu now groups fields by category with collapsible sections and auto-expands on filter; menu trigger reference updated to current cursor position.

  • Field Menu (src/defaults/FieldMenu.tsx)
    • Group fields by category with expandable/collapsible sections, default-expanding first group and auto-expanding all when filtering.
    • Show filter status header only when filtering; refine "No matching fields" state and separators.
    • Add toggleCategory via useCallback; manage expanded state with useState/useEffect.
  • Editor Trigger (src/index.tsx)
    • Update menuTriggerFromRef to use current selection from instead of triggerStart when opening the menu.

Written by Cursor Bugbot for commit ca96507. This will update automatically on new commits. Configure here.

@linear
Copy link

linear bot commented Oct 9, 2025

SD-535 Add Expandable Category Groups to Field Menu

Summary

Group fields by category in the FieldMenu with expandable/collapsible sections to improve navigation for large field lists.

Tasks

  • Modify src/defaults/FieldMenu.tsx to group fields by their category property
  • Add state management to track which categories are expanded/collapsed (default to all collapsed or first category expanded)
  • Implement category header UI with expand/collapse indicator (e.g., chevron icon)
  • Show field count per category in the header (e.g., "Contact (4)")
  • Render fields only when their category is expanded
  • Ensure "Create New Field" option remains easily accessible at the top or bottom
  • Add smooth transition animations for expand/collapse
  • Handle fields without categories (put in "Uncategorized" or "Other" group)
  • Maintain existing field selection functionality
  • Update tests to verify grouped rendering and expand/collapse behavior

Notes

Currently in src/defaults/FieldMenu.tsx, fields are rendered in a flat list which becomes overwhelming when there are many fields across multiple categories. The demo shows fields with categories like 'Contact', 'Company', 'Invoice', 'Legal', 'Product/Service'. By grouping these into expandable sections (accordion-style), users can navigate large field lists more efficiently. Each FieldDefinition has an optional category property that should be used for grouping. Consider allowing multiple categories to be open simultaneously, or implementing a single-open accordion pattern based on UX needs.

@caio-pizzol caio-pizzol enabled auto-merge (squash) October 9, 2025 17:41
@caio-pizzol caio-pizzol merged commit af33a9b into main Oct 9, 2025
2 checks passed
@caio-pizzol caio-pizzol deleted the caio/sd-535-add-expandable-category-groups-to-field-menu branch October 9, 2025 17:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant