-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Track Current Deck Context from Browser #3385
Conversation
This is a fundamentally good change I think. The current behaviour is unituitive and it isn't documented in the manual. I planned to add it but hopefully app behaviour can be made more intuitive here. I wonder though how does the add menu behave when I select a deck but don't study from it? Is that deck then gets chosen in Add screen? I'm not sure how desktop users use the Stats screen, but do we want something similar for Stats? |
@brishtibheja Thanks for the feedback.
When you select a deck at the main window it sets it as your current deck, bad phrasing on my part in the OP. It doesn't need to be explicitly studied.
Yes.
The |
No worries! I've seen even dae saying those exact same words. I can't review the code, but the idea itself is great. It's one less app behaviour in need of explanation. |
Hi @taylorobyen! Thanks for this pull request! I think this feature is extremely important. I've also opened a bug report in https://forums.ankiweb.net/t/bug-report-deck-selection-mismatch-in-anki-browse-screen/48716 related to this behavior. I'm look forward to the developers accept your pull request. |
Sorry, I'm still not convinced this is a good idea. It doesn't make sense in multiple-selection mode, and I'm sure it will lead to complaints from other users who happen to be looking up some cards in the middle of a review session. |
I think many people would want to add cards from the browse screen. This is probably outside the scope of this one PR, but can we have a seperate deck dropdown. It's easier to switch decks in large deck trees and add cards, and do other operations on them, when in browse screen. AnkiDroid also allows this and is surely useful. AnkiDroid also has a seperate deck selector in Stats screen now. Plus, there seems to be a lot of feature requests concerning this so please consider it. |
It is impossible to select multiple decks at once. This references the sidebar selection, not the notes. Edit: Found what you were referring to, will address in next revision. |
I was thinking about your second point last night of how we can accomplish this without updating the user's current deck. I think I may be able to tie into the method that decides which deck to select when creating the Add window. Perhaps it can query if the user has an active Browser window and will check if the user's selection is a deck. If this isn't met then it will default to use the current deck. This will prevent any interruptions if studying and browsing simultaneously. Would this address your concerns? |
This has to be predictable enough too otherwise a lot of people will get confused and think they've encountered some bug. |
I think having the Add window use the context of the active window is basically as predictable as it can get. |
In this latest revision, I have updated the open Add window call made from Browser to pass the currently selected deck id and note type id to the Add window after construction. Based on feedback from @dae this is where we stand with current issues:
The current handling of multiple selected decks is to just grab the first index which ends up first in alphabetical order. Potential solutions:
My recommendation is the first option. Another potential item we need to account for is the I don't fully understand what the |
If you last used a note type with a deck A, changing to that note type will also change the deck to deck A. (I don't remember where I read that). |
465e047
to
3add8ee
Compare
I still think this is potentially confusing, as it's not clear that clicking on a sidebar entry will change the way subsequent actions perform. If we must add a shortcut to do this from the sidebar, maybe it could be via a right-click context menu action in the sidebar instead? |
The current approach looks ok, though I think it would be clearer if any changes not required by the context menu were reverted - e.g. add_card() currently contains extra logic to determine the currently-selected deck, but we only ever call it with a deck id. I don't object to an 'add notes' option in the deck options screen, but it might be better to hold off on that for now, and see how much demand there is for it. |
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.
The actions in the deck list screen weren't hooked up. I'll remove them for now, so this PR can be merged in, and I suggest we wait to see if anyone requests them in the future before we attempt to add them again. If we do add them in the future, we'll need to make sure all strings are translatable.
Thanks for contributing!
This change will track the current deck as users navigate through decks via the browser.
Previously when adding cards via CTRL+E or
Notes > Add Notes...
the add menu would open the most recently studied deck. This previous behavior still exists with the addition of tracking browser interactions as well. This makes adding cards less disorienting by more accurately tracking what the user will want to interact with.