Improve the file action buttons on a commit
See original GitHub issueDescription
When viewing a file on a specific commit/tag/whatever (not on a branch), the file action buttons (open in GitHub desktop, edit and delete) have tooltips “You must be on a branch to *”, however they are not disabled but pointing to the login page along with a redirect to the same page, which is quite confusing:
https://github.com/sindresorhus/refined-github/blob/3775e52/source/features/useful-not-found-page.tsx
⬇️
https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsindresorhus%2Frefined-github%2Fblob%2F3775e52%2Fsource%2Ffeatures%2Fuseful-not-found-page.tsx
I suppose we can improve the buttons a bit:
- One option is to disable them entirely. GitHub does put a
.disabled
class but that doesn’t invalidate the links. - Another option is to have these buttons work like if we are on the default branch, maybe with a prompt “Do you want to take this action on the default branch?”
- Make them work like
default-branch-button
or just point the user todefault-branch-button
, something like that.
Screenshot
Example URL
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Add, edit, and commit to source files | Bitbucket Cloud
From the repository, click Source in the left navigation. · Click the file you want to open. · Click the Edit button to...
Read more >Finding and customizing actions - GitHub Docs
Browsing Marketplace actions in the workflow editor · In your repository, browse to the workflow file you want to edit. · In the...
Read more >Commit and push changes to Git repository | JetBrains Rider ...
Open the vertical Commit tool window located on the left: · As your changes are ready to be committed, select the corresponding files...
Read more >Make a Git commit in Visual Studio - Microsoft Learn
To stage changes when you're ready, select the + (plus) button on each file you want to stage, or right-click a file and...
Read more >User Guide - gerrit-review
A change consists of a Change-Id, meta data (owner, project, target branch etc.), one or more patch sets, comments and votes. A patch...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The “disabled” buttons are now correctly grayed out. Maybe it’s not worth fixing it given
default-branch-button
is present…That makes sense. The intention is to simplify the following steps to one click:
default-branch-button
If the original request in this issue is resolved, the second step can be saved.