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

Specific shortcut settings are not being saved after refreshing page #8440

Open
2 tasks done
likelikeslike opened this issue Sep 13, 2024 · 2 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@likelikeslike
Copy link

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Steps to Reproduce

  1. Go to settings and select shortcuts tab.
  2. Change the shortcut for Switch label to xxx under the Objects sidebar to a new key combination.
  3. Refresh the page.
  4. The shortcut is resettled to default.

Expected Behavior

After saving this change, the shortcut works and remains active even after refreshing the page. I have tested some shortcuts under General and Annotation page, and they function properly without resetting to the default settings.

Possible Solution

Should the same logic for shortcuts under General be applied here as well?

Context

No response

Environment

Self-hosted CVAT (v2.18.0) with customized permission controls, particularly for data exportation.
@likelikeslike likelikeslike added the bug Something isn't working label Sep 13, 2024
@bsekachev
Copy link
Member

Reproducable, thanks

@bsekachev bsekachev self-assigned this Sep 16, 2024
@luukvnes
Copy link

Can be fixed by adding this line
sequences: keyMap[key]?.sequences ?? updatedComponentShortcuts[key].sequences,
to label-list.tsx in the below useEffect

    useEffect(() => {
        const updatedComponentShortcuts = JSON.parse(JSON.stringify(componentShortcuts));
        for (const [index, labelID] of Object.entries(keyToLabelMapping)) {
            if (labelID) {
                const labelName = labels.find((label: any) => label.id === labelID)?.name;
                const key = makeKey(+index);
                updatedComponentShortcuts[key] = {
                    ...updatedComponentShortcuts[key],
                    nonActive: false,
                    name: `Switch label to ${labelName}`,
                    description: `Changes the label to ${labelName} for the activated
                        object or for the next drawn object if no objects are activated`,
                    sequences: keyMap[key]?.sequences ?? updatedComponentShortcuts[key].sequences,
                };
            }
        }

        registerComponentShortcuts(updatedComponentShortcuts);
    }, [labels]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants