Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
270 stars 75 forks source link

calcite-alert: allow control over behavior of alerts in the Queue #8316

Open paulcpederson opened 7 months ago

paulcpederson commented 7 months ago

Check existing issues

Description

Currently, the queue is entirely managed by calcite, and no API is available for clearing, reordering, or otherwise working with the queque.

The current behavior of the queue is causing customer confusion is some scenarios and workflows. When a low-priority alert is already visible, and you add an alert that is very important to the user's workflow, it will be rendered behind the current alert. The user may not see this (see https://github.com/Esri/calcite-design-system/issues/2835).

Further, if you want to clear the Queue as a developer, the only way is to either:

  1. remove all the alerts from the DOM (sometimes impossible if code you can't control is rendering alerts in shadow dom, for example)
  2. emit an internal sync event (clearly this is an anitpattern as it uses an internal event which could change or break at any time)

Acceptance Criteria

Developers should be able to specify when rendering an alert how they want the queque to behave. Either:

  1. Render at the bottom of the stack (current behavior)
  2. Render on the top of the stack (existing alert moves backwards)
  3. Replace the current alert

Additionally it may be nice to consider an API where calcite users could get access to the Queue through an officially support means.

Relevant Info

No response

Which Component

calcite-alert

Example Use Case

  1. An alert is showing at the bottom of the screen telling the user a new feature is now available.
  2. The user does not dismiss this, they just ignore it
  3. The user is taking a critical action and an error occurs
  4. The error alert is behind the first alert, and they don't know what is wrong as the meaningful information is hidden

Priority impact

p4 - not time sensitive

Calcite package

Esri team

ArcGIS Online

paulcpederson commented 5 months ago

@benelan or @geospatialem if you two get a second could you triage this and consider for a release? I continue to get issues about stacking calcite alerts as users/PEs feel the current behavior is unexpected or a bug.

geospatialem commented 5 months ago

@benelan or @geospatialem if you two get a second could you triage this and consider for a release? I continue to get issues about stacking calcite alerts as users/PEs feel the current behavior is unexpected or a bug.

@paulcpederson We're splitting up both the above and a new issue, #8705, which will propose the following: