Repository navigation
Show tooltip with additional info about the build status - #3588
Conversation
|
I think that it's redundant to show the text Commit status: [success/fail] and the icon that indicates the same thing. I think we should only show the status of each individual integrate and let the icon communicate the success or failure of a PR build. cc, @desktop/core for opinions. |
|
I'm not an accessibility expert by any means, but I'd guess that relying on the icon would be less than great for screen readers. |
We should use desktop/app/src/ui/lib/avatar.tsx Lines 82 to 99 in 3b64deb |
I think we should follow .com conventions here and not talk about "Commit status" as that's not a term that (to my knowledge) is used on .com which talks about "checks". So for a single check only we should use the status text prefixed with success, failure, pending etc. For more than 1 check we should show That way it's also not redundant information when there's single check since it'll include the description from the provider. I'm definitely not opposed to showing more information here but I thing a standard tooltip is the wrong bearer for it. If we want more we should show a customized tooltip with icons and everything for each provider.
So in the example you posted we're using both because the title itself adds value when hovering if you're not using the app with a screen reader and have the context that you're looking at an image but it's even more verbose when you don't have any visual reference. I think a title is fine here since screen readers will pick that up in lieu of an aria label. |
| if (statusCount === 0) { | ||
| return prStatus.state.toUpperCase() | ||
| } else { | ||
| const successCount = prStatus.statuses.filter(x => x.state === 'success') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| totalCount: 1, | ||
| state: 'pending', | ||
| pullRequestNumber: 0, | ||
| statuses: [] as ReadonlyArray<CombinedRefStatus>, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| interface IAPIPullRequestRef { | ||
| export interface IAPIPullRequestRef { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| /** The commit status and metadata for a given ref */ | ||
| export class CombinedRefStatus { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * status for a given ref | ||
| */ | ||
| export interface IAPIRefStatusItem { | ||
| readonly created_at: string |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🔢 |
| } | ||
|
|
||
| /** The commit status and metadata for a given ref */ | ||
| export class CombinedRefStatus { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@joshaber , I suppose that question can be asked about each class in pull-requests.ts since none of them provide any implementation for behaviour or have derived classes. But, to answer your question, I had no real reason to use a class here. I just followed the established pattern: using a class as an interface. |
Removed some properties that may be useful in the future, but for now are not needed, so blasted them.
joshaber
left a comment
There was a problem hiding this comment.
Just a question about naming left 👍
| } | ||
|
|
||
| /** The commit status and metadata for a given ref */ | ||
| export interface ICombinedRefStatus { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🔢 |
|
💃 |
As I spun up desktop@master on my Windows machine today I got this error
```
Uncaught (in promise) TypeError: Cannot read property 'map' of undefined
at PullRequestStore.getPRStatusById (pull-request-store.ts:237)
at <anonymous>
```
It seems the `statuses` property was added in #3588 and typed as `ReadonlyArray<IAPIRefStatusItem>` but since no corresponding database upgrade function was added to ensure that the property exists on prior database objects we can't rely on it being there.
I could add an upgrade function but seeing as we're pretty close to a release I would rather just mark the property accurately and make sure we don't have any other places which rely on it always being present.
We can revisit and clean this up in a later version.


Fixes #3134
Before
After
GitHub Desktop

VS Code
