Skip to content

fix: job alert toggle selector broken (#565)#577

Merged
sigvardt merged 1 commit intomainfrom
ai/issue-565-bug-job-alert-toggle-selector-broken-cannot-create
Mar 17, 2026
Merged

fix: job alert toggle selector broken (#565)#577
sigvardt merged 1 commit intomainfrom
ai/issue-565-bug-job-alert-toggle-selector-broken-cannot-create

Conversation

@sigvardt
Copy link
Owner

Summary

Fixes #565. The jobs alerts create command failed with UI_CHANGED_SELECTOR_FAILED because visually hidden <input role="switch"> elements inside LinkedIn's .artdeco-toggle components failed the isVisible() check.

Changes

  • isVisible Check: Updated the visibility check to verify the parent container's visibility if an <input> is a checkbox/switch inside an .artdeco-toggle. This prevents visually hidden inputs (width: 0) from being erroneously filtered out.
  • markJobsButton Path: For the primary path, the selector now returns the .artdeco-toggle container instead of the nested <input>, preventing Playwright from complaining when it tries to call .click() on an invisible input.
  • Fallback Selectors: Added .artdeco-toggle, label.artdeco-toggle__text, and label[for] to the fallback querySelectorAll string since they are fully clickable elements when <input> is hidden.
  • readJobsToggleState Extraction: Ensures readJobsToggleState can reliably read checked or aria-checked states even when the markJobsButton returns the .artdeco-toggle parent, by recursively grabbing the inner <input>.

Closes #565

LinkedIn uses inputs with width=0 and height=0 inside .artdeco-toggle components. The original fix in #534 targeted the input but failed to consider Playwright's visibility requirements and the DOM's getBoundingClientRect().

- Modifies isVisible to check parent visibility for visually hidden inputs

- Adds label.artdeco-toggle__text and .artdeco-toggle to fallback selector

- Primary path returns the toggle container so Playwright can click it

- readJobsToggleState updated to recursively check for an inner input if a wrapper was passed
@sigvardt sigvardt enabled auto-merge (squash) March 17, 2026 19:46
@sigvardt sigvardt merged commit bdfe1e3 into main Mar 17, 2026
4 checks 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.

Bug: Job alert toggle selector broken — cannot create job alerts

1 participant