Meeds-io / MIPs

The Meeds Improvement Proposal repository
0 stars 0 forks source link

Snackbar component UX/UI #99

Closed srenault-meeds closed 11 months ago

srenault-meeds commented 11 months ago

Rationale

Two concerns regarding the snackbar:

1. Functional Requirements

Top User Stories

Desktop:

Text:

If CTA link

Close icon

Snackbar style:

image

Mobile

notif bottom tabbar

Impacts

Any existing snackbar must use this component

Gamification

NA

Notifications

NA

Analytics

NA

Unified Search

NA

2. Technical Requirements

Extensibility

The Toast notification component is added globally in all pages with a single instance and can be called using directives:

this.$root.$emit('alert-message', MESSAGE, TYPE);
this.$root.$emit('alert-message-html', HTML_MESSAGE, TYPE);
this.$root.$emit('alert-message-html-confeti', HTML_MESSAGE, TYPE);
....
// for advanced usage, to display a link by example, we can use document.dispatchEvent
document.dispatchEvent(new CustomEvent('alert-message', {detail: {
  useHtml: true/false,
  confeti: true/false,
  alertType: 'success' | 'error' | 'warning' | 'info',
  alertMessage: MESSAGE,
  alertLink: URL,
  alertLinkText: LINK_TEXT,
  alertLinkTarget: '_blank' | '_self' ...,
  alertLinkIcon: 'fa-...',
  alertLinkTooltip: LINK_TITLE,
  alertLinkCallback: () => FUNCTION(),
}}));

This flexibility will be kept and we will have just to rework all existing notifications to re-use this component through the existing API.

Upgradability

An cleanup of existing alerts has to be made to reuse this component through existing API. In addition, the overridden style of v-alert will have to be removed to allow using v-alert as predefined in Vuetify.

Feature Flags

No feature flag.

4. Software Architecture

Access

All snackbar alerts in all Meeds modules will have to be removed in favor of this component in order to centralize the UX for a better maintainability and product design evolution. In addition, the existing overridden v-alert style of Vuetify will have to be removed to allow using v-alert in page. The current Snackbar z-index has to be reviewed as well to make it on top of all UI components.

srenault-meeds commented 11 months ago

@margondicco Can you please take a look at it please? We started to work it as enhancements but we suggest to make it a MIP to make sure you can take it into account.

margondicco commented 11 months ago

Hello ok cc @Julien-Dubois-eXo

srenault-meeds commented 11 months ago

Thanks Go-Fonc added

boubaker commented 11 months ago

Ready for tech review by DAO members (eXo: @rdenarie )

rdenarie commented 11 months ago

Go tech

boubaker commented 11 months ago

Accs & PRs ready to review by DAO members (eXo : @rdenarie )

boubaker commented 11 months ago

Accs & PRs ready to review by DAO members (eXo : @rdenarie )

A new PR for automatic tests adoption has been added as well.

rdenarie commented 11 months ago

All pr validated

boubaker commented 11 months ago

All pr validated

Thanks @rdenarie , can you please review again https://github.com/Meeds-io/notes/pull/779 A modification is made due to a rebase conflict

boubaker commented 11 months ago

All pr validated

Thanks @rdenarie . All PRs merged.