Skip to content
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

feat: Add next and previous hotkeys #5350

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/libs/datamanager/src/mixins/DataStore/DataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ export const DataStore = (modelName, { listItemType, apiMethod, properties, asso
associatedList,
});

// There's a bug in the listIncludes logic here. It nullifies the highlighed id when it shouldnt
if (isDefined(highlightedID) && !listIncludes(self.list, highlightedID)) {
self.highlighted = null;
//self.highlighted = null;
}

self.postProcessData?.(data);
Expand Down
4 changes: 2 additions & 2 deletions web/libs/datamanager/src/sdk/keymap.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const keymap = {
"dm.focus-previous": {
title: "Focus previous task",
shortcut: "shift+up",
shortcut: "ctrl+left",
},
"dm.focus-next": {
title: "Focus previous task",
shortcut: "shift+down",
shortcut: "ctrl+right",
},
"dm.close-labeling": {
title: "Focus previous task",
Expand Down
10 changes: 10 additions & 0 deletions web/libs/editor/src/core/settings/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
"mac": "alt+enter",
"description": "Skip task"
},
"task:next": {
"key": "ctrl+right",
"mac": "command+right",
"description": "Next task"
},
"task:previous": {
"key": "ctrl+left",
"mac": "command+left",
"description": "Previous task"
},
"annotation:undo": {
"key": "ctrl+z",
"mac": "command+z",
Expand Down
24 changes: 24 additions & 0 deletions web/libs/editor/src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,30 @@ export default types
});
}

/**
* Hotkey for next task
*/
if (self.hasInterface("skip", "review")) {
hotkeys.addNamed('task:next', () => {
const annotationStore = self.annotationStore;

if (annotationStore.viewingAll) return;

self.nextTask()
});
}
/**
* Hotkey for previous task
*/
if (self.hasInterface("skip", "review")) {
hotkeys.addNamed('task:previous', () => {
const annotationStore = self.annotationStore;

if (annotationStore.viewingAll) return;

self.prevTask()
});
}
/**
* Hotkey for delete
*/
Expand Down