Migrate QR code scanner to ZXing library #315
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replaced the custom QR scanner library with the industry-standard ZXing library (
@zxing/library) as requested in #308. ZXing is a widely-used, well-maintained barcode scanning library that provides robust QR code detection capabilities.Changes
Library Migration
qr-scannerlibrary files fromapp/static/lib/app/static/lib/zxing.min.js(downloaded from npm package@zxing/library)Updated Files
app/templates/scanner.html: Migrated dues scanner to use ZXing'sBrowserQRCodeReaderAPIapp/templates/admin_searcher.html: Updated script reference to ZXing libraryapp/static/admin.js: Converted admin QR scanner to use ZXing APItests/test_static.py: Updated to reference the new ZXing library fileAPI Changes
The migration involved updating the QR scanner initialization and usage:
Before (old library):
After (ZXing):
Preserved Functionality
Benefits
Testing
The changes can be tested by:
Fixes #308
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.