add "s" keyboard shortcut to star/unstar entries (#1142)

This commit is contained in:
Athou
2023-08-27 11:42:31 +02:00
parent 9981d8763d
commit c6d613d81a
30 changed files with 126 additions and 0 deletions

View File

@@ -113,6 +113,14 @@ export function KeyboardShortcutsHelp() {
<Trans>Swipe header to the right</Trans>
</td>
</tr>
<tr>
<td>
<Trans>Toggle starred status of current entry</Trans>
</td>
<td>
<Kbd>S</Kbd>
</td>
</tr>
<tr>
<td>
<Trans>Mark all entries as read</Trans>

View File

@@ -11,6 +11,7 @@ import {
selectEntry,
selectNextEntry,
selectPreviousEntry,
starEntry,
} from "app/slices/entries"
import { redirectToRootCategory } from "app/slices/redirect"
import { toggleSidebar } from "app/slices/tree"
@@ -257,6 +258,11 @@ export function FeedEntries() {
if (!selectedEntry) return
dispatch(markEntry({ entry: selectedEntry, read: !selectedEntry.read }))
})
useMousetrap("s", () => {
// toggle starred status
if (!selectedEntry) return
dispatch(starEntry({ entry: selectedEntry, starred: !selectedEntry.starred }))
})
useMousetrap("shift+a", () => {
// mark all entries as read
dispatch(