Skip to content

Stacked popups - #15496

Merged
tidy-dev merged 16 commits into
developmentfrom
stacked-popups
Oct 26, 2022
Merged

tidy-dev merged 16 commits into
developmentfrom
stacked-popups

Conversation

@tidy-dev

@tidy-dev tidy-dev commented Oct 20, 2022 •

Copy link
Copy Markdown
Contributor

Description

This is one of of a couple PR's to introduce the idea of stacking popups. It does so through introducing a popup manager that works as a service introduced where needed.

Next PR, refactor the app errors to be part of the other popups so they are stacked as well.

Currently, this just shows one popup at a time, thus, on open and close the popup gets re-rendered and it's state effectively reset. This could be a problem for a popup with a more complicated state that we want to remember. A future pr will explore possibility of having the stack rendered by only one popup visible at a time or any other method for remembering states.

I am attempting to not change the current app behavior regarding popups. For example, we have cases where we close the popup without a type -> I preserved that capability by removing the latest in the stack when no type is provided. Also, the _completeOpenInDesktop feels out of place here.. maybe it should be moved to the cloning components or whatever method calls the close popup in coordination with cloning. Thus, these things could be improved as part of this work, but I would like to isolate them to other PRs to be able to regression test them separately.

Open question:

  1. Add a close all?
  2. Add a way to close popup type x when popup type y is closed? Like if a popup was open and an error popup arises rendering that popup in a bad state such that we want to close it on error popup closing. I don't have a real scenario in mind yet tho, so maybe wait till it is needed.

Screenshots

Screen.Recording.2022-10-20.at.3.16.49.PM.mov

Release notes

Notes: [Improved] Opening a new popup up does not close the existing one.

@tidy-dev
tidy-dev marked this pull request as draft October 21, 2022 14:00
@tidy-dev

Copy link
Copy Markdown
Contributor Author

For context...
Discussed this approach with Markus, decided to move away from this being a singleton so that we can maintain our approach using the app-store as our controlling entity for app-wide state management. Thus, I am going to refactor slightly to make it so that all app interaction with the popup manager goes through the app-store.

@sergiou87 sergiou87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Just a few comments. I'm a bit afraid of the regressions this new might introduce 😂

Maybe we could use a feature flag to make the PopupManager switch between using the stack or use the current single-popup approach? 🤔

Comment thread app/src/lib/popup-manager.ts Resolved
Comment thread app/src/lib/popup-manager.ts Resolved
Comment thread app/src/lib/popup-manager.ts Resolved
Comment thread app/src/models/popup.ts Resolved
@tidy-dev

Copy link
Copy Markdown
Contributor Author

Maybe we could use a feature flag to make the PopupManager switch between using the stack or use the current single-popup approach?

Totally right -> I totally forgot to feature flag this..

tidy-dev and others added 2 commits October 24, 2022 06:32
@tidy-dev
tidy-dev marked this pull request as ready for review October 24, 2022 11:51
@tidy-dev
tidy-dev requested a review from sergiou87 October 24, 2022 11:51
sergiou87
sergiou87 previously approved these changes Oct 26, 2022

@sergiou87 sergiou87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for those changes!

Comment thread app/src/models/popup.ts Resolved
Comment thread app/src/lib/popup-manager.ts Resolved
@sergiou87
sergiou87 dismissed their stale review October 26, 2022 11:19

Oops! Sorry, I approved the code but forgot to test it

@sergiou87 sergiou87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now tested and seems to work as expected, with both the feature flag enabled and disabled 🙌

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.

3 participants