Skip to content

Disable 'Select Element' button while element picker is active - #137

Merged
karngyan merged 1 commit into
developfrom
disable-select-element-btn-during-picker
Mar 27, 2026
Merged

karngyan merged 1 commit into
developfrom
disable-select-element-btn-during-picker

Conversation

@karngyan

@karngyan karngyan commented Mar 27, 2026

Copy link
Copy Markdown
Member
CleanShot 2026-03-27 at 23 45 35@2x

When the element picker is activated via the 'Select Element' button in the preview bar, the button is now disabled (visually greyed out with not-allowed cursor) to prevent re-triggering.

Changes

  • preview-bar-manager.ts: Disable the button directly in the DOM when startElementPicker runs, and set disabled during buildElementSelectorControl if the picker is already active (covers re-renders).
  • preview-bar-styles.ts: Added .gist-pb-select-elem-btn:disabled style (opacity: 0.4; cursor: not-allowed).

The button re-enables automatically when the picker ends since cleanup() sets pickerActive = false and calls renderBar().


Note

Low Risk
Low risk UI-state change limited to the preview bar; main risk is minor regressions in picker lifecycle/re-render behavior.

Overview
Prevents re-triggering the element picker by disabling the preview bar’s Select Element button while the picker overlay is active, including across bar re-renders.

Adds disabled styling for .gist-pb-select-elem-btn and introduces new tests covering initial state, activation, Escape-cancel, and successful pick flows to ensure the button is re-enabled when the picker ends.

Written by Cursor Bugbot for commit 5b91180. This will update automatically on new commits. Configure here.

@karngyan
karngyan requested a review from a team as a code owner March 27, 2026 18:04

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread src/managers/preview-bar-manager.ts
@karngyan
karngyan force-pushed the disable-select-element-btn-during-picker branch from 8669000 to de21e43 Compare March 27, 2026 18:09
@karngyan
karngyan force-pushed the disable-select-element-btn-during-picker branch from de21e43 to 5b91180 Compare March 27, 2026 18:14
@karngyan
karngyan merged commit ce41319 into develop Mar 27, 2026
2 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.

2 participants