Skip to content
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

Added shift select for amino acids, added copy feature for AA #247

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

digithed
Copy link
Contributor

Addresses part of issue #213 specifically the following quote:

Shift-clicking a second amino acid selects every nucleotide between the current selection point and the end of the second amino acid.

Now when a user holds down shift and selects an amino acid they can keep selecting amino acids and SeqViz will create a selection range for the selected AAs.

Additionally I added support for copying the amino acid selection to the clipboard.

I suppose this is more of a feature add than a bug fix, regardless I figured it would be useful.

@digithed digithed requested a review from jjti November 22, 2023 22:25
Copy link
Collaborator

@jjti jjti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we've addressed the feature request in:

Shift-clicking a second amino acid selects every nucleotide between the current selection point and the end of the second amino acid.

AFAICT we've added: after Shift-clicking the first amino acid, subsequent clicks extend the length and range of selection. But only if already holding shift on the first click. Can we change this so it also works if you just click (no shift) the first AA?

@@ -223,7 +223,9 @@ export class EventHandler extends React.PureComponent<EventsHandlerProps> {
*/
handleMouseEvent = (e: React.MouseEvent<HTMLDivElement>) => {
const { handleMouseEvent } = this.props;

if (e.shiftKey) {
this.handleCopy();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by this bit, why does it copy every time the cursor moves when shift selecting? I feel like I'd never expect that + doesn't cmd + c work just as well? I also find it surprising to click a single amino acid but have the entire translation copied

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea this wasn't the best implementation for copying the highlighted aa sequence. For some reason a normal cmd + c doesn't work with a highlighted aa sequence (selecting using the click + shift method, not drag select). I tried a work around but for now I'm going to remove that

@digithed digithed requested a review from jjti December 1, 2023 23:36
@digithed
Copy link
Contributor Author

digithed commented Dec 1, 2023

@jjti I updated this for click + shift selecting the amino acids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants