Skip to content

ability to hide block actions #19626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2025
Merged

Conversation

nielslyngsoe
Copy link
Member

Appends a Observable and methods to hide/show actions on Blocks.

They are shown by default, but this enables a custom view to consume Block Entry Context to then hide the actions.

@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 13:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new observable flag to control the visibility of block action bars and updates various block entry components to respect this setting.

  • Adds actionsVisibility state and hideActions/showActions methods to the block entry context.
  • Updates RTE, list, and grid entry components to observe the new context flag and conditionally render their action bars.
  • Refactors inline action-bar markup into #renderActionBar methods for each component.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
block-entry.context.ts Added #actionsVisibility state and visibility toggle methods.
block-rte-entry.element.ts Introduced _showActions state, observation, and refactored action-bar rendering.
block-list-entry.element.ts Similar updates for list entries: _showActions and #renderActionBar.
block-grid-entry.element.ts Same enhancements for grid entries with conditional rendering of action bar.

Copy link
Contributor

@madsrasmussen madsrasmussen left a comment

Choose a reason for hiding this comment

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

Could it make sense to use a guard to align concepts? Instead of just a boolean, could we set up an UmbBlockActionsViewGuard? 🤔

@madsrasmussen madsrasmussen enabled auto-merge (squash) June 30, 2025 12:03
@madsrasmussen madsrasmussen merged commit b81d459 into main Jun 30, 2025
26 of 27 checks passed
@madsrasmussen madsrasmussen deleted the v16/feature/block-actions-visiblity branch June 30, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/dx Developer experience release/16.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants