Skip to content

[#72239] Workflows UX improvement: Select relevant roles and statuses #22325

Open
mrmir wants to merge 17 commits intoepic/workflows-ux-quick-winsfrom
feature/72239-workflows-ux-improvement-select-relevant-statuses
Open

[#72239] Workflows UX improvement: Select relevant roles and statuses #22325
mrmir wants to merge 17 commits intoepic/workflows-ux-quick-winsfrom
feature/72239-workflows-ux-improvement-select-relevant-statuses

Conversation

@mrmir
Copy link
Contributor

@mrmir mrmir commented Mar 12, 2026

Ticket

https://community.openproject.org/work_packages/72239

What approach did you choose and why?

  • The workflows matrix now shows only relevant workflows for a particular type, role, tab combination. The default view for a selected type is to see the matrix for the first available role in the default transitions tab
  • The matrix is now enclosed in a turbo frame that gets updated on changes to the role/statuses
  • Statuses are managed via an autocompleter in a dialog. These changes only affect the current view and are not saved to the DB directly
  • There is a stimulus controller to save/restore checked state when updating statuses, since nothing is saved until "Save" is clicked on the form. Changes to the checkboxes are currently only kept for status updates. Role updates and switching tabs will lose them, but this will have a warning/confirmation dialog in the future
  • The matrix styling has been updated to handle shorter tables. Also, there is a blankslate when no rows/columns are displayed for a particular type, role, tab combo
  • The menu entries for work packages settings have been pluralized to maintain consistency

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@mrmir mrmir force-pushed the feature/72239-workflows-ux-improvement-select-relevant-statuses branch from 6548db3 to 24de72b Compare March 13, 2026 09:43
@github-actions

This comment was marked as outdated.

mrmir added 2 commits March 13, 2026 15:02
…y-type' into feature/72239-workflows-ux-improvement-select-relevant-statuses
@mrmir mrmir removed the pullpreview label Mar 13, 2026
@mrmir mrmir changed the base branch from dev to epic/workflows-ux-quick-wins March 17, 2026 16:56
mrmir added 8 commits March 18, 2026 11:27
Before, the statuses in the list were only those read from the DB. Thus,
adding/removing statuses and clicking apply did not update the list
before saving the entire form
…y-type' into feature/72239-workflows-ux-improvement-select-relevant-statuses
@mrmir mrmir force-pushed the feature/72239-workflows-ux-improvement-select-relevant-statuses branch from 363121d to 5be719d Compare March 19, 2026 13:38
@mrmir mrmir marked this pull request as ready for review March 19, 2026 14:50
Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

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

Nice 👍 🌟
When playing around I noticed some issues:

  • The Subheader is part of the scrollable area resulting in something like this:
Image
  • The dialog to select statuses is too small. I know that you added the class, but given that the autocompleter will grow very quickly, this is not enough.
Image
  • I somewhow expected that a change in role would change the URL. Currently, when I change the role, and reload (or change the tab), the role selection is lost.

  • In the ticket it says: "When the page is saved with one status completely unused (no checkboxes checked for its row/column), it is removed on save." This is not happening:

Image

role: @role,
type: @type,
tab: @tab,
dialog_id: dialog_id
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick:

Suggested change
dialog_id: dialog_id
dialog_id:

Comment on lines +44 to +48
dialog.with_additional_details do
concat(hidden_field_tag(:role_id, @role.id))
concat(hidden_field_tag(:tab, @tab))
@status_ids.each { |id| concat(hidden_field_tag("status_ids[]", id)) }
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this does not belong here. The dangerDialog is to get users confirmation (or if necessary decide what to do with related objects). These hidden objects should however be part of the original form request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how else to pass these params. The reason I added them here was because the status dialog "Apply" is not saving anything to the DB. So in the case where something is removed and the danger dialog is shown, the new info (statuses) needs to be passed through the dialog. Otherwise the params reaching WorkflowsController#confirm_statuses (on dialog "Apply") are lost

end
end

def role_type_statuses
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be a personal preference, but the name could probably be better explaining.. Maybe statuses_for_role_and_type or something similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

title: "Statuses"
label: "Statuses enabled for this type"
caption: "Add or remove statuses you would like to associate with this type. Removing a status will also delete the workflow associated with it."
apply: "Apply"
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a generic "apply" string (button_apply). Is it really necessary to add a new one here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, changed it

caption: "Add or remove statuses you would like to associate with this type. Removing a status will also delete the workflow associated with it."
apply: "Apply"
statuses_removal_dialog:
title: "Remove statuses?"
Copy link
Contributor

Choose a reason for hiding this comment

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

I vaguely remember, that we once decided in the D-Team to follow the pattern of adding the question mark only to the visible title, not the one that is read out by screenreaders. So that would mean:

Suggested change
title: "Remove statuses?"
title: "Remove statuses"

render Primer::OpenProject::SubHeader.new do |subheader|
if @type && @available_roles.any?
subheader.with_filter_component do
render(Primer::Alpha::ActionMenu.new(select_variant: :single)) do |menu|
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the figma comment, this should be a SelectPanel and not an action menu

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm in the WP AC it was either SelectPanel or ActionMenu, and I updated it to be ActionMenu since that made more sense to me. Since it was an either/or, I think this is fine too?

@mrmir
Copy link
Contributor Author

mrmir commented Mar 23, 2026

In the ticket it says: "When the page is saved with one status completely unused (no checkboxes checked for its row/column), it is removed on save." This is not happening:

This is generally happening for me and there's also a test that covers this case. Is there something specific about the case where it doesn't work for you?

@mrmir mrmir requested a review from HDinger March 23, 2026 17:55
@mrmir
Copy link
Contributor Author

mrmir commented Mar 23, 2026

I made changes according to your feedback and left some clarification questions, so please take another look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants