Skip to content

YN-0177: add expand/collapse functionality to the left pane in all tabs#1695

Open
filipvnencak wants to merge 15 commits into
developfrom
1641-YN-0177-add-expand/collapse-functionality-to-the-left-pane-in-all-tabs
Open

YN-0177: add expand/collapse functionality to the left pane in all tabs#1695
filipvnencak wants to merge 15 commits into
developfrom
1641-YN-0177-add-expand/collapse-functionality-to-the-left-pane-in-all-tabs

Conversation

@filipvnencak

Copy link
Copy Markdown
Collaborator

Description of changes

This PR adds missing expand/collapse functionality to the left pane (Slicer) to match the behavior already available in the middle pane (e.g., in Overview or Products).
Users will now be able to expand/collapse items directly in the Slicer using:
• Context menu actions (Expand All / Collapse All)
• Key-modifier click on the expand toggle (⌥ Option key) to expand/collapse all children recursively

This brings feature parity between the Slicer and other tree-based views.

Technical details

Implemented context menu support in Slicer using useCreateContextMenu.
Added new menu builder hook useSectionMenuItems for:
Expand All
Collapse All
(Placeholder) Delete action
Integrated context menu with SimpleTable via pt.row.onContextMenu.
Added recursive expand/collapse logic in handleExpand and handleCollapse.
Prepared structure for further Slicer actions.

Additional context

@filipvnencak filipvnencak self-assigned this Dec 5, 2025
@filipvnencak filipvnencak added the type: enhancement Improvement of existing functionality or minor addition label Dec 5, 2025
…or improved context menu handling and code organization
… and improved context menu logic in `Slicer` component
…ependencies, and context menu actions in `Slicer` component
@filipvnencak filipvnencak requested a review from Innders December 10, 2025 10:24

@Innders Innders left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The feature works but I think we could better architure the code to make it more reusable.

Expanding and collapsing all rows is not just a slicer specific action but is useful for all hierarchical tables.

Can this be built into the SimpleTable component so that all tables that use this component can have this functionality.

I think it could work the same way that it does in ProjectTreeTable context menu https://github.com/ynput/ayon-frontend/blob/8c5ca2a15245f3c88dcfe02d05d4922f53176f00/shared/src/containers/ProjectTreeTable/hooks/useCellContextMenu.ts. There are some built-in context menu items like these two and then you can add more custom ones yourself.

The context menu items are also functions. This means that to component can provide useful data to the context menu inside of the component, making it far easier for context menu items to be written outside of the component.

…ntext menu handling

- Added support for `menuItems` and `onContextMenu` in `SimpleTableContext`.
- Introduced context menu logic and descendant ID handling for expand/collapse actions.
- Renamed `useSlicerMenuItems` to `useSimpleTableMenu` for consistency and updated related references.
- Refactored `useListContextMenu` to return precomputed `menuItems` instead of handling full context logic.
- Updated `Slicer` and `ListsTable` components to utilize new menu item handling and context menu actions.
…or cleaner debugging and improved readability
…collapse logic to `SimpleTableContext`

- Eliminated the `useSimpleTableMenu` hook from Slicer.
- Integrated alt-click handling for expand/collapse directly into `SimpleTableContext`.
- Updated `Slicer` component to use the refactored context handling via `SlicerTable`.
…collapse logic to `SimpleTableContext`

- Eliminated the `useSimpleTableMenu` hook from Slicer.
- Integrated alt-click handling for expand/collapse directly into `SimpleTableContext`.
- Updated `Slicer` component to use the refactored context handling via `SlicerTable`.
@filipvnencak filipvnencak requested a review from Innders December 15, 2025 09:53
@filipvnencak filipvnencak linked an issue Dec 16, 2025 that may be closed by this pull request
2 tasks
@filipvnencak filipvnencak marked this pull request as ready for review December 16, 2025 09:40
…e` and `ProjectTreeTable`

- Introduced Alt+Click handler to simplify expand/collapse actions.
- Enhanced metadata handling for context menu logic with pre-computed row information.
- Updated `SimpleTable` and `ProjectTreeTable` to utilize the new functionality.

@Innders Innders left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • option+click should be a modifier on the expand icon, not the whole row.
  • option+click on the middle table folders expand icon does not work now.

How it currently works and how it should work on the simple table as well

Screen.Recording.2026-03-04.at.06.57.54.mov

…r improved row expansion handling and context consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YN-0177: add expand/collapse functionality to the left pane in all tabs

2 participants