diff --git a/.github/workflows/build_bundle.yml b/.github/workflows/build_bundle.yml index 9bfe15fc26..c07fb56c13 100644 --- a/.github/workflows/build_bundle.yml +++ b/.github/workflows/build_bundle.yml @@ -46,7 +46,7 @@ jobs: run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Configure yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }} diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 369c08aec0..6509c934ac 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -43,7 +43,7 @@ jobs: run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Configure yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }} diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index a9d0f66509..c6269b20c8 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -45,7 +45,7 @@ jobs: run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Configure yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }} @@ -62,7 +62,7 @@ jobs: npm list --depth=1 || true - name: Run ESLint - uses: tj-actions/eslint-changed-files@v21 + uses: tj-actions/eslint-changed-files@v23 env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/fun_tests.yml b/.github/workflows/fun_tests.yml index 534f93f27f..006d54a52c 100644 --- a/.github/workflows/fun_tests.yml +++ b/.github/workflows/fun_tests.yml @@ -44,7 +44,7 @@ jobs: run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Configure yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }} diff --git a/.github/workflows/release-set-version.yml b/.github/workflows/release-set-version.yml index d4740058bc..6a58412c95 100644 --- a/.github/workflows/release-set-version.yml +++ b/.github/workflows/release-set-version.yml @@ -31,7 +31,7 @@ jobs: node-version: "${{ env.NODE }}" - name: Cache node modules - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.npm key: npm-${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-jsdoc-to-markdown diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 63f50b9868..9147df2b35 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -40,7 +40,7 @@ jobs: run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Configure yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }} diff --git a/src/LabelStudio.js b/src/LabelStudio.js index f0f6c6fd5e..29541ec5b7 100644 --- a/src/LabelStudio.js +++ b/src/LabelStudio.js @@ -79,6 +79,8 @@ export class LabelStudio { }; const clearRenderedApp = () => { + if (!rootElement.childNodes?.length) return; + const childNodes = [...rootElement.childNodes]; // cleanDomAfterReact needs this key to be sure that cleaning affects only current react subtree const reactKey = findReactKey(childNodes[0]); diff --git a/src/core/Hotkey.ts b/src/core/Hotkey.ts index 62bdaee544..5738692d2d 100644 --- a/src/core/Hotkey.ts +++ b/src/core/Hotkey.ts @@ -5,10 +5,22 @@ import { createElement, Fragment } from 'react'; import { Tooltip } from '../common/Tooltip/Tooltip'; import Hint from '../components/Hint/Hint'; import { Block, Elem } from '../utils/bem'; -import { FF_LSDV_1148, isFF } from '../utils/feature-flags'; +import { FF_LSDV_1148, FF_MULTI_OBJECT_HOTKEYS, isFF } from '../utils/feature-flags'; import { isDefined, isMacOS } from '../utils/utilities'; import defaultKeymap from './settings/keymap.json'; +if (!isFF(FF_MULTI_OBJECT_HOTKEYS)) { + const prev = (defaultKeymap as Keymap)['image:prev']; + const next = (defaultKeymap as Keymap)['image:next']; + + if (prev) { + prev.key = prev.mac = 'ctrl+a'; + } + if (next) { + next.key = next.mac = 'ctrl+d'; + } +} + // Validate keymap integrity const allowedKeympaKeys = ['key', 'mac', 'description', 'modifier', 'modifierDescription']; diff --git a/src/core/settings/keymap.json b/src/core/settings/keymap.json index e4aadf1b00..d5a5af2615 100644 --- a/src/core/settings/keymap.json +++ b/src/core/settings/keymap.json @@ -168,11 +168,13 @@ "description": "Previous Page" }, "image:prev": { - "key": "ctrl+a", + "key": "ctrl+left", + "mac": "command+left", "description": "Previous Image" }, "image:next": { - "key": "ctrl+d", + "key": "ctrl+right", + "mac": "command+right", "description": "Next Image" } } diff --git a/src/regions/VideoRegion.js b/src/regions/VideoRegion.js index 231320c3f1..c8cda9e8da 100644 --- a/src/regions/VideoRegion.js +++ b/src/regions/VideoRegion.js @@ -1,4 +1,4 @@ -import { types } from 'mobx-state-tree'; +import { getRoot, types } from 'mobx-state-tree'; import { guidGenerator } from '../core/Helpers'; import { AreaMixin } from '../mixins/AreaMixin'; @@ -34,7 +34,7 @@ const Model = types }, get annotation() { - return self.object.annotation; + return getRoot(self)?.annotationStore?.selected; }, getShape() { diff --git a/src/utils/feature-flags.ts b/src/utils/feature-flags.ts index 922cf6d2fb..83ae35b73a 100644 --- a/src/utils/feature-flags.ts +++ b/src/utils/feature-flags.ts @@ -333,6 +333,8 @@ export const FF_ZOOM_OPTIM = 'fflag_fix_front_leap_32_zoom_perf_190923_short'; export const FF_SAFE_TEXT = 'fflag_fix_leap_466_text_sanitization'; +export const FF_MULTI_OBJECT_HOTKEYS = 'fflag_fix_leap_246_multi_object_hotkeys_160124_short'; + Object.assign(window, { APP_SETTINGS: { ...(window.APP_SETTINGS ?? {}),