-
Notifications
You must be signed in to change notification settings - Fork 326
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
Implement Git context menu in the file browser #877
Implement Git context menu in the file browser #877
Conversation
Nice binder badge action. I am not sure what rank should the Git menu have (should it be lower or higher?). I just randomly used 5 and it seems like a good position for me but might be sub-optimal. |
097f01e
to
2fa0bd6
Compare
This is also a significant step towards #379. |
I really like this - thanks for working on this!
❤️
Perhaps the git menu shouldn't have delete as that is also redundant? Also this made me realize that maybe for |
I changed the icon for delete, I think that it was me who wrongly assigned it and it was not used like that before. I also agree that delete should not be shown in the file browser context menu - changed it now too. Also now tested that it works with git repository which is not in the JupyterLab root: Outside of a git repository: Or within the git repository but when no action is available (which happens for files that are tracked but not changed, as jupyterlab-git does not implement |
Thanks for this awesome PR @krassowski The change for the delete icon is welcomed indeed.
I don't have any preferences neither. The current position seems ok for me too. Some comments:
|
I see that too. I was also looking at the
Edit: looking at this again, it does not happen in the file browser context menu so maybe some styles are missing for the simple context menu on panel?
Yes, I can reproduce that. I believe that it is not an effect of the changes that I made but some limitation of the diff renderer. I was also seeing this bug when I was opening multiple diffs manually in previous releases. My thinking is that either:
But those are just guesses. Would be great to investigate and fix (possibly in another PR). Edit: removed third part I misread. |
Does this also resolve #864? |
No, there is no context command for "show file history" just yet. Another main area widget with history browser would need to be implemented first I think... But what this PR does is making it super easy to add such a command to the context menu once it gets contributed. |
Agree I opened #881 What is your opinion on the third point I raised:
|
Yes, the distinction between stage and track is artificial. But it appears to me that the current logic is neat and maintainable (aggregate the commands from context menus for specific files and show all unique entries). I can however, add extra logic which replaces the two with a tailored "Add" command. |
Ok let keep it simple for now. |
I merged them in 3cb6109 |
9e64833
to
f5df357
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a very small performance suggestion. Otherwise LGTM
I agree, this is a great thing. One thing to consider in the future would be to add an icon for git ignore so the ignore options don't look out of place in the context menu. |
Co-authored-by: Frédéric Collonval <[email protected]>
without warning if there are more matches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @krassowski!
My only nit is the track
item. In all cases (ie track
and add
/stage
) what you're really doing is staging the file, so it's confusing to call it anything other than just stage
in all cases. I know I was confused for a second when I saw track
pop up in your first gif.
|
Thanks @krassowski |
@meeseeksdev backport to jlab-2 |
…on-jlab-2 Backport PR #877 on branch jlab-2 (Implement Git context menu in the file browser)
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/what-does-ifilebrowserfactory-defaultbrowser-do/9702/2 |
Fixes #774
Changes:
_getPathRespository
)ContextCommandIDs
CommandArguments
The Git panel context menu got icons (updated):