Keyboard shortcut for editing labels from the library
This commit is contained in:
@ -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',
|
||||
|
||||
Reference in New Issue
Block a user