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

up and down button support in gallery navigation #5389

Merged
merged 5 commits into from
Jan 6, 2024

Conversation

rohinish404
Copy link
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Community Node Submission

Have you discussed this change with the InvokeAI team?

  • Yes
  • No, because:

Have you updated all relevant documentation?

  • Yes
  • No

Description

Adding support for top and bottom keys while navigating the gallery.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

Merge Plan

Added/updated tests?

  • Yes
  • No : please replace this line with details on why tests
    have not been included

[optional] Are there any post deployment tasks we need to perform?

- Fix preexisting bug where gallery network requests were duplicated when triggering infinite scroll
- Refactor `useNextPrevImage` to not use `state => state` as an input selector - logic split up into different hooks
- Remove use instant scroll for arrow key navigation - smooth scroll is janky when you hold the arrow down and it fires rapidly
- Move gallery nav hotkeys to GalleryImageGrid component, so they work whenever the gallery is open (previously didn't work on canvas or workflow editor tabs)
- Use nanostores for gallery grid refs instead of passing context with virtuoso's context feature, making it much simpler to do the imperative gallery nav
- General gallery hook/component cleanup
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.

I fixed up a few things, some of which were preexisting problems, that were easier to solve by updating this PR than separately. See my last commit for details.

You core implementation is great though. It works really well - thank you!

@psychedelicious psychedelicious merged commit f8c3db7 into invoke-ai:main Jan 6, 2024
7 checks passed
@rohinish404
Copy link
Contributor Author

I fixed up a few things, some of which were preexisting problems, that were easier to solve by updating this PR than separately. See my last commit for details.

You core implementation is great though. It works really well - thank you!

Thank you for detailed explanation @psychedelicious ! It'll help a lot in my learnings.

@rohinish404 rohinish404 deleted the rohinish-patch-7 branch January 6, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[enhancement]: Support top and bottom arrow keys while navigating gallery.
2 participants