Skip to content

fix(global-commands): use isContentEditable for the editable guard#5623

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/editable-guard-content-editable
Jul 12, 2026
Merged

fix(global-commands): use isContentEditable for the editable guard#5623
waleedlatif1 merged 2 commits into
stagingfrom
fix/editable-guard-content-editable

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Type of Change

  • Bug fix

Testing

Provider tests pass (7/7)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 12, 2026 5:06am

Request Review

@cursor

cursor Bot commented Jul 12, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Small, localized change to keyboard shortcut gating in the workspace provider, with updated unit tests and no auth or data-path impact.

Overview
Fixes the editable guard for global shortcuts (allowInEditable: false) so it matches browser behavior instead of reading the contenteditable attribute on the focused node only.

isEditableElement now uses HTMLElement.isContentEditable, so focus inside a rich-text editor (including tabbable descendants under a contenteditable root) still blocks shortcuts like Mod+K, while contenteditable="false" (e.g. read-only editor) no longer blocks them.

Tests stub isContentEditable in jsdom and add coverage for a focused descendant inside a contenteditable root.

Reviewed by Cursor Bugbot for commit b722f2d. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the global shortcut editable guard. The main changes are:

  • Uses browser-computed isContentEditable for editable-region detection.
  • Keeps inputs and textareas blocked for non-editable shortcuts.
  • Adds tests for contenteditable roots, descendants, and contenteditable="false" cases.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/providers/global-commands-provider.tsx Updates the editable guard to use computed contenteditability while preserving input and textarea handling.
apps/sim/app/workspace/[workspaceId]/providers/global-commands-provider.test.tsx Adds focused coverage for contenteditable descendants and stubs computed editability for jsdom.

Reviews (2): Last reviewed commit: "chore(lint): keep focusable span in edit..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit b20bbdc into staging Jul 12, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/editable-guard-content-editable branch July 12, 2026 05:07
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b722f2d. Configure here.

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