Add image lightbox opt-in and PDF lightbox support for cheatsheets#290
Open
gregswinehart wants to merge 4 commits into
Open
Add image lightbox opt-in and PDF lightbox support for cheatsheets#290gregswinehart wants to merge 4 commits into
gregswinehart wants to merge 4 commits into
Conversation
Major improvements to image lightbox functionality: **Accessibility:** - Add ARIA dialog role and modal attributes - Implement focus trap to keep focus within lightbox - Add screen reader announcements for state changes - Focus management: move to close button on open, restore on close - Add title attribute to PDF iframe **Error Handling:** - Loading indicator with spinner for PDFs - Error message for failed PDF loads - 10-second timeout for slow loads - Cross-browser iframe stopping on close - Hugo build warnings for missing PDF/thumbnail files **Mobile Support:** - Responsive viewport sizing (95vw mobile, 90vw desktop) - Touch panning support for images - Pinch-to-zoom enabled via touch-action CSS **Code Quality:** - Extract magic numbers to named constants - Add helper function to reduce duplication - Fix memory leak: properly clear PDF load timeout - Reset image transform on close - Add explanatory comments for complex logic - Consistent error handling across PDF/thumbnail lookups **Security:** - Add sandbox attribute to PDF iframe (allow-same-origin allow-scripts) **Animation:** - Separate animations for images (zoom) vs iframes (fade) - Better cross-browser support for PDF transitions Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Each thumbnail now links to its corresponding page in the PDF using the #page=N fragment. Removed sandbox attribute from PDF iframe to allow same-origin PDF loading. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
✅ Deploy Preview for posit-open-source canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
lightbox: truefrontmatterFeatures
Lightbox
Code Copy Button
Test plan
🤖 Generated with Claude Code