Skip to content

[18.0][IMP] web_group_expand: disable buttons when they would be a no-op - #3629

Open
ninearif wants to merge 1 commit into
OCA:18.0from
ninearif:18.0-imp-web_group_expand-state-aware-buttons
Open

[18.0][IMP] web_group_expand: disable buttons when they would be a no-op#3629
ninearif wants to merge 1 commit into
OCA:18.0from
ninearif:18.0-imp-web_group_expand-state-aware-buttons

Conversation

@ninearif

Copy link
Copy Markdown

The expand/compress buttons added by web_group_expand are always enabled,
even when clicking them would have no effect (e.g. the expand button while
every group is already expanded). This makes it hard to tell at a glance
whether there is anything left to expand or collapse.

This PR disables each button when it would be a no-op:

  • the expand button is disabled when no group at any level is folded;
  • the compress button is disabled when every top-level group is folded.

The state is computed in two ListController getters that walk the group
layers the same way the existing expandAllGroups/collapseAllGroups
handlers do, and is applied with t-att-disabled on the existing buttons,
so there is no behavior change beyond the disabled state.

Disable the expand button when all groups are already expanded, and the
compress button when all groups are already collapsed, so the buttons
reflect whether clicking them would have any effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants