sindresorhus/refined-github

"Update Branch" button: show warning if PAT is undefined #2679

mmoayyed posted onGitHub

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.


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

posted by sindresorhus about 5 years ago

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)

<img width="409" alt="" src="https://user-images.githubusercontent.com/1402241/71966709-ab309f00-3234-11ea-886b-6a13dfae8abd.png">


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?

posted by fregante about 5 years ago

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

posted by fregante about 5 years ago

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.

posted by fregante about 5 years ago

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.
posted by jerone about 5 years ago

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’s 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.

posted by fregante about 5 years ago

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.

posted by janpio almost 5 years ago

@janpio has funded $10.00 to this issue.


posted by issuehunt-app[bot] almost 5 years ago

@sindresorhus has rewarded $9.00 to @fregante. See it on IssueHunt

  • :moneybag: Total deposit: $10.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $1.00
posted by issuehunt-app[bot] about 4 years ago

Fund this Issue

$10.00
Rewarded

Rewarded pull request

Recent activities

fregante was rewarded by sindresorhus for sindresorhus/refined-github# 2679
about 4 years ago
fregante submitted an output to  sindresorhus/ refined-github# 2679
about 4 years ago