Refined-github: "Update Branch" button: show warning if PAT is undefined

Created on 8 Jan 2020  路  8Comments  路  Source: sindresorhus/refined-github


Issuehunt badges

Thank you for this useful extension!

If no personal access token is defined, clicking on the "Update Branch" button changes the button caption to "Not Found", and it's not immediately obvious why. Alternatively, the button can be displayed, hidden or perhaps a warning message should/could be displayed in its place instead, when no access token is defined/available.




IssueHunt Summary

Backers (Total: $10.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips


Funded on Issuehunt good first issue help wanted

Most helpful comment

@janpio has funded $10.00 to this issue.


All 8 comments

Would be nice if features in the settings indicated whether or not they required a PAT.

Would be nice if features in the settings indicated whether or not they required a PAT.

I don't think it would solve this issue specifically since the button would still be shown.

We do have a link for that in the options (technically it lists ALL API features, but the copy doesn't suggest that some still work without it)


Like with any feature, the way to find out why a feature isn't working, is to open the console. Such error can show up in the future regardless of the PAT and the console should have more information.

How can we teach the users to open the console when something doesn't work?

I extended the copy in https://github.com/sindresorhus/refined-github/issues/1137 (the first thing new users see) with info about:

  • where to look for errors;
  • the PAT: until now, the user had to open the options to even know that a PAT may be needed.

Regarding the PAT copy in the options, I want to improve it in https://github.com/sindresorhus/refined-github/pull/2694. Discuss there

I'll add: Even if there's a token saved, it doesn't mean that it's valid and that it has access to the current repo, so:

  • "user action" features like this should show a warning: "XXX failed because YYY"
  • "background" features that just show info will silently fail (other than the console error)

PR welcome to add the first part, specifically for the "Update branch" button.

What if we make two changes:

  1. Behind every feature in the options window, we add an small text that says token required and hash-link it to the API token setting.
  2. Add an extra feature.add setting, indicating that an token is required. If the API token is missing, we disable the feature.

I don't wanna keep track of that too. Next thing someone will ask is to group/hide/filter those features in the options. I think have a _"Some features"_ link is enough.

This PAT should be a non-issue: if you want RG to work 100%, you need the PAT. Without it, its working isn't guaranteed. This is why I leaned towards just informing the user about it:

Some features may not work without it. Generate one.

Enabling API-based features
Make sure you create and add a Personal Access Token in the extension鈥檚 options to ensure every feature works correctly.

It's cool that RG finally lets users pick and choose features compared to its initial "all or nothing" policy, but we're spending a lot of effort just maintaining this UI. Let's keep it at a minimum.

What was confusing me and took me a long time (until I found this thread via Google) was the fact that _some_ other Refined GitHub features _do_ advertise the explicit need for a PAT in the console:

image

The "Update Branch" button does not do that, and the "Not found" message on failure also does not indicate anything about a missing PAT.

General improvements on the surfacing of the PAT requirement (via console, UI or options) would be nice.

@janpio has funded $10.00 to this issue.


Was this page helpful?
0 / 5 - 0 ratings

Related issues

MilesBHuff picture MilesBHuff  路  3Comments

juliocanares picture juliocanares  路  3Comments

sompylasar picture sompylasar  路  3Comments

durka picture durka  路  3Comments

supremebeing7 picture supremebeing7  路  3Comments