Skip to content

Comments

fix: Improve snapshot visibility checking and error handling#37

Merged
freema merged 2 commits intomainfrom
fix/snapshot-visibility-and-error-handling
Feb 6, 2026
Merged

fix: Improve snapshot visibility checking and error handling#37
freema merged 2 commits intomainfrom
fix/snapshot-visibility-and-error-handling

Conversation

@freema
Copy link
Owner

@freema freema commented Feb 4, 2026

Closes #36

Fixed Issues

HIGH Priority:

  • ✅ Visibility now checks ancestor chain - elements inside hidden parents correctly excluded
  • ✅ Opacity parsing fixed - handles 0, 0.0, 0.00 properly with parseFloat()

MEDIUM Priority:

  • ✅ Clear CSS selector error messages instead of generic errors

Tests

  • 4 new integration tests added
  • All 279 tests passing

Review Request

@imqqmi - Would you mind reviewing since you reported these bugs? Thanks! 🙏


Version: 0.6.1

freema and others added 2 commits February 4, 2026 13:57
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>
Copy link

@imqqmi imqqmi left a comment

Choose a reason for hiding this comment

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

I've skimmed through and it looks good!

@freema freema merged commit a4f9a1b into main Feb 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get DOM objects when using Vue and Livewire

2 participants