Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor(ui): hotkey/focus handling #6987

Merged
merged 8 commits into from
Sep 30, 2024
Merged

Conversation

psychedelicious
Copy link
Collaborator

Summary

Refactors how hotkeys are conditionally enabled. See comments in invokeai/frontend/web/src/common/hooks/focus.ts for implementation details.

  • Recall hotkeys work when either the image viewer or gallery are focused. The last-selected image is used for the hotkeys.
  • Same for delete selection hotkey.
  • Added hotkeys to apply and cancel both filters and transforms. The canvas must be focused for these hotkeys to work. Starting a filter or transform focuses the canvas.

Related Issues / Discussions

Closes #6421
Closes #6398

QA Instructions

Try hotkeys out. Behaviour should be unchanged except as described above.

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

@github-actions github-actions bot added the frontend PRs that change frontend files label Sep 30, 2024
@hipsterusername
Copy link
Member

Tested out - There were some areas that could potentially be improved/unintuitive. For example, when switching to Gallery, the Gallery header is focused, so left/right does not move in the gallery images (my immediate expectation would be switching to gallery focuses the gallery w selected image as place im starting)

All in all though, think that can be addressed in a future PR - this looks good to me.

@psychedelicious
Copy link
Collaborator Author

For example, when switching to Gallery, the Gallery header is focused, so left/right does not move in the gallery images

I noticed this, not sure how to handle this. This is an accessibility thing - the component library's tabs component is following the ARIA guidelines for the tabs UI pattern. We'll need to break those guidelines to have it do something else. Probably not a huge deal for this specific area.

@psychedelicious psychedelicious merged commit 6efa159 into main Sep 30, 2024
14 checks passed
@psychedelicious psychedelicious deleted the psyche/feat/hotkeys-focus branch September 30, 2024 20:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
frontend PRs that change frontend files
Projects
None yet
2 participants