More targeted button logo observer classes#138
Conversation
WalkthroughVersion 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
⏰ 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)
🔇 Additional comments (2)
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. Comment |
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:
Summary by CodeRabbit
Bug Fixes
Chores