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

[Feature Request] Glossary Selection Marker #208

Open
BigBoyBarney opened this issue Apr 3, 2024 · 12 comments
Open

[Feature Request] Glossary Selection Marker #208

BigBoyBarney opened this issue Apr 3, 2024 · 12 comments
Labels
enhancement New feature or request

Comments

@BigBoyBarney
Copy link

BigBoyBarney commented Apr 3, 2024

It would be really cool to have a marker for the currently selected text from the glossary, perhaps with something like {glossary-selection}.

image

Cheers!

@ripose-jp ripose-jp added the enhancement New feature or request label Apr 5, 2024
@ripose-jp
Copy link
Owner

Why do you need this?

@BigBoyBarney
Copy link
Author

BigBoyBarney commented Apr 5, 2024

I would like to add the concise definition in the given context right under the sentence on the back of my Anki card.
Additionally, J-J grammar dictionary entries can be incredibly long, so a selection marker would be very useful.

@ripose-jp
Copy link
Owner

I understand the use case, but it seems pretty specific considering it's already possible to select the entries you want using the checkboxes. Is this something that can't already be accomplished with the {clipboard} marker?

@BigBoyBarney
Copy link
Author

BigBoyBarney commented Apr 12, 2024

Checkboxes can only be unselected, so if an entry has 13 checkboxes, I'd have to click 12 times to get the one I'd like.

Additionally, I don't really want to remove the other entries, but add the context-specific definition at the top of my card, which requires a separate marker.

Is this something that can't already be accomplished with the {clipboard} marker?

Not fully, as of right now. If the subtitle list is visible — which it always is in my use case — ctrl + c will default to copying the subtitle line from the list, instead of the selected text in the pop-up. If the pop-up selection were to take precedence over the subtitle list, it would mostly solve it.

Would implementing a separate marker be a lot of trouble? If yes, would it be possible to make the popup selection take precedence?

Cheers!

@wandero
Copy link

wandero commented Apr 16, 2024

@ripose-jp I also really need the {selection-text} parameter for the same reasons as @BigBoyBarney.
Although currently using {clipboard-text} also works as a workaround (by pressing Ctrl+C one more time)
I would be very grateful if the {selection-text} parameter could be added.
Thank you once again. The application is excellent,
(but it seems to have very little promotion. I spent a lot of effort configuring mpvacious yomitan before I discovered Memento...)

@ripose-jp
Copy link
Owner

Checkboxes can only be unselected

This isn't entirely true. You can set which dictionaries are selected by default by going to SettingsOptionsAnki IntegrationCheck Show Advanced OptionsInclude in Glossary.

My main apprehension with implementing this is that it's not clear how it should work. If you try to select text in different definitions, you'll see that selecting something in one doesn't deselect text in the other. There's no correct way to handle this, just different approaches. For example, is last selected better than a bullet list of selections? Tags can be selected as well, should they be included? I don't know because I don't understand the use case.

@wandero
Copy link

wandero commented Apr 22, 2024

@ripose-jp

Is this something that can't already be accomplished with the {clipboard} marker?

Using {clipboard} can be done, but it requires pressing Ctrl+C one more time. Sometimes I forget to press it, and then the new card ends up with the definition from the previous card.

@BigBoyBarney
Copy link
Author

BigBoyBarney commented Apr 22, 2024

This isn't entirely true. You can set which dictionaries are selected by default by going to Settings → Options → Anki Integration → Check Show Advanced Options → Include in Glossary.

This option doesn't do anything if the entries are from the same dictionary.
image

My main apprehension with implementing this is that it's not clear how it should work. If you try to select text in different definitions, you'll see that selecting something in one doesn't deselect text in the other. There's no correct way to handle this, just different approaches. For example, is last selected better than a bullet list of selections? Tags can be selected as well, should they be included? I don't know because I don't understand the use case.

I can't really speak for others, but for my own, potentially specific use case, I would need 2 separate markers ideally.

  1. Selected text is exported as is, in ascending order (from top to bottom). This would include everything from tags, to list formatting etc.
  2. A "Selected Entry" marker would be really cool to have. Essentially the opposite of the checkboxes, maybe on the right side. Whatever is checked, gets exported with this marker.

To illustrate, here is one of my older cards:
image

I do want to include all of the definitions on the card for completeness' sake, but I want the context-specific definition at the top, in accordance with the minimum information principle. This is particularly important with J-J definitions, as those are not bulleted lists, but sentences; So highlighting keywords at the top is very useful.

Thanks in advance!

@ripose-jp
Copy link
Owner

Selected text is exported as is, in ascending order (from top to bottom). This would include everything from tags, to list formatting etc.

I don't think this is doable because of how Qt Widgets handles selection across multiple widgets. While you can select tags, you can't select text outside of the current tag you're selecting. It's a very different architecture from a webpage where everything is selectable. Selecting the glossaries themselves is doable and they have the added benefit retaining selection due to being based on QTextEdit instead of QLabel. I don't think you'll be able to get everything you want here.

A "Selected Entry" marker would be really cool to have. Essentially the opposite of the checkboxes, maybe on the right side. Whatever is checked, gets exported with this marker.

If I'm understanding this correctly, you want a way to export {glossary} twice with two different sets of definitions. I don't want to modify the UI in any way for this since it's so niche. I think any UI modifications would annoy far more users than it would help. Adding a new marker like {glossary-all}, or if I ever get around to implementing extended marker syntax {glossary:all}, that ignores checkboxes and exports the entire glossary always sounds like it would work for your use case.

@wandero
Copy link

wandero commented Apr 24, 2024

@ripose-jp Thank you for your patient reply. It seems that our use cases are different.
It appears that Chinese dictionaries do not have well-tagged entries, so I need to select specific words to add to my cards. For example, in the image, the word "朋友" (friend) is highlighted; I only need this word (without crossing tags). If I select by tag, the Japanese-Chinese dictionary does not separate the content and would add the entire set of definitions for the word to the card. Of course, I can achieve this using {clipboard} as well, but it requires an extra press of Ctrl+C.

Snipaste_2024-04-24_15-45-53

@BigBoyBarney
Copy link
Author

While you can select tags, you can't select text outside of the current tag you're selecting.

That's totally fine, not a huge deal for my use case. As you can see in the image I sent above, 99.9% of the time it's one definition / tag that I want to narrow down and show at the top. I don't think I've ever tried or wanted to select definitions from multiple widgets.

Adding a new marker like {glossary-all}, or if I ever get around to implementing extended marker syntax {glossary:all}, that ignores checkboxes and exports the entire glossary always sounds like it would work for your use case.

I am perfectly happy with how default checkbox selection works right now, I only want to select certain parts of the text, much like @wandero's use case. A {selection-text} that does the same as double-pressing CTRL+C would solve both his and my issue.

Cheers!

@ripose-jp
Copy link
Owner

Thanks @wandero and @BigBoyBarney for the clarification. I got a much better idea of what's needed now.

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

No branches or pull requests

3 participants