-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[dashboard] Fix feedback when triggering prebuilds #5731
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
Conversation
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: Associated issue: #5374 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: Associated issue: #5374 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
838f091
to
838e415
Compare
Thanks for the new spinner @gtsiolis! Happy that it works equally well on light and dark, thus we can remove the extra theme-switching logic 😌
(Note: This is a drive-by fix, not really related to the |
838e415
to
3456d2c
Compare
Okay, calling this ready for review (even if this could still be improved). Current state of this PRWhen you click on
Then, when any one of these things happens (first one wins), the button gets re-enabled and removes the spinner: Caveats:
|
getGitpodService().server.triggerPrebuild(project.id, branchName), | ||
new Promise((_, reject) => setTimeout(() => reject(new Error('Timed out while waiting for new prebuild')), 30000)), | ||
]) as StartPrebuildResult; | ||
console.log('Successfully triggerred!', result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Maybe I should remove this debug log.
The spinner also starts when I "rerun prebuild" on one of the branches. I think it would be better if the indicator is set on the actual entry in the list. I.e. signal something before "Running" is shown. |
Good points, thanks @svenefftinge!
|
Looking at this now! 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jankeromnes! Left some comments below! 💭
@@ -150,7 +165,7 @@ export default function () { | |||
<div className="py-3 pl-3"> | |||
<DropDown prefix="Prebuild Status: " contextMenuWidth="w-32" entries={statusFilterEntries()} /> | |||
</div> | |||
<button disabled={!project} onClick={() => triggerPrebuild(null)} className="ml-2">Trigger Prebuild</button> | |||
<button disabled={!project || isPrebuildPending} onClick={() => triggerPrebuild(null)} className="ml-2 flex items-center space-x-2"><span>Trigger Prebuild</span>{isPrebuildPending && <img className="h-4 w-4 animate-spin filter brightness-150" src={Spinner} />}</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: What do you think of placing the spinner on the left of the label? Spinner placement is a minor issue and we could go with any approach but I remember discussing something similar with the GitLab team in the past in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26035#note_297307469. Cross-posting below the relevant comment for visibility within our team:
... regarding spinner placement, although there is not an
strictestablished pattern or design guideline about this, it's mostly related to a) usability (screen reading) and b) LTR (left-to-right) v. RTL (right-to-left) languages where user interfaces should be mirrored to ensure content is easy to understand.Since we currently only support LTR languages, there's no need to also add a component variant with the spinner on the right side. Once and if there is support for RTL languages we should consider adding a component variant with the spinner placed on the right.
BEFORE | AFTER |
---|---|
![]() |
![]() |
@@ -150,7 +165,7 @@ export default function () { | |||
<div className="py-3 pl-3"> | |||
<DropDown prefix="Prebuild Status: " contextMenuWidth="w-32" entries={statusFilterEntries()} /> | |||
</div> | |||
<button disabled={!project} onClick={() => triggerPrebuild(null)} className="ml-2">Trigger Prebuild</button> | |||
<button disabled={!project || isPrebuildPending} onClick={() => triggerPrebuild(null)} className="ml-2 flex items-center space-x-2"><span>Trigger Prebuild</span>{isPrebuildPending && <img className="h-4 w-4 animate-spin filter brightness-150" src={Spinner} />}</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Changing the state of this button whenever someone triggers an arbitrary prebuild form the prebuilds list, as mentioned in #5731 (comment), can be confusing to the user. I'd suggest to keep the state of the button intact instead.
@@ -244,7 +259,7 @@ export function PrebuildInstanceStatus(props: { prebuildInstance?: WorkspaceInst | |||
<span>PENDING</span> | |||
</div>; | |||
details = <div className="flex space-x-1 items-center text-gray-400"> | |||
<img className="h-4 w-4 animate-spin" src={props.isDark ? SpinnerDark : Spinner} /> | |||
<img className="h-4 w-4 animate-spin" src={Spinner} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: Friendly reminder to come back to this if we ever adjust the spinner color used for light and dark themes. 🌔
@@ -150,7 +165,7 @@ export default function () { | |||
<div className="py-3 pl-3"> | |||
<DropDown prefix="Prebuild Status: " contextMenuWidth="w-32" entries={statusFilterEntries()} /> | |||
</div> | |||
<button disabled={!project} onClick={() => triggerPrebuild(null)} className="ml-2">Trigger Prebuild</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Regarding the removal of the global Trigger Prebuild button mentioned in #5731 (comment) (Cc @svenefftinge), the linked issue (#5374) in the PR description contains some more context behind this:
From #5374 (comment):
In terms of UX, this button could trigger a modal to confirm prebuild on the default branch. Possible improvements could include selecting a different branch, passing an env var for a prebuild, etc.
From #5374 (comment):
We could skip this and remove the button for this iteration if you think it’s redundant. The idea behind this is that for projects that the latest prebuild failed and you’d like to retry or all the prebuilds have been removed after two weeks, someone could trigger a prebuild from the dashboard.
However, if we want to ship this sooner and we have the bandwidth to add a fix here, showing a spinner + disabling the button on click as you mentioned in #5374 (comment) sounds optimal. 🎯
I refrained from suggesting this earlier as there are also a few more places where a loading button component variant could be used for consistency, like the git integration modal, but we can progressively add it there later. ➿
🍊 🍊 🍊 🍊
Adding below some early design drafts how the confirmation modal could look like when triggering a prebuild from the global trigger prebuild button. Let me know if this does not look interesting or useful here. Using a modal here could allow us in the future to provide a way to insert one-time variables for a prebuild which, etc.
Run Prebuild | Run Prebuild with Branch Selection |
---|---|
![]() |
![]() |
🍋 🍋 🍋 🍋
Regarding the replacement of an existing prebuild upon triggering a new prebuild mentioned in #5731 (comment) (Cc @jankeromnes), I'd think that ideally we'd never replace a prebuild but cancel the previous one and creating a new one. Maybe this is currently not technically possible or something we're interested in? 💭
Thanks again for the reviews! 🙏 After several discussions, let's close this for now, and instead focus on #5791 😇 (I'll save the small Spinner-fix commit and add it to another PR) |
Description
Related Issue(s)
Fixes #5374
How to test
Trigger Prebuild
Between the click and the moment a new Prebuild appears, there should be a visible clue that something is indeed actually happening behind the scenes (otherwise, users might think that the click didn't work).
Release Notes
/uncc