fix: Improve snapshot visibility checking and error handling#37
Merged
Conversation
This commit fixes three critical bugs in the snapshot functionality:
## High Priority
- **Fix visibility checking with ancestor chain**: isVisible() now checks
all ancestors up to documentElement, preventing elements inside hidden
parents (display:none, visibility:hidden) from appearing in snapshots
- **Fix opacity parsing**: Changed from string comparison to parseFloat()
to properly handle opacity values like '0', '0.0', '0.00'
## Medium Priority
- **Fix CSS selector error handling**: Invalid selectors now return clear
error messages ("Invalid selector syntax") instead of generic errors
## Tests
- Added 4 new integration tests covering all edge cases
- Added 2 new HTML fixtures (visibility.html, selector.html)
- All 279 tests passing
## Version
- Bumped version to 0.6.1
- Updated CHANGELOG.md with release notes
Fixes #36
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
imqqmi
approved these changes
Feb 5, 2026
imqqmi
left a comment
There was a problem hiding this comment.
I've skimmed through and it looks good!
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.
Closes #36
Fixed Issues
HIGH Priority:
0,0.0,0.00properly withparseFloat()MEDIUM Priority:
Tests
Review Request
@imqqmi - Would you mind reviewing since you reported these bugs? Thanks! 🙏
Version: 0.6.1