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

refactor(ui): modals state, workflow list modal misc #7087

Merged
merged 22 commits into from
Oct 10, 2024

Conversation

psychedelicious
Copy link
Collaborator

Summary

Started addressing some issues w/ workflows list modal and had to make some deeper changes:

  • We had some modals related to list items, where a modal was rendered for each list item (delete style preset, delete workflow, share workflow, new workflow). Besides being wasteful for large lists, it's possible to accidentally open multiples at once (e.g. there was a bug where all share modals opened at once). These are now all singleton components.
  • Add useAssertSingleton to all singleton modals. In case we accidentally render a singleton modal twice, we'll get an error immediately.
  • Add a utility to build global disclosure state hooks. It's the same as buildUseBoolean, but with the semantics of disclosure state. For example, isOpen vs isTrue, open() vs setTrue().
  • Fix an issue upstream in @invoke-ai/ui-library where the confirmation dialog didn't spread its ...rest props correctly. This fixes some stragglers for a perf issue that I had intended to fix in ace8794.
  • An issue with the workflow list item tooltips getting stuck open.
  • A couple issues where workflow list item action buttons erroneously also selected the workflow.
  • Only show the share button for non-user workflows.
  • A few minor UI/styling things.
  • Change the red x clear workflow button to be a new workflow button, restoring the confirmation dialog.
  • Fix a longstanding bug where workflows are marked touched on first load 😌
  • Fix an edge case where the workflow list menu could get stuck open.

Related Issues / Discussions

scattered discord feedback and offline discussion

QA Instructions

Have a play w/ the menu. There should be only minor user-facing changes, specifically the clear workflow button is now a new workflow button.

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 frontend-deps PRs that change frontend dependencies frontend PRs that change frontend files labels Oct 10, 2024
- Tooltips on buttons for a list item getting stuck
- List item action buttons should not propagate clicks
Brings in a fix where ConfirmationAlertDialog rest props weren't used correctly.
The component state is a global singleton, but each workflow had an instance of the modal. So when you open one, they _all_ opened.
…, or it opens unexpectedly

- When resetting workflows, retain the current mode state
- Remove the useEffect that reacted to the `isCleanEditor` flag to prevent getting menu getting locked open
@psychedelicious psychedelicious merged commit 69773a7 into main Oct 10, 2024
14 checks passed
@psychedelicious psychedelicious deleted the psyche/refactor/ui/modals-misc branch October 10, 2024 04:49
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 frontend-deps PRs that change frontend dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants