Frontend : Add right click menu in terminal#4465
Frontend : Add right click menu in terminal#4465greedy-wudpeckr wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: greedy-wudpeckr The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@sniok On 0.39.0 installed using flatpak, there is no right click menu in terminals or logs |
skoeva
left a comment
There was a problem hiding this comment.
Hi! It looks like the translations are out of date, would be good to update those to get the CI to pass
7dca6fd to
5787977
Compare
|
I don't think we should replace default context menu everywhere just because it doesn't work on flatpak. We should look into what causes it not to work on flatpak and try to resolve that |
There was a problem hiding this comment.
Pull request overview
This PR adds a right-click context menu to the terminal component, enabling users to copy and paste text directly from the terminal interface. This addresses issue #3797 by providing a more intuitive alternative to using the Edit menu for copy/paste operations.
Changes:
- Added context menu with Copy and Paste options to the Terminal component
- Added "Paste" translations across all 12 supported language files
- Added the
mdi:content-pasteicon definition to support the new menu item
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| frontend/src/components/common/Terminal.tsx | Implements the right-click context menu with copy/paste handlers and prevents default browser context menu |
| frontend/src/components/App/icons.ts | Adds the content-paste icon definition for the paste menu item |
| frontend/src/i18n/locales/*/translation.json | Adds "Paste" translation for all 12 supported languages (en, de, es, fr, hi, it, ja, ko, pt, ta, zh, zh-tw) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: greedy-wudpeckr <mudituiet@gmail.com>
5787977 to
298c072
Compare
@greedy-wudpeckr I think it's a good idea to check if this is solvable by giving the flatpak build some more permissions? Or some other build configuration change? I know Flatpak used to be quite broken when it came to many things like copy/paste and context menus... but I haven't really followed it closely for some years. If it's still broken, then I think we can adapt your code to only run when on Flatpak. So yeah, let's check if there's permissions or build related fix first? Then if it's just broken, then we can add a config item that the Flatpak build sets to enable this custom context menu. What do you think? |
|
FWIW copy & paste menus and the copy buttons work fine in flatpak, but right click menus don't appear |
|
@sniok Did you try that in the app? I have just tried the app ( If that's true and not just an artifact of my environment (running on Linux but not flatpak), then I would suggest that we go with this menu just in app-mode (using it with isElectron). WDYT? |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Since context menu is only needed in app, this new context menu should only be in the 'app' mode. @jimmyjones2 could you add a isElectron() check? |

Summary
Related Issue
Preview
fixed-terminal.mov