-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat: add right-click copy context menu to AI chat messages #14722
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
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
|
|
InAnYan
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.
Have not run the code yet, but code-wise there is a small change.
Thanks for taking the issue!
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
|
I have updated the PR to address the architectural feedback:
Ready for another review! |
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
|
I've applied the final refactors:
Ready for final review! |
InAnYan
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.
Okay, good job, small comments
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
|
I have finalized the refactor and verified the logic:
Ready for the review! |
InAnYan
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.
Okay, almost finished
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
jabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
Outdated
Show resolved
Hide resolved
|
I have applied the final requested changes:
|
|
@pulkitbajaj |
|
I have finalized the refactor and verified the logic:
|
Hi @pulkitbajaj |
subhramit
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 add a Changelog entry and mark the respective mandatory check in the PR description.
Head branch was pushed to by a user without write access
|
I've added the changelog entry and manually updated checklist in my description. I am sorry for violating the AI usage policy and assure that this would not happen in future. |
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| import static javafx.scene.input.MouseEvent.MOUSE_PRESSED; |
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.
Don't import static, import MouseEvent and use MouseEvent.MOUSE_PRESSED
|
Your pull request conflicts with the target branch. Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line. |
* upstream/main: (64 commits) New Crowdin updates (JabRef#14862) Make JDK25 available (JabRef#14861) Fix empty entries array when exporting group chat to JSON (JabRef#14814) feat: add right-click copy context menu to AI chat messages (JabRef#14722) FIX : generic error dialog and icon in Source Tab parsing (JabRef#14828) Factor out setup-* actions (JabRef#14859) Link .http files. Update dependency org.postgresql:postgresql to v42.7.9 (JabRef#14857) Add more commands to JabSrv (JabRef#14855) Fix JabRef#14821: Hide identifier action buttons when field is empty (JabRef#14831) Add GH_TOKEN to closed issues/PRs processing step New Crowdin updates (JabRef#14854) New Crowdin updates (JabRef#14849) Chore(deps): Bump jablib/src/main/resources/csl-styles from `0201999` to `f345aa8` (JabRef#14833) Add support for book front covers, again (JabRef#14777) Readd min width to button in new enty dialog (JabRef#14791) Replace plugin impl from jbang plugin (JabRef#14846) Revise AI policy wording Chore(deps): Bump jablib/src/main/resources/csl-locales (JabRef#14677) Update dependency com.konghq:unirest-modules-gson to v4.7.1 (JabRef#14845) ...
User description
Closes #14655
This PR implements a context menu for the AI chat components, enabling users to copy specific text selections or the entire message via a right-click. Previously, users had no way to interact with the chat text using a mouse.
Steps to test
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Enhancement
Description
Adds right-click context menu to AI chat messages
Enables copying selected text or entire message
Supports UserMessage, AiMessage, and ErrorMessage types
Integrates with system clipboard for paste functionality
Diagram Walkthrough
File Walkthrough
ChatMessageComponent.java
Implement context menu with copy functionalityjabgui/src/main/java/org/jabref/gui/ai/components/aichat/chatmessage/ChatMessageComponent.java
ContextMenu,MenuItem,Clipboard, andClipboardContentsetupContextMenu()method to create context menu with copyfunctionality
markdownContentPaneto capture text selection onright-click
state