Skip to content

[GENERIC viewer] Re-initialize the viewer-toolbar ColorPicker for each PDF document #19372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Snuffleupagus
Copy link
Collaborator

Steps to reproduce this in master:

  1. Open https://mozilla.github.io/pdf.js/web/viewer.html
  2. Use the "Open"-button (in the secondaryToolbar), or drag-and-drop, to load another PDF document.
  3. Enable the highlight-editor.
  4. Try to pick a new colour.

Note how it's no longer possible to change the default highlight-colour.
The reason for this is that we're only initializing the viewer-toolbar ColorPicker once, which doesn't work since every PDF document gets its own AnnotationEditorUIManager-instance. To address this we simply need to re-initialize the viewer-toolbar ColorPicker, and note that this patch won't affect the Firefox PDF Viewer.

…ach PDF document

Steps to reproduce this in `master`:
 1. Open https://mozilla.github.io/pdf.js/web/viewer.html
 2. Use the "Open"-button (in the secondaryToolbar), or drag-and-drop, to load another PDF document.
 3. Enable the highlight-editor.
 4. Try to pick a new colour.

Note how it's no longer possible to change the default highlight-colour.
The reason for this is that we're only initializing the viewer-toolbar `ColorPicker` *once*, which doesn't work since every PDF document gets its own `AnnotationEditorUIManager`-instance. To address this we simply need to re-initialize the viewer-toolbar `ColorPicker`, and note that this patch won't affect the Firefox PDF Viewer.
@Snuffleupagus Snuffleupagus force-pushed the mainHighlightColorPicker-toolbar-init branch from dd31967 to 342b5e2 Compare January 23, 2025 15:53
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Jan 23, 2025
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/f62181344e02cdf/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/f62181344e02cdf/output.txt

Total script time: 0.85 mins

Published

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/68b7f86d0768b10/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.193.163.58:8877/8e3661449b121ff/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/68b7f86d0768b10/output.txt

Total script time: 11.80 mins

  • Integration Tests: FAILED

@Snuffleupagus
Copy link
Collaborator Author

/botio-linux integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/c9b539fd0e92051/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/c9b539fd0e92051/output.txt

Total script time: 11.18 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/8e3661449b121ff/output.txt

Total script time: 25.75 mins

  • Integration Tests: FAILED

@Snuffleupagus Snuffleupagus merged commit 30fa7c3 into mozilla:master Jan 23, 2025
9 checks passed
@Snuffleupagus Snuffleupagus deleted the mainHighlightColorPicker-toolbar-init branch January 23, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants