Closed Bug 2080269 Opened 1 month ago Closed 1 month ago

In PDF Viewer left sidebar, when clicking a checkbox, the sidebar-header-area goes through a series of changes (gaining checkbox *before* "1 selected")

Categories

(Firefox :: PDF Viewer, defect)

defect

Tracking

()

VERIFIED FIXED
160 Branch
Tracking Status
firefox160 --- verified
firefox161 --- verified

People

(Reporter: dholbert, Unassigned)

References

Details

Attachments

(3 files, 1 external file)

STR: Same as bug 2080263, but pay close attention to the title area (where it says "Select pages") as you check/uncheck the checkbox.

  1. Load any PDF in Firefox Nightly
  2. Click the left-sidebar button in the PDF UI (the button at the far left edge of the PDF toolbar)
  3. Check one of the checkboxes next to a page in the sidebar and watch the "Select pages" title-text carefully
  4. Uncheck that checkbox.
  5. Repeat steps 3-4.

What is the expected behavior?

  • Title area should have an atomic rendering change.

What went wrong?

  • Title area has two successive rendering changes (flickering one intermediate unwanted rendering)
  • Specifically: the [-] checkbox appears first, next to "Select pages". And then, a moment later, "Select pages" changes to say "1 selected"

(Unlike bug 2080263, this bug goes back further; this bug affects Nightly, and it can also be seen in Firefox 156 in the bottom half of my screencast https://bug2080263.bmoattachments.org/attachment.cgi?id=9656976 )

Here's a screenshot taken from my screencast https://bug2080263.bmoattachments.org/attachment.cgi?id=9656976 at around t=16s

This shows the intermediate rendering where the checkbox has appeared (and pushed over the "Select pages" label), just before that label has changed to say "1 selected".

Here's a screenshot taken from my screencast https://bug2080263.bmoattachments.org/attachment.cgi?id=9656976 at around t=7s (when this issue is triggered in Nightly in the top half of the screencast), showing this intermediate rendering as it exists in current Nightly.

We hit the same issue when you uncheck a checkbox, too -- there's an intermediate rendering where the title area's checkbox disappears but the "1 selected" label is still present (and that label moves over into the space that was vacated by the checkbox, which to a user just looks like a brief "what was that" flicker).

Here's a screenshot of that rendering from t=12s in my Nightly 160:
https://bug2080263.bmoattachments.org/attachment.cgi?id=9656976

In viewer.mjs, PDFThumbnailViewer#updateStatus("select") only sets data-l10n-id/data-l10n-args on #viewsManagerStatusActionLabel, while #toggleBar (#9739-9765) toggles hidden on the deselect checkbox and the new badge synchronously in the same task. Fluent only rewrites the label text after a refresh tick plus an async formatMessages (L10nMutations.cpp), so the checkbox change paints a frame or more before "1 selected" does, and the reverse happens on uncheck.

Fix: In upstream pdf.js (web/pdf_thumbnail_viewer.js, since viewer.mjs is vendored), pass l10n to PDFThumbnailViewer and have the "status" path await l10n.translateOnce(label) before toggling the button and badge, with a generation counter so rapid toggles drop stale updates, following showFeaturesNotification (#17811), which already awaits translation before unhiding. The selectPage helper in browser_pdfjs_organize_telemetry.js is a good base for a test asserting the deselect button only becomes visible once the label reads "1 selected".

Suggested severity: S4. A one-frame cosmetic flicker in the sidebar header during page selection, with no functional impact.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.

Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.

(via GitHub webhook, authenticated as shared-secret)

Depends on: 2080665
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
Duplicate of this bug: 2080263
Severity: -- → S3
QA Whiteboard: [qa-triage-done-c161/b160] [qa-ver-needed-c161/b160]
Flags: qe-verify+

I was able to reproduce the issue on Win11x64 using Firefox build 156.0a1(20260820214844).
Verified as fixed on Win11x64 / Mac 27 using Firefox build 161.0a1 and 160.0b4

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triage-done-c161/b160] [qa-ver-needed-c161/b160] → [qa-triage-done-c161/b160] [qa-ver-done-c161/b160]
Flags: qe-verify+
QA Contact: mchiorean
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: