Tried to use AI to create a workflow with the logic of “back/close” logic:
If any popups are opened, close the most recent.
If no popups, navigate back.
If no back, navigate to specified page.
It created a workflow with fake functions:
/* Get the popup stack safely using optional chaining */
const popupStack = wwLib?.wwPopups?.popupStack || [];
/* Return true if there are any popups in the stack */
return popupStack.length > 0;
I use drawers (aka side-panels), like Notion-style, and from one drawer another can be opened. Like I can open task details from user’s card and then open observer’s user card from the task.
My particular case is I have an integrated app where I want to control a “back” button behavior. To do this, I need to know if we have popup opened, their order in a stack, and be able to address them to close or pop them higher.