We now have an official API for displaying stuff in popups.
It would be over-nifty to display batch progress bars in a modal while keeping the page that triggered the batch in the background.

Challenges:
- It has to be progressive enhancement, of course (no JS = separate progress page, as currently)
- Batch API doesn't support canceling an ongoing batch, so the modal shouldn't have a "close" button
- The progress messages displayed by some existing batches right now can be longish, and can add new lines as the operations progress (e.g. simpletest, one line per test class that ran), meaning "maximum width" and "varying height"
- Not sure how to integrate with batches triggered by standalone scripts like install.php, update.php, that currently take care of displating the progress page themselves.

Any takers ?

Comments

yched’s picture

Issue tags: +JavaScript, +modal dialog

adding a couple tags

nod_’s picture

I'm not quite sure about that. What happens when people try to navigate away by clicking on some link on the underlying page?

yched’s picture

Sure, they can't be allowed to click away - but we do have modals, right ?

yched’s picture

Also, the advantage of a modal over the current standalone themed page would be that, specifically, users *can* currently click away through the toolbar, site logo, footer blocks...

Bojhan’s picture

Where are you proposing we add this?

yched’s picture

@Bojhan: well, I guess on any form that submits to a batch ?
A couple examples in core are:
- "Modules admin" submit if locale is enabled and site has more than one language (download and import of .po files)
- "Content admin" page, if submitting an operation (delete, publish...) on more than 10 nodes
- (for devs) Simpletest run page
- User account cancellation
- Rebuilding node access permissions

+ the standalone scripts, that are technically slightly different:
- install.php
- update.php

Not sure if the "modal" behavior should be hardcoded or optional (and whether opt-in or opt-out). But I don't think I see why a specific form that currently submits through a batch would want to avoid running its progress in a modal.

yched’s picture

Issue summary: View changes

more specific

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.