Skip to content

feat: per-domain element hiding#86

Merged
omachala merged 13 commits intomainfrom
feat/per-domain-element-hiding
Feb 13, 2026
Merged

feat: per-domain element hiding#86
omachala merged 13 commits intomainfrom
feat/per-domain-element-hiding

Conversation

@omachala
Copy link
Owner

@omachala omachala commented Feb 10, 2026

Summary

  • Add per-domain element hiding: hide distracting elements (cookie banners, chat widgets, dev toolbars) once per domain, applied across all screenshots
  • New hiddenElements config field in heroshot.config.json maps hostname → CSS selectors
  • Editor UI: hide mode button in sidebar, red highlight overlay, hidden elements list with unhide
  • CLI capture: domain-level hidden elements applied before screenshot capture (reuses existing executeHide)
  • Fixed bug: $effect used document.querySelectorAll() which can't handle Playwright-style selectors — added queryElements() via SelectorGenerator.query()

@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 27e225e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/sync/actions/hide.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Ondrej Machala added 5 commits February 11, 2026 17:33
Add the ability to hide elements by domain. Hidden elements are stored
in heroshot.config.json under `hiddenElements` (hostname → CSS selectors)
and applied during both interactive editing and CLI sync capture.

Editor UI: hide mode button (eye-slash), red hover highlight, collapsible
"Hidden" list in sidebar with per-selector unhide buttons.

Also fixes a bug where Toolbar used document.querySelectorAll for
Playwright-style selectors (text=, role=) — now uses queryElements
from selectorGenerator.

Includes 9 Playwright e2e tests covering hide/unhide flow, events,
pre-loaded elements, and mode toggling.
- EditorBar: hide mode button + hidden elements list with unhide
- ElementPicker: red highlight in hide mode, auto-deactivate after hide
- Toolbar: state management, DOM application via queryElements()
- SelectorGenerator: public query() method for non-CSS selectors
- CLI: schema, types, injection, config persistence, capture integration
- E2e tests: 9 tests covering hide/unhide/persistence/mode toggling
- Updated visual regression snapshots for new hide button
- Extract handleEvent into separate handleEvent.ts to stay under max-lines
- Add changeset for minor version bump
@omachala omachala force-pushed the feat/per-domain-element-hiding branch from fb32811 to 5c45331 Compare February 11, 2026 17:33
Ondrej Machala added 8 commits February 12, 2026 20:40
Add outputDirectory, outputFormat, jpegQuality, and workers fields
to the Settings modal alongside existing browser settings. Values
are read from config on open and saved back on close.
Remove ignoreSnapshots flag so e2e snapshots are compared on every CI
run. Add manual workflow to update editor snapshots on any branch.
Update 3 stale settings snapshots.
CI runs in Docker container with different font rendering than host,
causing 11% pixel diff on visual snapshots. Re-enable ignoreSnapshots
for CI environment. Pin GitHub Actions to full commit SHAs to resolve
SonarCloud security hotspot.
@sonarqubecloud
Copy link

@omachala omachala merged commit 9f0d8f5 into main Feb 13, 2026
12 checks passed
@omachala omachala deleted the feat/per-domain-element-hiding branch February 13, 2026 09:13
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.

1 participant