-
Notifications
You must be signed in to change notification settings - Fork 12
Submission workflow UX improvement of CI checks #4377
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -144,31 +144,41 @@ class CiStatusLabel extends GlimmerComponent<CiStatusLabelSignature> { | |||||||||||||||||||||||||||||
| interface CiSectionSignature { | ||||||||||||||||||||||||||||||
| Args: { | ||||||||||||||||||||||||||||||
| ciGroups: CiGroup[]; | ||||||||||||||||||||||||||||||
| isLoading?: boolean; | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export class CiSection extends GlimmerComponent<CiSectionSignature> { | ||||||||||||||||||||||||||||||
| get flatItems() { | ||||||||||||||||||||||||||||||
| return this.args.ciGroups.flatMap((g) => g.items); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| <template> | ||||||||||||||||||||||||||||||
| <div class='ci-section'> | ||||||||||||||||||||||||||||||
| <h2 class='section-heading'>CI Checks</h2> | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| {{#if @ciGroups.length}} | ||||||||||||||||||||||||||||||
| {{#if this.flatItems.length}} | ||||||||||||||||||||||||||||||
| <ul class='ci-group' role='list'> | ||||||||||||||||||||||||||||||
| {{#each @ciGroups as |group|}} | ||||||||||||||||||||||||||||||
| {{#each group.items as |item|}} | ||||||||||||||||||||||||||||||
| <li class='ci-item'> | ||||||||||||||||||||||||||||||
| <CiDot @state={{item.state}} /> | ||||||||||||||||||||||||||||||
| <div class='ci-item-detail'> | ||||||||||||||||||||||||||||||
| <span class='ci-item-name'>{{item.name}}</span> | ||||||||||||||||||||||||||||||
| <CiStatusLabel | ||||||||||||||||||||||||||||||
| @state={{item.state}} | ||||||||||||||||||||||||||||||
| @text={{item.statusText}} | ||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
| </li> | ||||||||||||||||||||||||||||||
| {{/each}} | ||||||||||||||||||||||||||||||
| {{#each this.flatItems key="name" as |item|}} | ||||||||||||||||||||||||||||||
| <li class='ci-item'> | ||||||||||||||||||||||||||||||
| <CiDot @state={{item.state}} /> | ||||||||||||||||||||||||||||||
| <div class='ci-item-detail'> | ||||||||||||||||||||||||||||||
| <span class='ci-item-name'>{{item.name}}</span> | ||||||||||||||||||||||||||||||
| <CiStatusLabel | ||||||||||||||||||||||||||||||
| @state={{item.state}} | ||||||||||||||||||||||||||||||
| @text={{item.statusText}} | ||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
| </li> | ||||||||||||||||||||||||||||||
| {{/each}} | ||||||||||||||||||||||||||||||
| </ul> | ||||||||||||||||||||||||||||||
| {{else if @isLoading}} | ||||||||||||||||||||||||||||||
| <div class='ci-item loading-state'> | ||||||||||||||||||||||||||||||
| <CiDot @state='in_progress' /> | ||||||||||||||||||||||||||||||
| <div class='ci-item-detail'> | ||||||||||||||||||||||||||||||
| <span class='ci-item-name loading-text'>Loading CI checks...</span> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||
|
Comment on lines
+176
to
+181
|
||||||||||||||||||||||||||||||
| <div class='ci-item loading-state'> | |
| <CiDot @state='in_progress' /> | |
| <div class='ci-item-detail'> | |
| <span class='ci-item-name loading-text'>Loading CI checks...</span> | |
| </div> | |
| </div> | |
| <ul class='ci-group' role='list'> | |
| <li class='ci-item loading-state'> | |
| <CiDot @state='in_progress' /> | |
| <div class='ci-item-detail'> | |
| <span class='ci-item-name loading-text'>Loading CI checks...</span> | |
| </div> | |
| </li> | |
| </ul> |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -122,7 +122,9 @@ export function buildCiItemFromEvent(event: any, type: CiEventType): CiItem { | |||||||||||||||||
| const statusText = | ||||||||||||||||||
| conclusion != null | ||||||||||||||||||
| ? `${formatCiValue(status)} - ${formatCiValue(conclusion)}` | ||||||||||||||||||
| : formatCiValue(status); | ||||||||||||||||||
| : state === 'in_progress' | ||||||||||||||||||
| ? 'In Progress' | ||||||||||||||||||
| : formatCiValue(status); | ||||||||||||||||||
|
Comment on lines
+125
to
+127
|
||||||||||||||||||
| : state === 'in_progress' | |
| ? 'In Progress' | |
| : formatCiValue(status); | |
| : status != null | |
| ? formatCiValue(status) | |
| : state === 'in_progress' | |
| ? 'In Progress' | |
| : formatCiValue(status); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,7 @@ function resolveSubmissionWorkflowState( | |
| ciAllPassed: boolean, | ||
| ciHasFailure: boolean, | ||
| ciInProgress: boolean, | ||
| ciIsLoading: boolean, | ||
| reviewState: string | null, | ||
| isMerged: boolean, | ||
| isClosed: boolean, | ||
|
|
@@ -119,6 +120,9 @@ function resolveSubmissionWorkflowState( | |
| if (hasPr && ciInProgress) { | ||
| inProgress = true; | ||
| statusDetail = 'Checks are running...'; | ||
| } else if (hasPr && ciIsLoading && !ciAllPassed && !ciHasFailure) { | ||
| inProgress = true; | ||
| statusDetail = 'Loading check status...'; | ||
| } | ||
| break; | ||
| case 'reviewer-approve': | ||
|
|
@@ -416,6 +420,13 @@ export class SubmissionWorkflowCard extends CardDef { | |
| return this.ciItems.some((i) => i.state === 'in_progress'); | ||
| } | ||
|
|
||
| get ciIsLoading() { | ||
| return ( | ||
| this.checkRunEventData?.isLoading || | ||
| this.checkSuiteEventData?.isLoading | ||
| ) ?? false; | ||
| } | ||
|
|
||
| // ── Review state ── | ||
| get latestReviewByReviewer() { | ||
| return buildLatestReviewByReviewer( | ||
|
|
@@ -436,6 +447,7 @@ export class SubmissionWorkflowCard extends CardDef { | |
| this.ciAllPassed, | ||
| this.ciHasFailure, | ||
| this.ciInProgress, | ||
| this.ciIsLoading, | ||
| this.reviewState, | ||
| this.isMerged, | ||
| this.isClosed, | ||
|
|
@@ -491,7 +503,7 @@ export class SubmissionWorkflowCard extends CardDef { | |
|
|
||
| {{! ── Step tracker ── }} | ||
| <div class='sw-steps'> | ||
| {{#each this.workflowState.steps as |step idx|}} | ||
| {{#each this.workflowState.steps key="key" as |step idx|}} | ||
|
||
| <div class={{concat 'sw-step ' step.status}}> | ||
| <div class='sw-step-indicator'> | ||
| {{#if (eq step.status 'completed')}} | ||
|
|
@@ -611,7 +623,7 @@ export class SubmissionWorkflowCard extends CardDef { | |
| {{! Step summary }} | ||
| <div class='sw-sidebar-section'> | ||
| <div class='sw-sidebar-heading'>Steps</div> | ||
| {{#each this.workflowState.steps as |step|}} | ||
| {{#each this.workflowState.steps key="key" as |step|}} | ||
| <div class={{concat 'sw-sidebar-step ' step.status}}> | ||
| {{#if (eq step.status 'completed')}} | ||
| <span class='sw-sidebar-icon completed'> | ||
|
|
||
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.
perhaps you should use @cached so we don't rebuild this everytime this.flatItems is consumed, and only if ciGroups actually changes