Skip to content

chore: Update releases UI actions#5125

Merged
steverydz merged 4 commits intomainfrom
update-releases-ui-actions
Jun 12, 2025
Merged

chore: Update releases UI actions#5125
steverydz merged 4 commits intomainfrom
update-releases-ui-actions

Conversation

@steverydz
Copy link
Copy Markdown
Contributor

@steverydz steverydz commented May 2, 2025

Done

  • Re-arranged releases actions UI to draw attention to the progressive release action
  • Combined the progressive release control into a global component for all releases (it was already working this way but looked like it wasn't)
  • Removed unused code and related styles

How to QA

  • Go to https://snapcraft-io-5125.demos.haus/snapd/releases
  • Drag a revision to the release table
  • Check that an actions bar appears with a "Review changes" button
  • Check that clicking that button opens a panel with the "Revert" and "Save" buttons
  • Check that there is the ability to progressively release
  • Try the same with other snaps

Testing

  • This PR has tests
  • No testing required (explain why): Just moving components around

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-21913

Screenshot

releases

@webteam-app
Copy link
Copy Markdown

@steverydz steverydz force-pushed the update-releases-ui-actions branch 6 times, most recently from 2850cb0 to cc502d9 Compare May 8, 2025 16:52
@steverydz steverydz force-pushed the update-releases-ui-actions branch 2 times, most recently from 84dfd5f to d586054 Compare May 12, 2025 12:05
@steverydz steverydz marked this pull request as ready for review May 12, 2025 12:31
@steverydz steverydz force-pushed the update-releases-ui-actions branch 2 times, most recently from 3ef53b3 to ecfb549 Compare May 30, 2025 14:04
@Lukewh Lukewh requested a review from Copilot June 5, 2025 10:53
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

This PR refactors the releases confirmation UI to surface the progressive release slider more prominently, consolidates related components, and removes obsolete code and styles.

  • Consolidates all progressive release controls into a new ProgressiveBarControl component.
  • Replaces legacy ProgressiveRowGroup/progressiveRow/globalRow with simpler ReleaseRowGroup and moves button toggles.
  • Removes unused SCSS selectors and updates button markup to “Review changes” / “Hide changes.”

Reviewed Changes

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

Show a summary per file
File Description
static/sass/_snapcraft_release.scss Removed unused .p-releases-confirm__details-toggle and .p-releases-confirm__actions styles.
static/sass/_snapcraft_p-release-details-row.scss Switched release-details grid to flex layout and added .progressive-release-control classes.
static/js/publisher/pages/Releases/components/releasesTable/cellViews.js Added optional chaining for progressive data in tooltip.
static/js/publisher/pages/Releases/components/releasesConfirmDetails/types.js Capitalized type strings for display consistency.
static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRowGroup.js Added new ReleaseRowGroup to list simple release rows.
static/js/publisher/pages/Releases/components/releasesConfirmDetails/releaseRow.js Simplified ReleaseRow by removing legacy progress/notes props.
static/js/publisher/pages/Releases/components/releasesConfirmDetails/index.js Swapped out old progressive row groups for ReleaseRowGroup and integrated ProgressiveBarControl.
static/js/publisher/pages/Releases/components/releasesConfirmActions.js Added u-align--right to action buttons container.
static/js/publisher/pages/Releases/components/releasesConfirm.tsx Merged toggle and action buttons into one bar, updated labels and conditional rendering.
static/js/publisher/pages/Releases/components/progressiveBarControl.js Introduced new ProgressiveBarControl component for global slider.
Comments suppressed due to low confidence (3)

static/js/publisher/pages/Releases/components/releasesConfirmDetails/index.js:35

  • Calling updateProgressiveReleasePercentage directly will just return the action object without dispatching it. You need to dispatch this action (e.g., via props from connect or useDispatch) to actually update the Redux store.
updateProgressiveReleasePercentage(percentage);

static/js/publisher/pages/Releases/components/releasesTable/cellViews.js:77

  • If revision or revision.progressive is undefined, revision?.progressive?.percentage is undefined and Math.round(100 - undefined) yields NaN. Consider adding a default fallback (e.g., || 0) to ensure a number is passed to Math.round.
{Math.round(100 - revision?.progressive?.percentage)}%

static/js/publisher/pages/Releases/components/progressiveBarControl.js:1

  • The new ProgressiveBarControl component contains interactive logic but lacks unit or snapshot tests. Adding tests would help prevent regressions in the slider behavior.
import React from "react";

@AnnSoMuller
Copy link
Copy Markdown

Just a 2 minor details on the visual side

  1. On the hover state, part of the content goes out of the frame
Screenshot 2025-06-05 at 14 57 41 the width should be fitting the content 2. On the second bar of the release (the green one), the rounded corner is missing. Screenshot 2025-06-05 at 14 54 36

@bartaz
Copy link
Copy Markdown
Member

bartaz commented Jun 5, 2025

When I drag 24762 to beta, and then click > next to it (in green release cell)
image

I get an error:
image

display: grid;
grid-column-gap: 1rem;
grid-template-columns: 4rem 15rem 2rem auto 16rem;
display: flex;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it need to be flex?

It seems to display only text, like Release 24767 to latest/candidate on s390x. So, wouldn't it work as simple inline paragraph?
Or is there any specific state where something needs to be there aligned with flex?

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point - I've changed it to a simple p

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was it changed? It still seems to be used in ReleaseRow?

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My bad - I hadn't pushed 🙄

@steverydz
Copy link
Copy Markdown
Contributor Author

Just a 2 minor details on the visual side

  1. On the hover state, part of the content goes out of the frame

Screenshot 2025-06-05 at 14 57 41 the width should be fitting the content 2. On the second bar of the release (the green one), the rounded corner is missing. Screenshot 2025-06-05 at 14 54 36

As these aren't related to the changes introduced in this PR I've made separate tickets for those:
https://warthogs.atlassian.net/browse/WD-22659
https://warthogs.atlassian.net/browse/WD-22660

@steverydz
Copy link
Copy Markdown
Contributor Author

When I drag 24762 to beta, and then click > next to it (in green release cell) image

I get an error: image

Ah I see, I'm getting that too. I've tested on production and that seems to be an existing bug so I've made a separate ticket for that here: https://warthogs.atlassian.net/browse/WD-22672

Comment thread static/js/publisher/pages/Releases/components/releasesTable/cellViews.js Outdated
Copy link
Copy Markdown
Contributor

@edisile edisile left a comment

Choose a reason for hiding this comment

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

LGTM!

}) => (
<div className="p-release-details-row">
const ReleaseRow = ({ type, revisionInfo, channel }) => (
<p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now with flex removed it seems the space is missing between "Release" and revision number:

image

Also, is the tooltip meant to be in the middle of whole row, or should it be just under revision number?

Copy link
Copy Markdown
Member

@bartaz bartaz left a comment

Choose a reason for hiding this comment

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

Little issue with missing space, looks good apart from that.

Copy link
Copy Markdown
Member

@bartaz bartaz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@steverydz steverydz merged commit b24b6b3 into main Jun 12, 2025
12 checks passed
@steverydz steverydz deleted the update-releases-ui-actions branch June 12, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants