WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15973 closed defect (bug) (fixed)

Searching, sorting and paginating don't clear messages

Reported by: nacin Owned by: scribu
Milestone: 3.1 Priority: high
Severity: normal Version: 3.1
Component: UI Keywords: has-patch commit
Focuses: Cc:

Description

Trash a post. Then search. You'll still see the "Item moved to the Trash." message.

Granted, in the case of trashing there is still an undo link. However, that's not going to be the case for many other actions. For example, plugin or theme activation/deactivation. I'm searching for a theme and paginating among many themes, and yet still see "2 themes enabled" staring me down. It's very distracting.

If this is not the proper UX -- I can't imagine it is -- then an ajax action (searching, sorting, paginating) needs to unhook div.updated and div.error. I'm not sure of a clearer or cleaner way to do it.

Maybe not a blocker for 3.1, but it is a regression. In 3.0 all of these actions resulted in page refreshes, clearing the slate. Here though, it doesn't, and it's really tough to follow a message that lingers.

(NB: It also probably should reset the pop state URL to remove whichever arguments are left, but it's too difficult to detect which arguments need to go, even just across our screens. We'd need to encapsulate the typical remove_querg_arg from wp_get_referer logic.)

Attachments (2)

15973.diff (422 bytes) - added by scribu 3 years ago.
15973.2.diff (431 bytes) - added by scribu 3 years ago.
Filter .inline too

Download all attachments as: .zip

Change History (11)

comment:1 scribu3 years ago

  • Owner set to scribu
  • Status changed from new to accepted

comment:2 nacin3 years ago

Potential side effect: We end up unhooking too many messages. Perhaps one by a plugin is designed to linger. I would argue they're using it wrong there, though.

comment:3 nacin3 years ago

Actually, if we simply use $('div.updated, div.error').not('.inline') to select them, then that gives plugins a way to implement persistent-like messages.

scribu3 years ago

comment:4 scribu3 years ago

  • Keywords has-patch added; needs-patch removed

comment:5 nacin3 years ago

Sweet. I like the new class. We should probably add .inline too, just due to the existing use case (despite only really being used on settings screens, rather than with list tables).

comment:6 scribu3 years ago

I don't think we should mix the two up.

Not sure what '.inline' stands for currently, anyway.

scribu3 years ago

Filter .inline too

comment:7 scribu3 years ago

Updated patch.

comment:8 nacin3 years ago

  • Keywords commit added; ux-feedback dev-feedback removed

Works great.

comment:9 ryan3 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [17132]) Clear messages when searching, sorting, paginating. Props scribu. fixes #15973

Note: See TracTickets for help on using tickets.