Skip to content

Commit

Permalink
fix: DIA-989: LSF hotkeys being stuck when LSF is destroyed (HumanSig…
Browse files Browse the repository at this point in the history
…nal#5790)

Whenever you enter Labeling Interface (Quick View, Label Stream,
Labeling Settings), hotkeys assigned to labels and choices are not being
unbound when you leave the given page. This sometimes causes an
inability to input certain characters in other places of the app.

### PR fulfills these requirements
- [x] Commit message(s) and PR title follows the format
`[fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made`
ex. `fix: DEV-XXXX: Removed inconsistent code usage causing intermittent
errors`
- [ ] Tests for the changes have been added/updated (for bug
fixes/features)
- [ ] Docs have been added/updated (for bug fixes/features)
- [x] Best efforts were made to ensure docs/code are concise and
coherent (checked for spelling/grammatical errors, commented out code,
debug logs etc.)
- [x] Self-reviewed and ran all changes on a local instance (for bug
fixes/features)



#### Change has impacts in these area(s)
_(check all that apply)_
- [ ] Product design
- [ ] Backend (Database)
- [ ] Backend (API)
- [x] Frontend




#### What is the new behavior?
Auto-assigned hotkeys are now correctly unbound when leaving a page (LSF
destroyed)




#### Does this change affect performance?
No



#### Does this change affect security?
No



### Does this PR introduce a breaking change?
_(check only one)_
- [ ] Yes, and covered entirely by feature flag(s)
- [ ] Yes, and covered partially by feature flag(s)
- [x] No
- [ ] Not sure (briefly explain the situation below)



### What level of testing was included in the change?
_(check all that apply)_
- [ ] e2e
- [ ] integration
- [ ] unit



### Which logical domain(s) does this change affect?
Frontend, Global

---------

Co-authored-by: robot-ci-heartex <[email protected]>
Co-authored-by: nicholasrq <[email protected]>
Co-authored-by: Brandon Martel <[email protected]>
  • Loading branch information
4 people authored May 8, 2024
1 parent 1c27032 commit cd05a4e
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion web/dist/apps/labelstudio/main.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions web/dist/apps/labelstudio/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "Revert #5824",
"commit": "c3ef6015499d27319533be5701ad23f105645ed0",
"date": "2024-05-08T13:08:10.000Z",
"branch": "fb-optic-720/viewsstore-foreach"
"message": "Merge branch 'develop' into fb-dia-989/hotkeys-stuck",
"commit": "cb6e68bc71dc0063679c60ac7d0ced52c1efd53a",
"date": "2024-05-08T20:42:38.000Z",
"branch": "fb-dia-989/hotkeys-stuck"
}
2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions web/dist/libs/datamanager/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "Revert #5824",
"commit": "c3ef6015499d27319533be5701ad23f105645ed0",
"date": "2024-05-08T13:08:10.000Z",
"branch": "fb-optic-720/viewsstore-foreach"
"message": "Merge branch 'develop' into fb-dia-989/hotkeys-stuck",
"commit": "cb6e68bc71dc0063679c60ac7d0ced52c1efd53a",
"date": "2024-05-08T20:42:38.000Z",
"branch": "fb-dia-989/hotkeys-stuck"
}
2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions web/dist/libs/editor/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "Revert #5824",
"commit": "c3ef6015499d27319533be5701ad23f105645ed0",
"date": "2024-05-08T13:08:10.000Z",
"branch": "fb-optic-720/viewsstore-foreach"
"message": "Merge branch 'develop' into fb-dia-989/hotkeys-stuck",
"commit": "cb6e68bc71dc0063679c60ac7d0ced52c1efd53a",
"date": "2024-05-08T20:42:38.000Z",
"branch": "fb-dia-989/hotkeys-stuck"
}
1 change: 1 addition & 0 deletions web/libs/editor/src/LabelStudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export class LabelStudio {
this.store.selfDestroy();
}
destroy(this.store);
Hotkey.unbindAll();
if (isFF(FF_LSDV_4620_3_ML)) {
/*
...
Expand Down
2 changes: 2 additions & 0 deletions web/libs/editor/src/core/Hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { FF_LSDV_1148, FF_MULTI_OBJECT_HOTKEYS, isFF } from "../utils/feature-fl
import { isDefined, isMacOS } from "../utils/utilities";
import defaultKeymap from "./settings/keymap.json";

type Keymap = typeof defaultKeymap;

if (!isFF(FF_MULTI_OBJECT_HOTKEYS)) {
const prev = (defaultKeymap as Keymap)["image:prev"];
const next = (defaultKeymap as Keymap)["image:next"];
Expand Down
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"@testing-library/react": "12.1.2",
"@types/chroma-js": "^2.1.3",
"@types/jest": "^29.4.0",
"@types/keymaster": "^1.6.33",
"@types/mini-css-extract-plugin": "^2.5.1",
"@types/node": "18.14.2",
"@types/react": "18.2.33",
Expand Down
1 change: 1 addition & 0 deletions web/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"importHelpers": true,
"target": "esnext",
"module": "esnext",
Expand Down
13 changes: 9 additions & 4 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5042,6 +5042,11 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==

"@types/keymaster@^1.6.33":
version "1.6.33"
resolved "https://registry.yarnpkg.com/@types/keymaster/-/keymaster-1.6.33.tgz#2a96eeceed9bb24e43c270e6d038352a44502efd"
integrity sha512-J+dF4hsKaq+L5Ny6alxNC2XwJbONGmVbXmycH/GrlBAzTdYJJcG9kQ0PVVb/C6iFyujFY7J2oW+0Y8h5vtuACA==

"@types/keyv@^3.1.4":
version "3.1.4"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6"
Expand Down Expand Up @@ -9948,10 +9953,10 @@ flat@^5.0.2:
resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==

follow-redirects@^1.0.0, follow-redirects@^1.15.0, follow-redirects@^1.15.5:
version "1.15.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020"
integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==
follow-redirects@^1.0.0, follow-redirects@^1.15.0, follow-redirects@^1.15.6:
version "1.15.6"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==

for-each@^0.3.3:
version "0.3.3"
Expand Down

0 comments on commit cd05a4e

Please sign in to comment.