Skip to content

Multi tool select buttons bug #3404

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

Merged
merged 7 commits into from
Apr 28, 2025

Conversation

JoseQuintas2003
Copy link
Contributor

Description of Changes

Changes:

  • In the multitool page, the behavior of the "Select/Deselect All" buttons was changed so that if no pages are selected, then the "Deselect All" button is disabled, and if all pages are selected, then the "Select All" button is disabled.
  • These buttons will also appear if the "Page Select" is turned on, either by pressing the "Page Select" button or manually selecting one page.
  • Furthermore, a bug that caused the pages to remain selected when "Page Select" is off was also fixed

Why the changes were made:

  • The multitool did not allow the "Select All" or "Deselect All" button to appear simultaneously. The multitool was relying on a toggle mechanic for the Page Selection and this could prevent the user from selecting or deselecting all pages as intended, if they manually select/deselect one or more pages.

Other challenges:

  • No particular challenges encountered

Relevant Screenshots:

Screenshot_1
Fig. 1 - Only "Select All" button appears when Page Select is turned on, since no pages are selected

Screenshot_2
Fig. 2 - Both "Select All" and "Deselect All" buttons appear when one or more, but not all pages are selected

Screenshot_3
Fig. 3 - Only "Deselect All" button appears when all pages are selected

Screenshot_4
Fig. 4 - When Page Select is turned off, both "Select All" and "Deselect All" buttons disappear and all pages are deselected

Closes #3206


Checklist

General

Documentation

UI Changes (if applicable)

  • Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • I have tested my changes locally. Refer to the Testing Guide for more details.

…ctly

Changed Page Select button so that both Select/Deselect All buttons can show up at the same time. Also made it so that Select All button does not show up when all pages are selected, and Deselect All button does not show up when no pages are selected
Selected Pages were not being deselected after Page Select is turned off
@Copilot Copilot AI review requested due to automatic review settings April 23, 2025 10:22
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Bug Something isn't working labels Apr 23, 2025
@github-actions github-actions bot added the Front End Issues or pull requests related to front-end development label Apr 23, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the multi tool select buttons bug by updating the behavior of the "Select All" and "Deselect All" buttons and fixing a bug where pages remained selected when the Page Select was turned off.

  • Updated the button's onclick handlers in multi-tool.html to correctly trigger selection/deselection functions.
  • Introduced and bound a new toggleDeselectAll method in PdfContainer.js while refactoring the selection logic.
  • Modified updateSelectedPagesDisplay in PdfContainer.js to adjust button visibility based on current selection states.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/main/resources/templates/multi-tool.html Changed onclick handler for the deselect button to call toggleDeselectAll.
src/main/resources/static/js/multitool/PdfContainer.js Added toggleDeselectAll and refactored select/deselect logic and UI updates.

@ConnorYoh
Copy link
Contributor

/deploypr

@stirlingbot
Copy link
Contributor

stirlingbot bot commented Apr 23, 2025

🚀 PR Test Deployment

Your PR has been deployed for testing!

🔗 Test URL: http://185.252.234.121:3404
Security Disabled

This deployment will be automatically cleaned up when the PR is closed.

Copy link
Contributor

@ConnorYoh ConnorYoh left a comment

Choose a reason for hiding this comment

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

Stirling-PDF.PR.3404.-.PDF.Multi.Tool.-.Google.Chrome.2025-04-23.13-29-22.mp4

Hi @JoseQuintas2003, Looks like some great progress. In the video above you can see that the selectall button remains present after turning off selected pages. Would you be able to correct this?

Also:

Stirling-PDF.PR.3404.-.PDF.Multi.Tool.-.Google.Chrome.2025-04-23.13-38-38.mp4

It looks like after you move some pages the deselectAll button never reappears. Would you be able to look into this?

@JoseQuintas2003
Copy link
Contributor Author

Hey there, great to receive some feedback on my work so far. I'm surprised I didn't notice these bugs, but I suppose it's normal some things might have gone unnoticed. I'll begin making the corrections asap. Thank you for your detailed feedback.

Deselect All button no longer appears after Page Select is turned off
Deselect All button no longer stays invisible after Page Move
Changed function names for better readibility
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 23, 2025
@JoseQuintas2003
Copy link
Contributor Author

Hey there once more @ConnorYoh. I believe I have solved the problems you mentioned in these 3 commits. I hope nothing has escaped me this time, but if there's anything I can help with or improve, then just let me know. Talk to you soon!

@ConnorYoh
Copy link
Contributor

/deploypr

@stirlingbot
Copy link
Contributor

stirlingbot bot commented Apr 24, 2025

🚀 PR Test Deployment

Your PR has been deployed for testing!

🔗 Test URL: http://185.252.234.121:3404
Security Disabled

This deployment will be automatically cleaned up when the PR is closed.

Copy link
Contributor

@ConnorYoh ConnorYoh left a comment

Choose a reason for hiding this comment

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

Hi @JoseQuintas2003 Thanks for the changes, looks like you have fixed the bugs however the selectAll button is no longer functioning. I believe its because window.selectAll is defined twice, once as a function and once as a Boolean.(line 77 and set within the file multiple times but is never used) I think we can now remove the Boolean as you have replaced the need for it.

Stirling-PDF.PR.3404.-.PDF.Multi.Tool.-.Google.Chrome.2025-04-24.10-10-44.mp4

@JoseQuintas2003
Copy link
Contributor Author

Hey there @ConnorYoh. So sorry I missed that. It seems its a simple solution as you suggested, I'll take care of it.

@JoseQuintas2003
Copy link
Contributor Author

@ConnorYoh its done. Hopefully this clears everything. Thanks for the help. I apologize if this took longer than necessary.

@ConnorYoh
Copy link
Contributor

/deploypr

@stirlingbot
Copy link
Contributor

stirlingbot bot commented Apr 28, 2025

🚀 PR Test Deployment

Your PR has been deployed for testing!

🔗 Test URL: http://185.252.234.121:3404
Security Disabled

This deployment will be automatically cleaned up when the PR is closed.

Copy link
Contributor

@ConnorYoh ConnorYoh left a comment

Choose a reason for hiding this comment

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

No Apologies necessary, thank you for your efforts and contributing it is really appreciated.

@Frooodle Frooodle merged commit a1118b8 into Stirling-Tools:main Apr 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Front End Issues or pull requests related to front-end development size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Multitool select/deselect all button not showing correctly
5 participants