Skip to content
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

feat: show issue/PR author-role indicators in UI, after author logins #516

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Jan 28, 2025

Summary

This change causes author-role indicators (colored Nerd Font icons) to be shown the dashboard, after the author’s GitHub login. Each indicator shows the author’s role relative to the repo to which they submitted their PR or issue. Fixes #515.

For example, for a PR that’s the first PR the author has contributed to a particular repo, an indicator that the author is a first-time contributor to that repo will be shown.

Other indicators are used for showing that the author has previously contributed to the repo for the PR or issue, or that the author is member or owner of that repo, or a collaborator for that repo.

See https://docs.github.com/en/graphql/reference/enums#commentauthorassociation for details about the possible role (“author association”) values, or see the writeup at https://michaelheap.com/github-actions-check-permission/.

Note

The screenshots below show how the author-role-indicator Nerd Font icons would look in the UI after this change.

I don’t feel strongly at all about gh-dash needing to use the particular set of Nerd Font icons I chose in the current patch in this PR branch. So, @dlvhdr: If you have a different set of icons that you’d prefer — to best match with the rest of the existing gh-dash UI design — (or other commenters here have some good alternative suggestions), then I’m 100% fine with some other alternatives might be decided on instead.

How did you test this change?

I ran make test (go test -v ./...), to ensure this change didn’t regress any existing tests.

Otherwise, I just tested this change manually by building this PR branch and then switching my config between the compact UI view and the non-compact UI view, and visually inspecting the displayed data to confirm that the author-role indicators are displayed as expected.

Images/Videos

image


image

The above two screenshots are using the following set of icons:

image
image

The above screenshot is using the following alternative set of icons:

image

But as I alluded to in the note at the top of the PR description: I don’t feel strongly about either of those sets of icons. Whatever other set might get decided on instead of either of those two would also be fine with me.

@sideshowbarker sideshowbarker force-pushed the show-author-association branch 4 times, most recently from 8500d12 to bae6862 Compare January 29, 2025 02:38
@sideshowbarker sideshowbarker changed the title feat: show “first-time contributor” etc indicator feat: show author-role indicators in UI, after author logins Jan 29, 2025
@sideshowbarker sideshowbarker force-pushed the show-author-association branch 4 times, most recently from 1d3280a to be30fb6 Compare January 29, 2025 09:32
@sideshowbarker sideshowbarker changed the title feat: show author-role indicators in UI, after author logins feat: show issue/PR author-role indicators in UI, after author logins Jan 29, 2025
Copy link
Owner

@dlvhdr dlvhdr left a comment

Choose a reason for hiding this comment

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

This is really great! Thanks for the contrib! 🚀

README.md Outdated Show resolved Hide resolved
ui/constants/constants.go Outdated Show resolved Hide resolved
config/parser.go Outdated Show resolved Hide resolved
@dlvhdr
Copy link
Owner

dlvhdr commented Jan 31, 2025

forgot to mention, can you also add this to the docs website? Should be easy to find where to add it

@sideshowbarker sideshowbarker force-pushed the show-author-association branch from be30fb6 to 05765b5 Compare February 2, 2025 13:43
@sideshowbarker
Copy link
Contributor Author

forgot to mention, can you also add this to the docs website? Should be easy to find where to add it

I’ve pushed the other changes I made in response to review comments — but I’ve not yet made the updates to the docs site. I’ll make time to do that after ~12 hours or so from now.

@sideshowbarker sideshowbarker force-pushed the show-author-association branch from 05765b5 to 175aa1a Compare February 2, 2025 14:07
@sideshowbarker sideshowbarker force-pushed the show-author-association branch from 175aa1a to 3efc99b Compare February 6, 2025 11:28
@sideshowbarker
Copy link
Contributor Author

OK — I just now pushed an update (amended commit) with the following changes:

  • moved both the definitions of the default color values for the icons, and the definitions of the icon strings/characters themselves into the ui/theme/theme.go and config/parser.go code
  • added new config options for both the icon colors and the icons themselves
  • added a new showAuthorIcons config option for flipping the author-icon display off
  • updated the docs with details about all the new config options

https://github.com/dlvhdr/gh-dash/compare/175aa1a506ae7fa69b3b6a1dac301312409a3353..3efc99b7d0e55117b6687e053831a79ca022befd has the delta diff against what you’d previously reviewed.

@sideshowbarker sideshowbarker requested a review from dlvhdr February 6, 2025 11:42
Copy link
Owner

@dlvhdr dlvhdr left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

config/parser.go Show resolved Hide resolved
ui/theme/theme.go Show resolved Hide resolved
ui/theme/theme.go Outdated Show resolved Hide resolved
config/parser.go Show resolved Hide resolved
@sideshowbarker sideshowbarker force-pushed the show-author-association branch 2 times, most recently from 4131056 to 0501cfd Compare February 9, 2025 06:23
@sideshowbarker
Copy link
Contributor Author

OK, thanks — I’ve just pushed an update (amended commit) that includes changes in response to all pending comments.

I think the OwnerIcon should more distinct than the collaborator and member icons. wdyt about "" (\uebb8), "" (\uedcf), "" (\uedd2), "󱇐" (\udb84\uddd0), "󰢏" (\udb84\udf60).

Thanks — those look great. However, I feel a bit that users might potentially be confused somewhat by what the \uedd2 “nf-fa-user_tie” icon is intended to convey. So, what about instead maybe the \uedc6 “nf-fa-user_check” icon? Or if not that, another you can think of that might also be appropriate?

Anyway, what I have for now is this:

image

Is that the correct mappings/order for what you had in mind? If not, please lemme know what I should change.

@sideshowbarker sideshowbarker requested a review from dlvhdr February 9, 2025 06:40
@sideshowbarker sideshowbarker force-pushed the show-author-association branch from 0501cfd to e1b03ca Compare February 9, 2025 06:50
@sideshowbarker
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include author-role indicator in the UI for PRs and issues
3 participants