Add shortcut key "r" to mark selected items as reviewed (#13087)

* Add shortcut key "r" to mark selected items as reviewed

* unselect after keypress
This commit is contained in:
Josh Hawkins 2024-08-15 09:51:44 -05:00 committed by GitHub
parent 2e724291db
commit 4dce8ff60a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -606,7 +606,7 @@ function DetectionReview({
// keyboard
useKeyboardListener(["a"], (key, modifiers) => {
useKeyboardListener(["a", "r"], (key, modifiers) => {
if (modifiers.repeat || !modifiers.down) {
return;
}
@ -614,6 +614,16 @@ function DetectionReview({
if (key == "a" && modifiers.ctrl) {
onSelectAllReviews();
}
if (key == "r" && selectedReviews.length > 0) {
currentItems?.forEach((item) => {
if (selectedReviews.includes(item.id)) {
item.has_been_reviewed = true;
markItemAsReviewed(item);
}
});
setSelectedReviews([]);
}
});
return (