Make WordPress Core

Opened 8 years ago

Last modified 5 years ago

#35210 closed enhancement

Add notification area to Customizer — at Version 9

Reported by: westonruter's profile westonruter Owned by:
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Customize Keywords: has-patch has-dev-note
Focuses: ui, javascript Cc:

Description (last modified by westonruter)

There is currently no standard location for showing notifications in the Customizer, whether success messages or failures. Currently in the Customizer, if there is a failure to save due to a server error or connectivity problem, there is no visual indicator that a failure happened other than that the Save & Publish button doesn't get disabled. When an error does happen, there should be an error message displayed there.

In #34893, validation constraints are added to settings in the customizer. When validation constraints fail, the error messages should be shown in the notification bar. Likewise, in #34923 there is a proposal to be able to create new pages in the Customizer: the first iteration is just to add new blank pages with only the title supplied, and upon saving we need to be able to provide edit post links for those new pages so that the body content can be fleshed out. These links can be displayed in a notification bar. (These links can also be included in the nav menu item controls.)

The notification bar should facilitate plugins to inject their own messages and indicate failures vs successes.

Tickets dependent on the notification area:

  • #29932: There is no error reporting in the Customizer
  • #31582: Catching PHP Fatal Errors on WordPress Theme Customizer
  • #34893: Improve Customizer setting validation model
  • #34923: Introduce basic content authorship in the Customizer

Change History (11)

@westonruter
8 years ago

Notification bar can appear above preview, either shifting down the preview or appearing over the preview. It would need to appear somewhere else on mobile, however, perhaps appearing below the Save & Publish header row.

#1 follow-up: @karmatosed
8 years ago

Just checking, but I assume the bar only shows if a notification is in it @westonruter?

#2 in reply to: ↑ 1 @westonruter
8 years ago

Replying to karmatosed:

Just checking, but I assume the bar only shows if a notification is in it @westonruter?

That's right. It would only appear if there is a message to show.

Under the covers, it would make sense for the notification messages to be stored in a wp.customize.Values (collection) instance. When it is empty, the bar would be hidden. When the collection is populated, the bar would be displayed.

@westonruter
8 years ago

Mock of notification bar on mobile

#3 @karmatosed
8 years ago

@westonruter thanks for clarification. Perhaps the phrasing of it as a bar maybe could be changed to notification area? A little change but saves the potential confusion with admin bar.

A few other queries as I look to give some UX feedback:

  • Visually was the plan for notifications to take the entire space up?
  • What happens with multiple notifications? Do they stack? If they stack, what happens with a large number?
  • Will the notifications be the same color and design as used in other areas?

Maybe animation could be explored too, perhaps when the notifications load in or to get people to notice even with a slight bouncing.

Last edited 8 years ago by karmatosed (previous) (diff)

#4 @westonruter
8 years ago

  • Summary changed from Add notification bar to Customizer to Add notification area to Customizer

@karmatosed Thanks for the feedback:

Visually was the plan for notifications to take the entire space up?

By taking up the entire space, do you mean the full width of the preview? If so, then I suppose not as it could take some inspiration from Android's notifications that display when a device is in landscape mode.

What happens with multiple notifications? Do they stack? If they stack, what happens with a large number?

Yes, I should think they stack like admin notices stack in the admin. Good question on if there is a large number. Perhaps there should be up/down arrows to cycle through the notices?

Will the notifications be the same color and design as used in other areas?

As with admin notices, I suppose there would be a red error notice and a green success notice.

Maybe animation could be explored too, perhaps when the notifications load in or to get people to notice even with a slight bouncing.

Good idea.

Also, I'm no designer, so take the mocks I've supplied as just rough placeholders for what it could actually look like :)

#5 @karmatosed
8 years ago

Yes, I should think they stack like admin notices stack in the admin. Good question on if there is a large number. Perhaps there should be up/down arrows to cycle through the notices?

I think that's a good idea and having a maximum size in this case makes sense.

Also, I'm no designer, so take the mocks I've supplied as just rough placeholders for what it could actually look like :)

No worries, let me have a play with things and upload some musings.

This ticket was mentioned in Slack in #core by westonruter. View the logs.


8 years ago

#7 @karmatosed
8 years ago

I've done a few mockups. I played around with how the notifications would stack. For this example I took the coloured notifications to make it obvious.

https://cldup.com/2uml_uIy1q.png

As far as stacking goes, I found that the arrows just didn't look great, so I have for now shown it with a scrollbar here:

https://cldup.com/hZk1Ois3AG.png

Potentially we could use existing pagination patterns such as pages and posts, but I feel this may be overkill and the simple scroll potentially works. Would probably be something to test actually in code.

Last edited 8 years ago by karmatosed (previous) (diff)

#8 @melchoyce
8 years ago

@westonruter Can you give some examples of errors that people would typically see in the Customizer? Would be good to get a feel for how long they can be.

#9 @westonruter
8 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.