Skip to content

feat(edit-content): update command bar to show all workflow actions#35290

Merged
adrianjm-dotCMS merged 6 commits intomainfrom
35034-command-bar-to-show-all-workflow-actions
Apr 16, 2026
Merged

feat(edit-content): update command bar to show all workflow actions#35290
adrianjm-dotCMS merged 6 commits intomainfrom
35034-command-bar-to-show-all-workflow-actions

Conversation

@adrianjm-dotCMS
Copy link
Copy Markdown
Member

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

Summary

Closes #35034 and #31321

  • Replaces the split-button pattern in dot-workflow-actions with individual inline buttons, making all workflow actions discoverable
  • First action (rightmost): default solid button — second: outlined — third: text; actions beyond 3 collapse into an overflow popup menu (p-menu with appendTo="body")
  • SEPARATOR actions are filtered out automatically
  • Removed groupActions and SplitButton — component is now purely computed-signal driven

IMAGES

BEFORE

Screenshot 2026-04-14 at 2 37 36 PM

NOW

Screenshot 2026-04-14 at 2 37 42 PM

Test plan

  • Verify workflow actions render as individual buttons (not hidden in a split button)
  • Verify first action is primary, second outlined, third text
  • Verify overflow menu appears when there are more than 3 actions
  • Verify clicking overflow menu items fires the correct action
  • Verify SEPARATOR actions are not rendered
  • Verify loading spinner appears only on the primary button
  • Verify disabled state disables all buttons

In this PR we are also closing the bug with long workflows names

Screenshot 2026-04-14 at 2 43 52 PM

This PR fixes: #35034

…p actions support

- Updated the  component to render actions as inline buttons, with a maximum of three visible at a time.
- Introduced an overflow menu for additional actions, filtering out SEPARATOR actions.
- Removed support for grouping actions by separator, streamlining the component's logic and improving clarity.
- Adjusted the component's template and styles to reflect these changes, enhancing the user interface for action selection.

This refactor aims to improve the usability and maintainability of the workflow actions component.
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 10, 2026

Claude finished @adrianjm-dotCMS's task in 2m 37s —— View job


Code Review

  • Read changed files
  • Analyze component logic
  • Review template and accessibility
  • Review tests
  • Post findings

Issues Found

1. flex-row-reverse breaks visual order when overflow is present — logic bug

dot-workflow-actions.component.ts:48

DOM order in the template is: [overflow-button, action[0], action[1], action[2]]. With flex-row-reverse, the visual order reverses to [action[2], action[1], action[0], overflow-button]. This means:

  • Without overflow: primary action (action[0]) is rightmost ✓
  • With overflow: the ··· overflow button becomes rightmost; primary action shifts one place left ✗

The JSDoc says "1st action (rightmost)" but this is only true in the no-overflow case. The PR description image suggests the overflow ··· button should appear to the left of the inline actions (i.e., further from the primary). The current DOM ordering puts it DOM-first, which with flex-row-reverse places it visually last (rightmost).

Fix: either put the overflow button DOM-last and keep flex-row-reverse, or switch to flex-row justify-end and place elements in the desired visual order.

Fix this →

2. flex-row-reverse causes tab-order/visual-order mismatch — accessibility

dot-workflow-actions.component.ts:48

Keyboard navigation (Tab key) follows DOM order, not visual order. With flex-row-reverse, a sighted keyboard user sees actions right-to-left visually but tabs through them left-to-right visually, creating a confusing disconnect. WCAG 2.1 SC 1.3.2 (Meaningful Sequence) and 2.4.3 (Focus Order) require that focus order matches reading/visual order. Already flagged by Copilot but worth emphasizing — same fix as #1 above resolves this.

3. getVariant() returns null instead of undefinedPrimeNG input binding

dot-workflow-actions.component.ts:149

// Current
protected getVariant(index: number): 'outlined' | null {
    if (index > 0) return 'outlined';
    return null;  // ← passed to PrimeNG Button.variant as null
}

The comment claims "Angular drops null bindings entirely" but this is only true for native HTML attribute bindings ([attr.foo]). For component input bindings ([variant]), Angular passes the value through — PrimeNG Button receives null and may behave unexpectedly. Return undefined instead and update the return type.

Fix this →

4. Overflow button has no accessible label — accessibility

dot-workflow-actions.component.html:11–18

<p-button
    icon="pi pi-ellipsis-v"
    ...
    />

This is an icon-only button with no text. Screen readers cannot identify its purpose. Add ariaLabel="More actions" (already suggested by Copilot).

Fix this →

5. E2E save() uses isVisible() without timeout — unreliable test

core-web/apps/dotcms-ui-e2e/src/pages/newEditContentForm.page.ts:77

const actionButton = (await saveButton.isVisible()) ? saveButton : publishButton;

Per the E2E CLAUDE.md: "isVisible() has no timeout and is unreliable". If the Save button hasn't rendered yet when this line executes, it returns false and falls back to Publish unnecessarily. Use waitFor or expect(…).toBeVisible() to properly wait.

Fix this →


Minor / Test Gaps

  • Overflow button disabled state not tested: loading and disabled test suites use mockWorkflowsActions (3 actions) at the default wide-viewport cap (4), so the overflow button is never rendered. There's no test verifying it becomes disabled when loading=true or disabled=true.

  • initialValue: MAX_INLINE_ACTIONS flash on mobile: #inlineCap initializes to 4 before BreakpointObserver fires. On XSmall viewports this briefly renders 4 inline buttons before collapsing to overflow — a flash of unstyled/incorrect content on first render.

  • SEPARATOR_ACTION mock uses string literal 'SEPARATOR' instead of DotCMSActionSubtype.SEPARATOR. Will silently break if the enum value changes.

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

Updates the edit-content command bar workflow actions UI to make actions more discoverable by replacing the split-button approach with inline buttons plus an overflow menu, aligning with issue #35034’s UX goals.

Changes:

  • Replaced SplitButton grouping with up to 3 inline workflow action buttons and a p-menu overflow for additional actions.
  • Filtered out SEPARATOR workflow actions prior to rendering.
  • Updated unit tests to cover inline rendering, overflow behavior, loading/disabled states, and sizing.

Reviewed changes

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

File Description
core-web/libs/ui/src/lib/components/dot-workflow-actions/dot-workflow-actions.component.ts Reworks component logic to computed-signal driven inline/overflow rendering; removes split-button/grouping logic.
core-web/libs/ui/src/lib/components/dot-workflow-actions/dot-workflow-actions.component.html Implements empty state + inline buttons + overflow menu toggle UI.
core-web/libs/ui/src/lib/components/dot-workflow-actions/dot-workflow-actions.component.spec.ts Replaces split-button tests with coverage for inline/overflow/variants/loading/disabled/size.
core-web/libs/edit-content/src/lib/components/dot-edit-content-form/dot-edit-content-form.component.html Removes the now-deleted groupActions input usage when rendering <dot-workflow-actions>.

…ponent

- Modified the test case to reflect the correct button variants for actions, ensuring that the third button is now rendered as 'outlined' instead of 'text'.
- Updated the component's `getVariant` method to simplify the logic, returning 'outlined' for all actions beyond the first, enhancing clarity and consistency in button rendering.

These changes improve the accuracy of the component's behavior and its associated tests.
…viewport breakpoints

- Introduced a `BreakpointObserver` to dynamically adjust the number of inline buttons displayed based on the current viewport size, allowing for a responsive design.
- Updated the component to derive the maximum number of visible inline actions (0-3) according to defined breakpoints (XSmall, Small, Medium, Large).
- Enhanced unit tests to validate the new responsive behavior, ensuring correct button rendering in various viewport scenarios.

These changes improve the user experience by adapting the action buttons to different screen sizes, enhancing usability across devices.
@adrianjm-dotCMS adrianjm-dotCMS marked this pull request as ready for review April 14, 2026 18:26
…nd update related tests

- Updated the maximum number of inline workflow actions from 3 to 4, enhancing the component's responsiveness on larger viewports.
- Adjusted the logic in the component and tests to reflect the new cap, ensuring that overflow behavior is correctly implemented when actions exceed the inline limit.
- Enhanced unit tests to validate the updated rendering logic and overflow menu functionality based on the new action cap.

These changes improve the user experience by allowing more actions to be displayed inline, reducing the need for overflow menus on larger screens.
@semgrep-code-dotcms-test
Copy link
Copy Markdown

Legal Risk

The following dependencies were released under a license that
has been flagged by your organization for consideration.

Recommendation

While merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue.

GPL-2.0

MPL-2.0

@adrianjm-dotCMS adrianjm-dotCMS added this pull request to the merge queue Apr 15, 2026
@adrianjm-dotCMS adrianjm-dotCMS removed this pull request from the merge queue due to a manual request Apr 15, 2026
@adrianjm-dotCMS adrianjm-dotCMS added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 5d35245 Apr 16, 2026
28 of 29 checks passed
@adrianjm-dotCMS adrianjm-dotCMS deleted the 35034-command-bar-to-show-all-workflow-actions branch April 16, 2026 02:21
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