Closed Bug 1659624 Opened 4 years ago Closed 4 years ago

Close the new print UI after the user clicks the "Print" button (or after "Save" for Save to PDF)

Categories

(Toolkit :: Printing, enhancement, P1)

enhancement

Tracking

()

VERIFIED FIXED
82 Branch
Tracking Status
firefox81 --- verified
firefox82 --- verified

People

(Reporter: jwatt, Assigned: emmamalysz)

References

Details

(Whiteboard: [print2020_v81])

Attachments

(2 files, 2 obsolete files)

Users probably don't want to have to click the "Cancel" button after clicking the "Print" button in order to close the doorhanger. It should really close automatically (this is what Chrome does FWIW).

The wrinkle here is that, as currently implemented, the doorhanger needs to stay open long enough for the print to complete, otherwise the print preview document could be killed mid-print. To eliminate the need for that, the platform code should probably clone the print preview document into a hidden tab, print from that, and auto-close that tab itself.

This seems like a must-have for shipping (it's a very awkward experience without it), and sounds like the majority of the work rests on platform.

Priority: -- → P1

Sean and I discussed this, but just in case it isn't clear for others, I filed this against Toolkit and only mentioning the possible platform work to improve things for completeness. I don't think the change in behavior requested in this bug requires the platform work (that's a UX question though), and in any case I don't think we can do the platform work in the v81 beta timeline. However, the implementation details of that platform work would be closely related to Emilio's window.print work, so Emilio should correct me about that if he thinks it's possible (I think it would involve creating and cloning to a hidden tab that the platform code would automatically close itself after the print completed).

Flags: needinfo?(emilio)

Why would creating a new hidden tab of sorts be required? So, platform should have the capability to notifying at the appropriate time, I think. And I think we already do that.

Right now when you schedule a print of the print preview document we actually create a separate print object with separate clones which are kept alive separately as well, by the content viewer etc. So I think that should mostly just work.

We of course need to change this setup to avoid recloning so much (that's effectively bug 1636728), but I don't think the document dying mid-print is a concern here? What is not being kept alive properly right now Jonathan?

Flags: needinfo?(emilio) → needinfo?(jwatt)

Just bumped into this and I agree that this is a must have. Currently, the user has no feedback if the print was successful or not. If the dialog remains open, that seems like something went wrong. However, if I hit "save" again (in case of saving to PDF), I get the error "Some printing functionality is not currently available" (see screenshot).

(I was about to file a bug on this same issue, as it felt really strange to me.)

I think that when the Print or Save action is clicked, the dialog should ideally remain open, with a progress spinner running in the middle of the preview pane and the Print/Save button disabled, until we've finished processing the job (which doesn't mean the printer driver is done with it, it may still be queued), and then the dialog should go away. That would give the user feedback (for non-instantaneous jobs) that something is happening, which we currently seem to lack.

FWIW, I tried clicking Cancel to dismiss the dialog immediately after starting a really large (800+ pages) Save as PDF job, and also closed the tab, and the job still seemed to complete just fine.

I also just ran into this issue, but with the system print dialog. After printing a page by going into the tab-modal dialog, and then clicking through to the system dialog and printing there, the tab-modal dialog remained open. In my opinion, it should also close in this case, at least where printing has been performed.

See Also: → 1660665

(In reply to John from comment #7)

I also just ran into this issue, but with the system print dialog. After printing a page by going into the tab-modal dialog, and then clicking through to the system dialog and printing there, the tab-modal dialog remained open. In my opinion, it should also close in this case, at least where printing has been performed.

Preferably, the tab modal dialog should close immediately upon opening the system dialog (at least this is what we had written down in our original requirements). So I've filed bug 1660665 for that.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

Why would creating a new hidden tab of sorts be required?

If the doorhanger goes away, then so does the docshell parent for the new UI's print preview browser. Since we currently hang the print static clone for final print off that same owner, it will lose its owner as soon as the doorhanger closes, and it seemed likely that might do bad things. Maybe I'm wrong. But that was my thinking as to why we'd need to create a hidden tab to own the final print document in order to immediately close the doorhanger when the user hits the Print button.

Flags: needinfo?(jwatt)

Comment on attachment 9171828 [details]
Bug 1659624, close print UI if user submits the form.

Revision D88096 was moved to bug 1660665. Setting attachment 9171828 [details] to obsolete.

Attachment #9171828 - Attachment is obsolete: true
Assignee: nobody → emalysz
Status: NEW → ASSIGNED
Attachment #9171828 - Attachment description: Bug 1659624, close print UI if user chooses to print using system dialog → Bug 1659624, close print UI if user submits the form.
Attachment #9171828 - Attachment is obsolete: false
Attachment #9173140 - Attachment is obsolete: true

Comment on attachment 9171828 [details]
Bug 1659624, close print UI if user submits the form.

Revision D88096 was moved to bug 1660665. Setting attachment 9171828 [details] to obsolete.

Attachment #9171828 - Attachment is obsolete: true
Pushed by mstriemer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bb774bb37ac2
close the print UI when the user chooses to print or save r=mstriemer

Comment on attachment 9173733 [details]
Bug 1659624, close the print UI when the user chooses to print or save

Beta/Release Uplift Approval Request

  • User impact if declined: The printing experience will not be great, and the user will have to cancel the dialog themselves.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: 1. Open firefox with print.tab_modal.enabled turned on
  1. Print a page
  2. Notice the print preview window closes
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): No string changes
  • String changes made/needed: n/a
Attachment #9173733 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Until bug 1636728 and the other platform patches that build on top of that bug are uplifted, this may behave badly on Beta.

Looks like we're uplifting those now.

Comment on attachment 9173733 [details]
Bug 1659624, close the print UI when the user chooses to print or save

Approved for 81.0b6.

Attachment #9173733 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]
Regressions: 1663121
Regressions: 1663124

Hello,

Confirming this as verified fixed on 82.0a1 (2020-09-20) and 81.0 - pref'd on. Confirmed using Windows 10x64, macOS 10.15 and Ubuntu 20.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: