mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Keyboard shortcut for editing labels from the library
This commit is contained in:
parent
73af8ada81
commit
1afa24d12a
4 changed files with 16 additions and 7 deletions
|
|
@ -35,6 +35,12 @@ export function CardMenu(props: CardMenuProps): JSX.Element {
|
|||
title="Unarchive"
|
||||
/>
|
||||
)}
|
||||
<DropdownOption
|
||||
onSelect={() => {
|
||||
props.actionHandler('set-labels')
|
||||
}}
|
||||
title="Set Labels"
|
||||
/>
|
||||
{isVipUser(props.viewer) && (
|
||||
<DropdownOption
|
||||
onSelect={() => {
|
||||
|
|
@ -64,12 +70,6 @@ export function CardMenu(props: CardMenuProps): JSX.Element {
|
|||
title="Mark Unread"
|
||||
/>
|
||||
)}
|
||||
<DropdownOption
|
||||
onSelect={() => {
|
||||
props.actionHandler('set-labels')
|
||||
}}
|
||||
title="Set Labels"
|
||||
/>
|
||||
<DropdownOption
|
||||
onSelect={() => {
|
||||
props.actionHandler('delete')
|
||||
|
|
|
|||
|
|
@ -281,7 +281,6 @@ export function SetLabelsControl(props: SetLabelsControlProps): JSX.Element {
|
|||
}
|
||||
}
|
||||
}
|
||||
event.preventDefault()
|
||||
}, [filterText, filteredLabels, focusedIndex, isSelected, selectedLabels, setSelectedLabels])
|
||||
|
||||
const createLabelFromFilterText = useCallback(async () => {
|
||||
|
|
|
|||
|
|
@ -364,6 +364,9 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element {
|
|||
case 'markItemAsUnread':
|
||||
handleCardAction('mark-unread', activeItem)
|
||||
break
|
||||
case 'showEditLabelsModal':
|
||||
handleCardAction('set-labels', activeItem)
|
||||
break
|
||||
case 'shareItem':
|
||||
setShareTarget(activeItem)
|
||||
break
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ type LibraryListKeyboardAction =
|
|||
| 'sortAscending'
|
||||
| 'shareItem'
|
||||
| 'showAddLinkModal'
|
||||
| 'showEditLabelsModal'
|
||||
|
||||
export function libraryListCommands(
|
||||
actionHandler: (action: LibraryListKeyboardAction) => void
|
||||
|
|
@ -127,6 +128,12 @@ export function libraryListCommands(
|
|||
shortcutKeyDescription: 'e',
|
||||
callback: () => actionHandler('archiveItem'),
|
||||
},
|
||||
{
|
||||
shortcutKeys: ['l'],
|
||||
actionDescription: 'Edit item labels',
|
||||
shortcutKeyDescription: 'l',
|
||||
callback: () => actionHandler('showEditLabelsModal'),
|
||||
},
|
||||
{
|
||||
shortcutKeys: ['shift', 'i'],
|
||||
actionDescription: 'Mark item as read',
|
||||
|
|
|
|||
Loading…
Reference in a new issue