@@ -9,7 +9,6 @@ import { FocusScope } from 'react-aria';
99
1010import { hasMaxAllowedAnnotations } from '../../core/annotations/utils' ;
1111import { Label } from '../../core/labels/label.interface' ;
12- import { isExclusive } from '../../core/labels/utils' ;
1312import { isVideo , isVideoFrame } from '../../core/media/video.interface' ;
1413import { isKeypointTask } from '../../core/projects/utils' ;
1514import {
@@ -22,7 +21,6 @@ import { SuccessfullyAutotrainedNotification } from '../../shared/components/coa
2221import { TutorialCardBuilder } from '../../shared/components/tutorial-card/tutorial-card-builder.component' ;
2322import { getFuxSetting } from '../../shared/components/tutorials/utils' ;
2423import { useTutorialEnablement } from '../../shared/hooks/use-tutorial-enablement.hook' ;
25- import { hasEqualId } from '../../shared/utils' ;
2624import { ErrorBoundary } from '../errors/error-boundary.component' ;
2725import { useProject } from '../project-details/providers/project-provider/project-provider.component' ;
2826import { EmptyAnnotationsNotification } from './annotation/annotation-list/annotation-list-thumbnail-grid/empty-annotations-notification.component' ;
@@ -36,6 +34,7 @@ import { Sidebar } from './components/sidebar/sidebar.component';
3634import { VideoPlayer } from './components/video-player/video-player.component' ;
3735import { AnnotationScene } from './core/annotation-scene.interface' ;
3836import { useCopyPasteAnnotation } from './hooks/use-copy-paste-annotation/use-copy-paste-annotation.hook' ;
37+ import { useLabelShortcuts } from './hooks/use-label-shortcuts.hook' ;
3938import { useSelectedAnnotations } from './hooks/use-selected-annotations.hook' ;
4039import { useVisibleAnnotations } from './hooks/use-visible-annotations.hook' ;
4140import { AutoTrainingCreditsModalFactory } from './notification/auto-training-credits-modal/auto-training-credits-modal.component' ;
@@ -48,7 +47,6 @@ import { useAnnotator } from './providers/annotator-provider/annotator-provider.
4847import { useROI } from './providers/region-of-interest-provider/region-of-interest-provider.component' ;
4948import { useSelectedMediaItem } from './providers/selected-media-item-provider/selected-media-item-provider.component' ;
5049import { SelectedMediaItem } from './providers/selected-media-item-provider/selected-media-item.interface' ;
51- import { useTask } from './providers/task-provider/task-provider.component' ;
5250
5351const GRID_AREAS = [
5452 'backHome navigationToolbar navigationToolbar' ,
@@ -73,28 +71,6 @@ const ErrorFallback = ({ error }: { error: { message: string } }) => {
7371 ) ;
7472} ;
7573
76- // For now we'll remove any empty labels from a sub task if we're in the "All tasks" view
77- const useLabelShortcuts = ( ) : Label [ ] => {
78- const { labels : taskLabels , tasks, selectedTask } = useTask ( ) ;
79-
80- if ( tasks . length < 2 || selectedTask !== null ) {
81- return taskLabels . filter ( ( label ) => tasks . some ( ( task ) => task . labels . some ( hasEqualId ( label . id ) ) ) ) ;
82- }
83-
84- const secondTask = tasks [ 1 ] ;
85-
86- return taskLabels . filter ( ( label ) => {
87- if ( ! isExclusive ( label ) ) {
88- return true ;
89- }
90-
91- return (
92- ! secondTask . labels . some ( hasEqualId ( label . id ) ) &&
93- tasks . some ( ( task ) => task . labels . some ( hasEqualId ( label . id ) ) )
94- ) ;
95- } ) ;
96- } ;
97-
9874interface CopyPasteProps {
9975 labels : Label [ ] ;
10076 scene : AnnotationScene ;
0 commit comments