Skip to content

More targeted button logo observer classes#138

Merged
mdroidian merged 2 commits intomainfrom
more-targeted-buttonLogoObserver-classes
Sep 23, 2025
Merged

More targeted button logo observer classes#138
mdroidian merged 2 commits intomainfrom
more-targeted-buttonLogoObserver-classes

Conversation

@mdroidian
Copy link
Copy Markdown
Collaborator

@mdroidian mdroidian commented Sep 20, 2025

Issue:

Because of #135 , when other buttons were in the same block as a SmartBlock button, they would get the SmartBlock click handler attached to them. This caused non-SmartBlock buttons to incorrectly trigger SmartBlock workflows when clicked.

This PR narrows the observer classes as a partial fix.

Example:

image

Summary by CodeRabbit

  • Bug Fixes

    • Improved button detection to include buttons with additional styling classes, ensuring SmartBlock triggers appear consistently across more UI buttons.
    • Reduces missed activations on buttons styled as small or with extra Blueprint classes.
  • Chores

    • Bumped package version to 1.11.1.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 20, 2025

Walkthrough

Version bumped to 1.11.1. The button observer in src/index.ts now targets buttons with a more specific className ("bp3-button bp3-small dont-focus-block") instead of exactly "bp3-button". No exported APIs changed.

Changes

Cohort / File(s) Summary
Version bump
package.json
Incremented version from "1.11.0" to "1.11.1".
Button observer selector update
src/index.ts
Updated button matching to require className "bp3-button bp3-small dont-focus-block" instead of exactly "bp3-button". No function signatures or exports changed.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant U as User
    participant DOM as Page DOM
    participant Obs as ButtonObserver
    participant SB as SmartBlock

    Note over Obs,DOM: Initialize MutationObserver on DOM

    DOM-->>Obs: Mutation/Load events
    Obs->>DOM: Query buttons by className "bp3-button bp3-small dont-focus-block"
    alt Match found
        Obs->>DOM: Attach SmartBlock trigger handlers
    else No match
        Obs-->>DOM: No-op
    end

    U->>DOM: Click matched button
    DOM->>SB: Invoke SmartBlock trigger
    SB-->>U: Execute SmartBlock logic
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my whiskers at version one-one-one
A tiny hop forward—patch neatly done.
Buttons now spotted with keener eyes,
Clicks bloom like clover under autumn skies.
Thump-thump! I merge with a carrot’s grin—
Small change, swift paws, onward we spin. 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "More targeted button logo observer classes" is concise and accurately reflects the primary change in the PR—narrowing the CSS classes used by the button-logo observer to avoid attaching SmartBlock handlers to unrelated buttons—so it clearly conveys the main intent to a reviewer scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch more-targeted-buttonLogoObserver-classes

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6af57a2 and 5301cbc.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/index.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (2)
package.json (1)

3-3: Version bump looks good for a patch release.

The patch version increment from 1.11.0 to 1.11.1 is appropriate for the targeted fix to button observer classes, which addresses a specific issue without introducing breaking changes.

src/index.ts (1)

750-750: Approve — selector narrowing appears safe

Repo search for "bp3-button", "bp3-small", "dont-focus-block", and "SmartBlock" returned only src/index.ts (createHTMLObserver); no other SmartBlock buttons found in the codebase.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mdroidian mdroidian merged commit b389ad7 into main Sep 23, 2025
3 of 4 checks passed
@mdroidian mdroidian deleted the more-targeted-buttonLogoObserver-classes branch September 23, 2025 15:30
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