-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add context menu #2001
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
Add context menu #2001
Conversation
|
Looking at the original issue, I saw #265 (comment) and decided to add two items to the context menu:
/cc @codetheory |
c91943e to
34b4738
Compare
|
This does and will clash with so I guess having it enabled should disable the menu or the other way round |
|
Same with in the case of Windows or true the right click menu should probably adjust itself to not duplicate items with the hamburger menu
|
do these items behave as expected or differently when using the main menus? (I haven't really been able to get them to work in either case), they should perform the same as the other menus (since they're just duplicated from there) re: windows settings, I will tweak what I have to make sure there's no conflicts (and test a bit in windows) to see what makes the most sense. /cc @Stanzilla |
|
Yeah, they don't work from the main menu either. Do they work on any OS? |
lib/components/term.js
Outdated
| enabled: !isCollapsed | ||
| }, | ||
| { | ||
| label: 'Search the Web for Selection', |
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.
Search with Google is more specific and consistent with other context menus ✌️
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.
Is there anyway to open a link with the users default search engine? That would be awesome.
Default search engine probably would come from the default browser > default search engine
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.
Could leave it as Google by default and make it configurable via .hyper.js?
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.
both terminal and iTerm2 have Search with Google
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.
Yeah, I'd like that. I know a few people who'd like not to use Google.
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.
With Mac OS services you should be able to search with default browser and engine but most likely unusable since Hyper also supports other operative systems ✌️
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.
in b3a9d30 I've made this configurable via exposing a new key/value (searchEngineUrl) from config so this can be customized via .hyper.js
defaults to google, but can be anything the user desires.
this would likely need to be addressed in app/config/config-default.js as well (similar to bellSoundURL)
I left the wording as is.
this is a good question, I'm not sure under what circumstances they are designed to work... the main thing is that this is not a regression on my part 😉 |
b3a9d30 to
70f4aec
Compare
|
I nixed the url/google functionality (as I think that should be handled in a different PR, or possibly a plugin?) @Stanzilla this should account for the items you mentioned /cc @codetheory |
|
My concern was to not duplicate menu entries when both hamburger and context are enabled but since you removed the URL/Google option it's 100% the same anyway, no? |
|
@Stanzilla what do you think makes the most sense in your opinion? should I just drop the maybe I'll fire up a windows VM and see 👁️ |
|
I'd drop the check, yeah. Makes the most sense to me. |
|
@Stanzilla I dropped that lmk if this makes sense |
|
@rickycodes Are you binding the menu context with keymaps? |
|
@ppot I'm just building the context menu from what already exists (combining edit + shell so yea, they have the same |
|
@chabou this has now been rebased over I had to make a couple adjustments to accommodate the new changes lmk what you think |
| const contextMenuTemplate = createWindow => { | ||
| return editMenu(commands).submenu.concat({type: 'separator'}, shellMenu(commands, createWindow).submenu); | ||
| }; | ||
|
|
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.
maybe an alternative to this:
const contextMenuTemplate = createWindow => {
const shell = shellMenu(commands, createWindow).submenu
const edit = editMenu(commands).submenu
return edit.concat({type: 'separator'}, shell);
};|
@chabou have you had a chance to look at this? I've actually made some refinements, and have an example where the menu changes/updates based on selection... in this version I've made it so you can compare the changes here: rickycodes/hyper@rickycodes:issue-265...add-context-menu lmk what you think! |
chabou
left a comment
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.
Please remove all right click mentions
| } | ||
|
|
||
| componentDidMount() { | ||
| window.addEventListener('contextmenu', () => { |
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 didn't know/see there was this event.
In this case, please remove any mention of right click notion. We should only speak about context menu.
|
I love the idea to pass selection in redux action. |
|
@chabou I've made the requested changes |
|
Can you remove "Open Selection as URL" and "Search the webfor Selection"? I don't think it should be a core feature. But it is perfect to filter Copy/Cut in contextMenu depending on selection presence. |
|
@chabou I've removed the extended menu with the additional options. I noticed canary has the ability to click on URLs anyway, so maybe we can discuss creating plugins to accomplish those items once this lands/how to expand on this so plugin authors can modify the context menu |
|
The CircleCI failure looks unrelated. |
|
@Stanzilla yea i noticed that, but it seems unrelated (the build was passing earlier and I haven't made any adjustments that would have changed that) |
|
I can't reproduce #2001 (comment) anymore 🤔 Let's merge this. We'll fix bugs if needed: not a big deal. |
|
@rickycodes I can't push to your branch. Did you allow maintainers to modify your branch? |
|
This feature is 🔥 |
|
Thank you so much for your help and your awesome work 🙏 |




closes: #265
First stab at creating a right-click context menu...
/cc @leo