-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[GSoC'24] CardBrowser: Shortcut E #16814
Conversation
@SanjaySargam What's pending before this becomes ready to review? |
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.
only nit. If you only change comment/documentation we can merge immediately
@@ -718,10 +721,19 @@ open class CardBrowser : | |||
viewModel.endMultiSelectMode() | |||
} | |||
|
|||
private suspend fun getCardIdForNoteEditor(): CardId { | |||
// Just select the first one. It doesn't particularly matter if there's a multiselect occurring. |
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.
I admit I don't understand the "doesn't particularly matter". That does not seems obvious to me.
And in particular, it seems it should be if
part of the if/else.
Because that's the only place where we consider the case where there is indeed multiple selections.
What if there's no cards? |
@david-allison If there is no card, it edit the first card of the search result. |
What if there are no cards in the deck/collection? |
It show toast as private fun openNoteEditorForCurrentlySelectedNote() = launchCatchingTask {
try {
val cardId = getCardIdForNoteEditor()
openNoteEditorForCard(cardId)
} catch (e: Exception) {
Timber.w(e, "Error Opening Note Editor")
showSnackbar(
R.string.multimedia_editor_something_wrong,
Snackbar.LENGTH_LONG
)
}
} |
509835a
to
0d67d13
Compare
It should do something more user-friendly. It's an expected 'error' case |
@david-allison Should I change toast as |
I'd go with |
0d67d13
to
c8d6434
Compare
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.
Unit tests would be great here
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.
Awaiting Sanjay's approval: either waiting for tests, or merging as-is
I'll add in separate PR |
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.
This should only show no note to edit
if there's no note to edit. Not on any failure.
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.
Self high-five! Approved!
Sorry @SanjaySargam you won't get the 2nd approval right now. David make a useful remark. You should show the new message if no notes are selected. If there is any other error, then there should be no changes |
c8d6434
to
c4e7a76
Compare
c4e7a76
to
760eca1
Compare
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.
Beautiful, thanks for taking the time with this one
Blocked on translation sync |
Maintainers: Please Sync Translations to produce a commit with only the automated changes from this PR. Read more about updating strings on the wiki, |
Purpose / Description
This PR is a part of #16795
How Has This Been Tested?
HP Chromebook
Checklist
Please, go through these checks before submitting the PR.