Skip to content

Conversation

@mdroidian
Copy link
Collaborator

@mdroidian mdroidian commented Dec 24, 2025

https://www.loom.com/share/5db4f32d01c24231bbb925c416ae828b

Summary by CodeRabbit

  • Improvements

    • Smarter handling of focused blocks and window context so SmartBlock commands reliably target the correct pane or page across views.
    • More robust focus and selection behavior with safer fallbacks when window context is missing, reducing edge-case failures.
  • Chores

    • Package bumped to 1.12.3 and a dev-only dependency removed.

✏️ Tip: You can customize this high-level summary in your review settings.

…and palette and sbBomb. Updated logic to retrieve window ID from focused block or construct it as a fallback. Improved code clarity and robustness in block focus and selection handling.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR centralizes focused-block access and adds windowId propagation across SmartBlock execution paths. In src/index.ts the code captures the focused block into a variable, derives both targetUid and windowId from it, and passes windowId in sbBomb target payloads for command-palette, hotkey, textarea, blank-target fallback, and multi-run flows. In src/utils/core.ts setBlockFocusAndSelection now resolves a windowId defensively (from the provided value, focused block, or page UID-derived window) and only calls setBlockFocusAndSelection when a windowId is available. package.json version updated and a devDependency removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Add order to SMARTBLOCK #131 — Modifies sbBomb target payload and core command handling; touches the same target object and windowId-related logic.

Suggested labels

codex

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix <%CURSOR%> when using hotkeys' is vague and incomplete. It mentions the symptom (<%CURSOR%> token) but uses placeholder syntax that suggests the actual issue wasn't filled in, making the title unclear about what specific problem is being addressed. Replace the placeholder with the actual issue being fixed, such as 'Fix cursor position when using hotkeys to trigger SmartBlocks' or similar, to clearly convey the problem being solved.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 846fc73 and 4f6f09f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56d76b3 and 846fc73.

📒 Files selected for processing (2)
  • src/index.ts
  • src/utils/core.ts
🧰 Additional context used
🧬 Code graph analysis (1)
src/index.ts (1)
src/utils/core.ts (1)
  • sbBomb (2740-2924)
🔇 Additional comments (3)
src/index.ts (3)

139-152: LGTM!

Good refactoring to capture the focused block once and derive both targetUid and windowId from it. The use of optional chaining ensures safe handling of null/undefined cases.


167-167: LGTM!

Correctly passes windowId in the fallback path for consistency. The defensive logic in sbBomb will handle the case where windowId is undefined.


514-530: LGTM!

Consistent with the command palette changes - captures the focused block once and derives both focusedUid and windowId from it. The optional chaining provides safe null/undefined handling.

@mdroidian mdroidian merged commit c1b7d43 into main Dec 24, 2025
1 of 3 checks passed
@mdroidian mdroidian deleted the fix-cursor-on-hotkeys branch December 24, 2025 01:38
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