microsoft / microsoft/Microsoft-Fabric-workload-development-sample
[Question] Dialog created with workloadClient.dialog.open briefly shows previous dialog
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 58
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
Workload Manifest Schema Version (if relevant)
No response
Your Question
We use workloadClient.dialog.open for our create dialogs and for a dialog we use to import sample assets. Recently, when we move from a creation experience to sample import or visa-versa, we see a brief blink of the wrong dialog content.
Example flow:
- create a decision
- import sample data (Note a brief flash of the create decision dialog content)
You can see this in the attached recording.
This has only been happening for the last few weeks. Recently, I changed our call to "workloadClient.dialog.close" to always use CloseMode=2. Before this, we were sometimes having operations fail as the intended dialog was never displayed. Since this change, we do seem to always get the correct dialog but often with the brief display of the WRONG dialog as shown in the recording.
Is there anything you can think of that we might be doing wrong?
Another thing to mention.... probably 2 months ago, we notice that the IFrame created for dailogs is handled differently than before. Before, we could always count on "useState()" hooks to be cleared whenever a dialog is displayed. Now, we have to use an "IntersectionObserver" to manually clear the local useStates or we see information from the previous use of the dialog when we do not want that. My guess is that the Iframe is beging retained and dialogs are not being properly destroyed.
Any advice is greatly appreciated.
Context / Background
https://github.com/user-attachments/assets/f477005f-5b63-4be1-aff3-61aa24d4f49b
Additional References
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the workloadClient.dialog.open and workloadClient.dialog.close call sites, then review the attached recording and the useState and IntersectionObserver lifecycle behavior. Reproduce the create-to-sample-import transitions and verify that the intended dialog appears without a flash of previous content and that prior dialog state is cleared.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100