Add Enable/Disable button to context bar - #739
Conversation
|
Warning Review limit reached
Next review available in: 43 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe editor adds an ChangesBlock enable/disable controls
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant keyboardui.js
participant blocklyinit.js
participant BlocklyBlock
participant BlocklyEvents
User->>keyboardui.js: Press L
keyboardui.js->>blocklyinit.js: Invoke enable/disable shortcut
blocklyinit.js->>BlocklyBlock: Resolve target and toggle MANUALLY_DISABLED
blocklyinit.js->>BlocklyEvents: Group state change as toolbar_disable
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@main/blocklyinit.js`:
- Around line 1614-1620: In the shortcut callback around enableTargetBlock, use
the second event argument and call its optional preventDefault method before
toggling the block’s disabled state. Preserve the existing editability check and
toggle behavior, while preventing the key from being inserted into a focused
field.
In `@ui/contextmenu.js`:
- Around line 1307-1317: Update the enableBtn activation handler to respond to
native button click events so focused keyboard activation via Enter or Space
performs the same toggle. Preserve the existing pointer behavior without
triggering the action twice, and keep the current block state update and
rendering logic unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2f375b5b-5da1-4ab5-bed7-cba6e842bcbf
📒 Files selected for processing (11)
accessibility/keyboardui.jslocale/de.jslocale/en.jslocale/es.jslocale/fr.jslocale/it.jslocale/pl.jslocale/pt.jslocale/sv.jsmain/blocklyinit.jsui/contextmenu.js
Summary
Added an enable/disable button to the block context bar with the keyboard shortcut L. The icon shows the current state, clicking/pressing L toggles the state.
AI usage
Claude Sonnet 5 used throughout. Decisions made by me.
Summary by CodeRabbit