Skip to content

fix(uve): restore p-splitButton dropdown for workflow actions in UVE toolbar#35361

Merged
adrianjm-dotCMS merged 3 commits intomainfrom
fix/uve-workflow-action-dropdown-35034
Apr 17, 2026
Merged

fix(uve): restore p-splitButton dropdown for workflow actions in UVE toolbar#35361
adrianjm-dotCMS merged 3 commits intomainfrom
fix/uve-workflow-action-dropdown-35034

Conversation

@adrianjm-dotCMS
Copy link
Copy Markdown
Member

@adrianjm-dotCMS adrianjm-dotCMS commented Apr 16, 2026

Summary

  • Re-introduces the groupActions input to DotWorkflowActionsComponent so the UVE toolbar can render workflow actions as a p-splitButton (classic split-button layout), while edit-content keeps the new responsive inline-buttons behaviour introduced in feat(edit-content): update command bar to show all workflow actions #35290.
  • When groupActions=true, actions are grouped by SEPARATOR entries and each group renders as a p-splitButton (main action + dropdown for sub-actions), exactly as it did before the refactor.
  • When groupActions=false (default), the new breakpoint-driven inline buttons + overflow menu behaviour is preserved.
  • Adds [groupActions]="true" back to dot-uve-workflow-actions.component.html.

Root cause

PR #35290 removed the groupActions input entirely when simplifying the component. The UVE toolbar relied on it to display a p-splitButton dropdown; without it, all workflow actions started rendering as flat inline buttons inside the UVE — breaking the expected UX.

Changes

File Change
dot-workflow-actions.component.ts Re-added groupActions input; added $groupedActions computed signal and SplitButtonModule import
dot-workflow-actions.component.html Added @if (groupActions()) branch that renders p-splitButton groups using @let locals and ?. optional chaining, identical to the original pattern
dot-uve-workflow-actions.component.html Re-added [groupActions]="true" binding
dot-workflow-actions.component.spec.ts Added 8 tests covering the groupActions=true path (split-button rendering, sub-action model, actionFired emission, separator grouping, empty state)

##VIDEO

Screen.Recording.2026-04-16.at.5.06.23.PM.mov

Test plan

  • Open the UVE and confirm workflow actions appear inside a p-splitButton dropdown as before
  • Open Edit Content and confirm workflow actions still render as inline buttons with the overflow menu
  • Run unit tests: yarn nx test ui --testPathPattern=dot-workflow-actions

Closes #35034

…toolbar

Re-introduces groupActions input to DotWorkflowActionsComponent so the UVE
toolbar can preserve its classic split-button layout while edit-content keeps
the new responsive inline-buttons behaviour introduced in #35290.

Closes #35034

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 16, 2026

Claude finished @adrianjm-dotCMS's task in 1m 8s —— View job


Claude finished @adrianjm-dotCMS's task in 1m 0s —— View job


PR Review

  • Read changed files
  • Analyze for bugs and design issues
  • Post review

Three issues worth fixing, one minor note.

1. Bug: plain p-button (single-action group) is clickable during loading

dot-workflow-actions.component.html line 16–17:

<p-button
    [disabled]="disabled()"   

p-splitButton (same template, line 8) correctly uses [disabled]="loading() || disabled()". Flat-mode inline buttons also use loading() || disabled(). The single-action branch is the only place that lets the user fire the action while a previous one is still in flight.

Fix: [disabled]="loading() || disabled()" — same as Copilot suggested.

Fix this →


2. No loading indicator on p-splitButton in grouped mode

The p-splitButton is disabled during loading but shows no spinner, whereas flat-mode shows [loading]="first && loading()" on the primary button. PrimeNG's p-splitButton does not expose a [loading] input on the main button directly, but the result is that UVE users get no visual feedback that an action is in-flight — they just see a greyed-out button. Worth a comment in the template or a follow-up issue if this is a PrimeNG limitation.


3. Missing test for the bug in point 1

The groupActions describe block has no test asserting that a single-action p-button is disabled when loading=true. The missing test is exactly what would have caught the bug above. Add:

it('should disable plain p-button during loading in single-action group', () => {
    spectator.setInput('actions', [mockWorkflowsActions[0]]);
    spectator.setInput('loading', true);
    spectator.detectChanges();

    const btn = spectator.query(Button);
    expect(btn.disabled).toBeTrue();
});

4. Minor: BreakpointObserver subscription is always active

#inlineCap subscribes to CDK breakpoints unconditionally via toSignal(). In groupActions=true mode the signal is never read, but the subscription remains live. Not a correctness issue — just a small unnecessary overhead if grouped mode is the only mode used on that page instance.


@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 16, 2026

Claude finished @adrianjm-dotCMS's task in 1m 3s —— View job


Rollback Safety Analysis

  • Read rollback-unsafe categories reference
  • Get full PR diff
  • Analyze diff against all unsafe categories
  • Applied label: AI: Safe To Rollback

Result: ✅ Safe to Roll Back

All 4 changed files are pure Angular/TypeScript frontend UI changes with no match against any rollback-unsafe category:

Category Verdict
C-1 Structural Data Model Change ✅ No DB/storage changes
C-2 Elasticsearch Mapping Change ✅ No ES changes
C-3 Content JSON Model Version Bump ✅ No serialization changes
C-4 DROP TABLE / DROP COLUMN ✅ No DDL
H-1 One-Way Data Migration ✅ No migrations
H-2 RENAME TABLE / COLUMN ✅ No renames
H-3 PK Restructuring ✅ No PK changes
H-4 New Content Type Field Type ✅ No new field types
H-5 Binary Storage Provider Change ✅ No storage changes
H-6 DROP PROCEDURE / FUNCTION ✅ No stored proc changes
H-7 NOT NULL Column Without Default ✅ No schema changes
M-1 Non-Broadening Column Type Change ✅ No column changes
M-2 Push Publishing Bundle Format Change ✅ No bundle changes
M-3 REST / GraphQL API Contract Change ✅ Angular component inputs are not public API contracts
M-4 OSGi Plugin API Breakage ✅ No OSGi interface changes

The changes are limited to: adding a groupActions boolean input to DotWorkflowActionsComponent, a computed $groupedActions signal for split-button rendering, template branching, and unit tests. Rolling back to N-1 simply restores the flat inline-button behaviour — no data, schema, or API contract is affected.

Copy link
Copy Markdown
Contributor

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

Restores the legacy split-button workflow actions UX for the UVE toolbar by reintroducing a groupActions mode in DotWorkflowActionsComponent, while keeping the newer inline/overflow behavior as the default for edit-content.

Changes:

  • Re-added groupActions input and implemented grouped (separator-delimited) action computation to drive p-splitButton rendering.
  • Updated dot-workflow-actions template to switch between grouped split-buttons vs flat inline buttons + overflow menu.
  • Re-enabled grouped mode in UVE toolbar and added unit tests for the grouped rendering path.

Reviewed changes

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

File Description
core-web/libs/ui/src/lib/components/dot-workflow-actions/dot-workflow-actions.component.ts Adds groupActions input, grouped-actions computed signal, and SplitButtonModule support.
core-web/libs/ui/src/lib/components/dot-workflow-actions/dot-workflow-actions.component.html Introduces grouped-mode template branch rendering p-splitButton per separator-delimited group.
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/components/dot-uve-toolbar/components/dot-uve-workflow-actions/dot-uve-workflow-actions.component.html Restores [groupActions]="true" for UVE toolbar workflow actions.
core-web/libs/ui/src/lib/components/dot-workflow-actions/dot-workflow-actions.component.spec.ts Adds tests for grouped-mode rendering and interaction behavior.

…in splitButton

Refines the command invocation for the main action in the DotWorkflowActionsComponent to ensure it handles the case where the command may not be defined. Additionally, adds a test to verify that the main action emits the correct event when the primary button of the splitButton is clicked.

Closes #35034
@adrianjm-dotCMS adrianjm-dotCMS added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit 83e2f1a Apr 17, 2026
29 checks passed
@adrianjm-dotCMS adrianjm-dotCMS deleted the fix/uve-workflow-action-dropdown-35034 branch April 17, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

UX: Update new edit content command bar to show all workflow actions

3 participants