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

fix: staging status & queue insanity #6871

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

psychedelicious
Copy link
Collaborator

Summary

This PR reworks a few related queue-related issues I'd been struggling with:

  • Staging area state
  • Progress event handling (progress images & progress bar)
  • Queue control UI

Staging Area Status

The frontend had no way to check if there were pending canvas generations. I had tried to work around this by manually tracking queue items for canvas generations but it got really messy, and still didn't fix all of the problems. Notably, it was possible for the staging area to get stuck if you start a canvas generation and immediately cancel it.

In this PR, a new method is added to the queue & its router to get the queue item counts for a given destination. For example, we can use this to check if there are any in progress queue items for canvas, which tells us if we should be in staging mode or not. This small change opens a path to resolving the stuck staging area issue, and remove all the manual tracking nonsense.

Now, we know we should be staging if 1) we have images staged or 2) there is a pending/in-progress canvas generation.

This change also allows progress event handling in the frontend to be simplified quite a bit.

Progress Event Handling

The major change here is that the canvas classes now manage their own socket subscription and progress event tracking. The "global" progress event handling is also simplified.

(The "global" progress event handling is what drives the progress bar & progress images in the viewer, while the canvas-managed progress event handling drives the progress images that display on the canvas.)

Had to move some stuff around to fix circular imports.

Queue Controls UI

  • Remove the Queue Front button (lightning bolt), you can hold shift while clicking invoke to use that feature now. This frees up some room in the queue controls area.
  • With the reclaimed space, restore the queue menu button w/ dedicated clear queue button.
  • Consolidate the hooks used to invoke.

Related Issues / Discussions

Some reports on discord, offline discussion

QA Instructions

Try to break the progress bar and progress images by queuing and canceling items in various ways and at different times. Should be bulletproof 🤞 both for send-to-canvas and send-to-gallery.

Merge Plan

I can do an alpha tomorrow morning

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 api python PRs that change python files services PRs that change app services frontend PRs that change frontend files labels Sep 17, 2024
This allows the frontend to check if there are, for example, pending canvas generations.
- Remove queue front button. Hold shift while clicking `Invoke` button to queue front.
- Restore queue menu actions w/ the reclaimed space.
- Simplify queue interaction hooks.
- Canvas manages its own progress socket event listeners and progress event data.
- Remove cancellations listener jank.
- Dip into low-level redux subscription API to watch for queue status changes, clearing the last "global" progress event when the queue has nothing in progress. Could also do this in a useEffect I guess.
- Had to shuffle some things around to prevent circular imports, so there are a lot of tiny changes here.
@hipsterusername hipsterusername enabled auto-merge (rebase) September 18, 2024 03:32
@hipsterusername hipsterusername merged commit 7db4d26 into main Sep 18, 2024
14 checks passed
@hipsterusername hipsterusername deleted the psyche/feat/staging-filter-queue branch September 18, 2024 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api frontend PRs that change frontend files python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants