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

[enhancement]: Cancel all items except the current #7367

Open
1 task done
magnusviri opened this issue Nov 21, 2024 · 2 comments
Open
1 task done

[enhancement]: Cancel all items except the current #7367

magnusviri opened this issue Nov 21, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for new contributors web ui

Comments

@magnusviri
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Contact Details

magnusviri

What should this feature add?

Currently there's "Cancel Current Item" and "Cancel and Clear All Items". Would it be possible to "Cancel All But the Current Item"? My computer is slow and sometimes I want the current item to finish but none of the others.

Alternatives

No response

Additional Content

No response

@magnusviri magnusviri added the enhancement New feature or request label Nov 21, 2024
@psychedelicious psychedelicious added good first issue Good for new contributors web ui labels Nov 21, 2024
@psychedelicious
Copy link
Collaborator

I find myself wanting this button all the time!


This would be a good issue for a new contributor. Broad strokes of suggested implementation:

  • Add a new method to SessionQueueBase called cancel_all_except_current.
  • Add a SQLite implementation in SqliteSessionQueue. You can follow the pattern in the clear method, with an extra condition to exclude any in-progress queue items.
  • Regenerate the frontend types. From the repo root, run make frontend-typegen. If you don't have make (e.g. you are on Windows), you can restart the server and run pnpm typegen.
  • Add the endpoint in queue.ts, following the patterns in this file. Export the mutation hook.
  • Add a menu item for this new feature in <QueueActionsMenuButton />. The existing "clear" action uses a modal to confirm the clear request. I think we'd want that for the new feature too, but I could be convinced otherwise.

Please ping me on discord or here if you want to implement this to check in, and if you have any questions.

@rikublock
Copy link
Contributor

Same here! I would very much like to have that button too.

In case someone looks at this in the future. I found that it also needs an api route definition for cancel_all_except_current in session_queue.py before make frontend-typegen works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for new contributors web ui
Projects
None yet
Development

No branches or pull requests

3 participants