Shortcut (or small link) for "Select all" feature would be very helpfull.

Example: I use new filter to show only files uploaded to current post and now I want to select all these files at once and insert them into post. I do not want to click 15-times. In this case it would be also fine to insert gallery shortcode without ids to enable automatically displaying all new images uploaded to current post (as it was in current WordPress version).

Thanks, lessbloat for posting 22502.diff​. I tested it on Firefox 17, Chrome 23 and Safari 6.0.2 on Mac OS 10.8.2 and found that it worked some of the time for me. I experienced the same results in each of these browsers.

When I first entered the media modal, "Upload Files" was selected (as shown in 22502_screenshot.png). When this, or any of the items in the left column were selected, the esc function worked for me. When I selected some uploaded images, or had nothing at all selected, this patch did not work.

This patch worked well in allowing me to use the "esc" key to exit the media modal except in a few limited cases. In all the browsers I tested, I was not able to use the "esc" key to exit immediately after clicking to edit a gallery that had already been created from the post window. When working within the media modal, I found a few additional cases where it did not work, presumably because I lost focus, in Firefox and Opera. The cases are recorded below.

In "Upload Files"

After uploading a new image - Firefox, Opera

In "Media Library"

After clicking "Delete Permanently" - Firefox, Opera

After clicking "Edit", and then "Return to Library" - Firefox, Opera

After clicking "Clear" or deselecting all images - Firefox

After clicking "Create a new gallery" - Firefox, Opera

After clicking "Create a new gallery", and then "Cancel Gallery" - Firefox, Opera

In "From URL"

After clicking a button under "Align" - Firefox

Other

After clicking on the media modal background - Firefox, Opera

These don't seem like major cases, but I wanted to create a record of them. Overall, this patch seems to work well.

That focus style is *much* nicer. We probably should make sure it's also detectable on the already gray/blue attachments. This is a great start.

We should be fixing the focus issues in their corresponding views.

We generally should not be calling $( '.media-menu .active' ).focus();, as it is a hack around a problem and generally doesn't fix the issue in all use cases. In the case that it's used in this past patch, it will only work for insert into post workflows.

Selecting the first image on clear is a cross-view operation, and will cause the user to lose their existing context. The proper way to solve this (which would solve most of the other bugs mentioned above) is figuring out how to maintain focus best across views.