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

Ctrl + c copies text with correct formatting #2708

Merged
merged 4 commits into from
Aug 31, 2023
Merged

Conversation

timbze
Copy link
Contributor

@timbze timbze commented Aug 14, 2023

Related #2622

One issue still needs to be solved.

If I select text manually on AB startup (before verse has been clicked), and then press Ctrl + c, it uses system copy instead of my implemented "share copy". This is because AmbiguousSelection has not yet been loaded (which listens to Ctrl + c press).

However, once I click a verse and AmbiguousSelection loads, I can close the modal, select text manually and press Ctrl + c and the text is copied using my "share copy". I am not sure why, because it looks like setupDocumentEventListener in utils does (or should) removeEventListener on onUnmounted.

I would like for ctrl + c to always use my "share copy", is that correct thinking for user UX? Commentaries and genbooks etc will still just have regular system copy.

If ctrl + c should always use "share copy" even for manually selected Bible text, should the Ctrl + c listener be somewhere else than in AmbiguousSelection component?

@tuomas2
Copy link
Contributor

tuomas2 commented Aug 24, 2023

Are you planning to work on the remaining issue or waiting for help?

@timbze
Copy link
Contributor Author

timbze commented Aug 24, 2023

I would like for ctrl + c to always use my "share copy", is that correct thinking for user UX? Commentaries and genbooks etc will still just have regular system copy.

If ctrl + c should always use "share copy" even for manually selected Bible text, should the Ctrl + c listener be somewhere else than in AmbiguousSelection component?

I'm waiting for a response to this then I want to finish it

@tuomas2
Copy link
Contributor

tuomas2 commented Aug 24, 2023

I would like for ctrl + c to always use my "share copy", is that correct thinking for user UX? Commentaries and genbooks etc will still just have regular system copy.
If ctrl + c should always use "share copy" even for manually selected Bible text, should the Ctrl + c listener be somewhere else than in AmbiguousSelection component?

I'm waiting for a response to this then I want to finish it

In which context is CTRL+C supposed to work exactly? I though it is only when AmbiguousSelection component is visible.

@timbze
Copy link
Contributor Author

timbze commented Aug 24, 2023

In which context is CTRL+C supposed to work exactly? I though it is only when AmbiguousSelection component is visible.

I would like for it to also work when selecting text with mouse. In this case AmbigiousSelection component does not show.

@tuomas2
Copy link
Contributor

tuomas2 commented Aug 24, 2023

In which context is CTRL+C supposed to work exactly? I though it is only when AmbiguousSelection component is visible.

I would like for it to also work when selecting text with mouse. In this case AmbigiousSelection component does not show.

It needs separate implementation I think. It's different to work with AmbiguousSelection than general selection.

@timbze
Copy link
Contributor Author

timbze commented Aug 24, 2023

It needs separate implementation I think. It's different to work with AmbiguousSelection than general selection.

Ok, I know how I could do that, but I was a bit confused why the listener in AmbiguousSelection does not get unregistered when AmbigiousSelection is unloaded. Do you know why?

@tuomas2
Copy link
Contributor

tuomas2 commented Aug 24, 2023

It needs separate implementation I think. It's different to work with AmbiguousSelection than general selection.

Ok, I know how I could do that, but I was a bit confused why the listener in AmbiguousSelection does not get unregistered when AmbigiousSelection is unloaded. Do you know why?

AmbiguousSelection is loaded all the time, just UI part hidden most of the time (see BibleView.vue where it is loaded).

@timbze
Copy link
Contributor Author

timbze commented Aug 24, 2023

I think this is done now

Copy link
Contributor

@tuomas2 tuomas2 left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@tuomas2 tuomas2 merged commit 5d3459e into develop Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants