-
Notifications
You must be signed in to change notification settings - Fork 2
Releases: jarpex/spotlight-js
Spotlight JS 1.0.3 β Portrait Scaling Fix, Opening Animations & Security Hardening
1c50b19 Highlights
This release addresses critical rendering issues identified in v1.0.2, introduces polished visual transitions, and significantly hardens the build security. Key highlights include the resolution of the portrait image scaling bug, the shift to linear navigation (removing circular looping), and a comprehensive refactoring pass that further reduced the bundle size by 2.2%.
β οΈ Breaking Changes
- Linear Navigation: Image switching is no longer circular. Users can no longer swipe from the last image to reach the first (or vice versa). Navigation now has distinct start and end boundaries to improve stability and prevent scrolling side-effects.
Bug Fixes & Stability
-
Portrait Scaling (Resolved #10): Fixed the default scaling algorithm for vertical images. Portrait photos now fit perfectly within the viewport without cropping or excessive zooming.
-
Scroll Logic: Eliminated a side effect that caused infinite image scrolling under specific scaling conditions.
-
Touchpad Gestures: Corrected image swiping behavior on scaled views when using touchpad gestures, ensuring consistent navigation.
-
Mobile Layout: Resolved layout inconsistencies on the demo page for mobile devices (#17).
Visual & UX Improvements
-
Opening Animations: Implemented smooth entry animations when Spotlight opens.
-
Demo Page: Added a Dark Theme to the demo environment and improved overall responsive design.
Performance & Refactoring
-
Bundle Size Reduction: Achieved a 2.2% reduction in the minified bundle size through aggressive code deduplication and logic optimization.
-
Code Quality:
-
Extracted over 40 "magic numbers" into named constants for better readability.
-
Consolidated duplicate calibration and opacity logic into reusable helper functions.
-
Added comprehensive JSDoc to all critical internal and public methods.
-
-
Build Pipeline: Integrated
@rollup/plugin-replaceand@rollup/plugin-stripfor cleaner build artifacts and more efficient CSS class renaming.
Security (CodeQL)
-
Vulnerability Fixes: Addressed 7 security and quality alerts reported by CodeQL (#16).
-
Build Configuration: Enhanced CSS minification logic to properly escape characters, resolving high-severity string escaping vulnerabilities.
-
Policy: Updated security policy and clarified the vulnerability reporting process (#15).
Localization
-
Russian: Updated translations for improved clarity and accuracy.
-
Hindi: Reviewed and corrected translation strings.
applied
Known Issues
- Spotlight JS is forced to run in LTR mode, as support for RTL languages ββhas not yet been implemented
Final Notes
Spotlight JS 1.0.3 closes the loop on initial visual bugs, offering a fully stable experience for both landscape and portrait content. The focus now shifts towards expanding feature sets and further interaction refinements.
Assets 3
Spotlight JS 1.0.2 β Trackpad Support, Gesture Improvements, Minification Overhaul & Accessibility Enhancements
Highlights
This is the first official release of Spotlight JS, delivering a comprehensive set of interaction, performance, accessibility, and build-pipeline improvements.
The library now includes full trackpad support, natural scrolling calibration, improved gesture recognition, safer error handling, and aggressive bundle minification.
New Features
Trackpad Support & Natural Scrolling
- Full support for inverted / natural scrolling
- Input-modality detection (mouse vs. trackpad)
- Calibration dialog for scroll-direction alignment
- Smoother and more responsive vertical gesture handling
- Swipe-down-to-close with improved threshold
- Enhanced UI animations and feedback during calibration
Gestures & Interactions
- Improved pinch and drag handling
- Zoom stabilization and Safari trackpad pinch support
- Better swipe detection and swipe-intent logic
- Constraints to prevent excessive translation
- Adjusted gesture thresholds for more natural behavior
Demo & UI
- New demo page with gallery and article modes
- Updated controls documentation
- Improved mobile layout styles
Error Handling & Debugging
- Error-capturing system to store and retrieve runtime issues
- Optional debug mode with detailed console warnings
- Safer localStorage access and fallback logic
- Improved pointer-capture error reporting
Accessibility Enhancements
- Focus trapping in calibration dialog
- ARIA attributes for screen readers
- Live region announcements for calibration progress
- Improved contrast and visibility of progress indicators
- Clearer instructions in calibration steps
Refactoring & Maintainability
- Major refactor of wheel-event pipeline
- Constants extracted for thresholds and timing
- Shared logic split into dedicated methods
- Simplified key-navigation and zoom handling
- Image collection replaced with Map for performance
- Default initialization for trackpad-related state
Build System & Minification
- Integrated html-minifier-terser for inline HTML
- Enabled advanced Terser optimization passes
- Automatic renaming of CSS classes and IDs
- Combined HTML + JS + selector compression pipeline
- Added safe build mode for compatibility
- Consistent and predictable post-processing
- Overall bundle size significantly reduced
Chores & Meta
- Bumped version to 1.0.2
- Updated package description
- Applied temporary direction: ltr workaround for upcoming RTL support
- README and demo improvements
- Strict linting rules added and applied
Known Issues
- Spotlight JS is forced to run in LTR mode, as support for RTL languages ββhas not yet been implemented
- The default scaling for portrait images is not entirely correct, but this should not interfere with users
Final Notes
This release establishes Spotlight JS 1.x as a stable, production-ready viewer with robust trackpad support, enhanced interactions, and an optimized build pipeline.