Skip to content

feat(ui): add toggle for bbox with hotkey #8385

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

csehatt741
Copy link

Summary

A new feature was implemented to show/hide the bounding box.

  • A method, toggleBboxVisibility, was added to CanvasBboxToolModule, which toggles the visibility flag of the bounding box.
  • A new hotkey hook, useCanvasToggleBboxHotkey, was implemented and integrated into CanvasToolbar. This registers Shift+O as a hotkey in useHotkeyData to trigger the toggleBboxVisibility method, providing a quick keyboard shortcut.
  • A new component, CanvasAlertsBboxVisibility, was introduced, which shows a warning message, when the bounding box is hidden.
  • New translation string were added to en.json for the warning message.

Related Issues / Discussions

Closes #7182

QA Instructions

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added the frontend PRs that change frontend files label Aug 4, 2025
Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! One small change requested.

Comment on lines 199 to 201

// Listen for stage changes to update the bbox's visibility
this.subscriptions.add(this.$isBboxHidden.listen((isHidden) => this.konva.group.visible(!isHidden)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this hidden check should be in the render method, and the listener calls the render method. Otherwise the render method could run for some other reason, and make the bbox visible, even when it is hidden.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting bbox visibility moved into the render method

@csehatt741 csehatt741 force-pushed the feature/restore-bbox-hiding-functionality branch from ac3ee6b to 7ef257f Compare August 5, 2025 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[enhancement]: restore bbox hiding functionality
2 participants