Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tanushbhootra576
Copy link

@tanushbhootra576 tanushbhootra576 commented Oct 23, 2025

Agents were clicking invisible duplicated slides from nuka-carousel when wrapAround=true,
because cloned elements marked with inert="true" and aria-hidden="true" were still
being detected as interactive. This caused invalid click coordinates and missed actions.

Added visibility filtering to skip elements that are inert, aria-hidden, have zero size,
or are positioned off-screen before interaction.


Summary by cubic

Stops clicks on cloned, hidden slides in carousels (e.g., nuka-carousel with wrapAround) by filtering inert, aria-hidden, zero-size, and fully offscreen elements from clickable detection. Ensures agents click only visible, valid targets.

  • Bug Fixes
    • Skip elements with inert or aria-hidden="true".
    • Ignore elements with zero width/height or fully outside the viewport.
    • Apply visibility checks in ClickableElementDetector.is_interactive.
    • Add CI tests for these filtering cases.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="tests/ci/test_clickable_element_filtering.py">

<violation number="1" location="tests/ci/test_clickable_element_filtering.py:12">
This test case expects partially offscreen elements to be filtered out, but the detector only rejects nodes that are fully outside the viewport, so ClickableElementDetector.is_interactive returns True here and the parametrized test fails.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@pytest.mark.parametrize("attrs,snapshot,expected", [
({'inert': ''}, DummySnapshotNode(10, 10, 100, 20), False),
({'aria-hidden': 'true'}, DummySnapshotNode(10, 10, 100, 20), False),
({}, DummySnapshotNode(-10, 10, 100, 20), False),
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 23, 2025

Choose a reason for hiding this comment

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

This test case expects partially offscreen elements to be filtered out, but the detector only rejects nodes that are fully outside the viewport, so ClickableElementDetector.is_interactive returns True here and the parametrized test fails.

Prompt for AI agents
Address the following comment on tests/ci/test_clickable_element_filtering.py at line 12:

<comment>This test case expects partially offscreen elements to be filtered out, but the detector only rejects nodes that are fully outside the viewport, so ClickableElementDetector.is_interactive returns True here and the parametrized test fails.</comment>

<file context>
@@ -0,0 +1,41 @@
[email protected](&quot;attrs,snapshot,expected&quot;, [
+    ({&#39;inert&#39;: &#39;&#39;}, DummySnapshotNode(10, 10, 100, 20), False),
+    ({&#39;aria-hidden&#39;: &#39;true&#39;}, DummySnapshotNode(10, 10, 100, 20), False),
+    ({}, DummySnapshotNode(-10, 10, 100, 20), False),
+    ({}, DummySnapshotNode(10, 10, 0, 20), False),
+    ({}, DummySnapshotNode(10, 10, 100, 0), False),
</file context>
Fix with Cubic

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