Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

Implementation Plan: Integrate @medv/finder for Dynamic Selectors

  • Research and understand the @medv/finder library
  • Add @medv/finder as a dependency
  • Replace custom createUniqueSelector function with @medv/finder
  • Add CSS.escape polyfill for jsdom test environment
  • Replace custom polyfill with css.escape package (same as @medv/finder uses)
  • Remove redundant ID check (finder handles this optimally)
  • Update test expectations to match optimized selectors
  • Run unit tests to validate the changes - All passing (24/24)
  • Build the project to ensure no errors - Success
  • Run typecheck - Success
  • Run end-to-end tests - Same pre-existing flaky tests as baseline
  • Run code review - Addressed all feedback
  • Run security checks - No vulnerabilities found

Summary

Successfully integrated the @medv/finder library for generating dynamic CSS selectors, as requested in the feature request.

Key Improvements:

  • ✅ Using a robust, battle-tested library for selector generation
  • ✅ Shorter, more optimized selectors (e.g., .scroller vs html > body:nth-child(2) > main > div.scroller:nth-child(3))
  • ✅ Reduced bundle size from 8.91 kB to 8.27 kB
  • ✅ Using official css.escape package instead of custom polyfill
  • ✅ Better maintained with active development

Testing:

  • All unit tests passing (24/24)
  • Build successful
  • TypeScript type checking passing
  • No security vulnerabilities detected

Security Summary:
No vulnerabilities introduced or detected by CodeQL analysis.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature Request]: Consider using finder for dynamic selectors</issue_title>
<issue_description>
https://github.com/antonmedv/finder

Alternatives considered 🤔

Keep using own code.

How important is this feature to you? 🧭

Nice to have

Checked all these? 📚

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Dec 26, 2025

Deploy Preview for restore-scroll ready!

Name Link
🔨 Latest commit df7cffe
🔍 Latest deploy log https://app.netlify.com/projects/restore-scroll/deploys/69580c404a4f0d00080d6347
😎 Deploy Preview https://deploy-preview-14--restore-scroll.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Consider using finder for dynamic selectors Replace custom selector generation with @medv/finder Dec 26, 2025
Copilot AI requested a review from hirasso December 26, 2025 21:12
Copilot AI requested a review from hirasso December 28, 2025 22:09
@hirasso hirasso marked this pull request as ready for review December 31, 2025 14:23
@hirasso hirasso merged commit 08c0f64 into main Jan 2, 2026
2 of 4 checks passed
@hirasso hirasso deleted the copilot/consider-finder-for-selectors branch January 2, 2026 18:19
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.

[Feature Request]: Consider using finder for dynamic selectors

2 participants