Create a generic UI blocking state system to avoid modal conflicts.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 383
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 77
Description
## Feature Description
Create a centralised system for managing UI blocking states to prevent modal conflicts. The system should disable components that trigger modals when other asynchronous operations are running that might display their own modals.
Currently, the `UserMenu` and `DashboardSharingSettingsButton` components are directly checking for the `isAutoCreatingCustomDimensionsForAudience` operation state to determine if they should be disabled. This creates tight coupling between unrelated components where UI elements need to know about specific background operations that might trigger modals, violating separation of concerns principles.
This feature will provide a generic API for operations to register themselves as "potentially modal-triggering" and allow modal-triggering components like the `UserMenu` and `DashboardSharingSettingsButton` components to check a centralised "should disable to prevent modal conflicts" state, eliminating the need for these components to know about specific unrelated operations.
---
_Do not alter or remove anything below. The following sections will be managed by moderators only._
## Acceptance criteria
- A centralised state management system exists that tracks when operations are running that might display modals.
- A generic selector/hook (e.g., `shouldDisableToPreventModalConflicts()`) is available for modal-triggering components to use instead of checking specific operation flags.
- Operations can register themselves as "potentially modal-triggering" when they start, and unregister when they complete through a consistent API.
- The `UserMenu` and `DashboardSharingSettingsButton` components no longer contain hardcoded checks for `isAutoCreatingCustomDimensionsForAudience` and instead use the generic blocking state system.
- Multiple concurrent operations can contribute to the blocking state simultaneously without conflicts.
## Implementation Brief
- [ ]
### Test Coverage
-
## QA Brief
-
## Changelog entry
-
Contributor guide
Assessment
This issue has not been assessed yet.