Make WordPress Core

Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#17703 closed enhancement (fixed)

Decrement update count bubbles when you update things

Reported by: mitchoyoshitaka's profile mitchoyoshitaka Owned by: koopersmith's profile koopersmith
Milestone: 3.9 Priority: normal
Severity: trivial Version:
Component: Upgrade/Install Keywords: has-patch dev-feedback
Focuses: administration Cc:

Description

This can be done via some JavaScript, including for the bulk updater case, and it looks pretty cool. :) Video attached, as well as a first-pass patch.

Attachments (5)

17703.2.diff (18.8 KB) - added by mitchoyoshitaka 13 years ago.
Patch v1.1, forgot to add update.dev.js
17703.3.diff (7.5 KB) - added by mitchoyoshitaka 13 years ago.
Patch to fix patchrot, as #17694 landed. Should apply cleanly to trunk.
17703.diff (8.5 KB) - added by mitchoyoshitaka 13 years ago.
Was missing a file
17703-04.patch (8.7 KB) - added by gcorne 11 years ago.
17703-05.patch (8.3 KB) - added by gcorne 11 years ago.

Download all attachments as: .zip

Change History (14)

@mitchoyoshitaka
13 years ago

Patch v1.1, forgot to add update.dev.js

@mitchoyoshitaka
13 years ago

Patch to fix patchrot, as #17694 landed. Should apply cleanly to trunk.

@mitchoyoshitaka
13 years ago

Was missing a file

#2 @mitchoyoshitaka
13 years ago

  • Owner changed from mitchoyoshitaka to koopersmith
  • Status changed from new to reviewing

#3 @nacin
11 years ago

  • Component changed from Administration to Upgrade/Install
  • Focuses administration added

@gcorne
11 years ago

#4 @gcorne
11 years ago

  • Keywords dev-feedback added

This seems like a good idea, so I went ahead and created a fresh patch (see 17703-04.patch). The approach is a little different from Mitcho’s. Instead of offsetting the existing counts, an ajax call is triggered that pulls updated counts. For situations where the requests where the upgrades run is in an iframe, window.postMessage is used to send a message to the parent window that triggers the count updating.

One benefit of using an ajax handler is that it opens the door to refreshing the counts asynchronously at other times so that the status is more current without impacting the response time of admin page loads.

#5 @samuelsidler
11 years ago

  • Milestone changed from Awaiting Review to 3.9

@gcorne
11 years ago

#6 follow-up: @gcorne
11 years ago

After discussing a bit with @nacin, we discussed an alternative approach that forgoes the ajax call to fetch updated data and instead just decrements the existing counts via javascript. Since it is quite unlikely that a install with have over 1,000 plugins, we don't need to worry about localizing the number, which was one of the main reasons for the ajax call.

17703-05.patch is an implementation of this approach. The patch also removes the title attribute for the update count, which I am not 100% sure we want to do, but it was another aspect that we discussed.

#7 in reply to: ↑ 6 @SergeyBiryukov
11 years ago

Replying to gcorne:

The patch also removes the title attribute for the update count, which I am not 100% sure we want to do, but it was another aspect that we discussed.

The pending comment count would still have a title attribute. It seems inconsistent to remove the title just for updates, so I'd suggest keeping it for now.

#8 @nacin
11 years ago

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

In 27280:

Decrement update count bubbles as plugins/themes are updated, live.

props gcorne, mitchoyoshitaka.
fixes #17703.

#9 @nacin
11 years ago

In 27281:

Remove title attributes on the fly when [27280] makes them incorrect. see #17703.

Note: See TracTickets for help on using tickets.