Skip to content

feat: adding ai menu shortcut (align with copilot) - #1795

Open
BetterAndBetterII wants to merge 1 commit into
TypeCellOS:mainfrom
BetterAndBetterII:feat-ai_shortcut
Open

feat: adding ai menu shortcut (align with copilot)#1795
BetterAndBetterII wants to merge 1 commit into
TypeCellOS:mainfrom
BetterAndBetterII:feat-ai_shortcut

Conversation

@BetterAndBetterII

@BetterAndBetterII BetterAndBetterII commented Jun 27, 2025

Copy link
Copy Markdown

Ctrl-I or Command-I to open AI-Menu

This pull request introduces enhancements to the xl-ai package, focusing on dependency updates and the addition of a new ProseMirror plugin to enable keyboard shortcuts for AI menu interactions. The most significant changes include adding the ShortcutPlugin for streamlined AI menu access and updating dependencies in package.json to support new functionality.

Dependency Updates:

  • packages/xl-ai/package.json: Added prosemirror-keymap and its type definitions (@types/prosemirror-keymap) to enable keyboard shortcut functionality.

Plugin Addition:

Integration of ShortcutPlugin:

  • packages/xl-ai/src/AIExtension.ts: Imported the ShortcutPlugin and integrated it into the AIExtension class, ensuring the plugin is added to the ProseMirror editor.

Summary by CodeRabbit

  • New Features
    • Added a keyboard shortcut to open the AI menu using Cmd/Ctrl+I.
    • The menu opens at the current text block, or the previous block when the current block is empty.
    • The shortcut is inactive when the AI menu is already open or unavailable.

@vercel

vercel Bot commented Jun 27, 2025

Copy link
Copy Markdown

@BetterAndBetterII is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 07717dff-8b06-4517-8cd8-efe075bb82bb

📥 Commits

Reviewing files that changed from the base of the PR and between 19b9b19 and 678ee06.

📒 Files selected for processing (3)
  • packages/xl-ai/package.json
  • packages/xl-ai/src/AIExtension.ts
  • packages/xl-ai/src/plugins/ShortcutPlugin.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The AI package adds a ProseMirror Mod-i shortcut. The shortcut opens the AI menu when it is closed and targets the previous block when the current block is empty. The plugin is registered with the editor.

Changes

AI menu shortcut

Layer / File(s) Summary
Shortcut command and keymap
packages/xl-ai/src/plugins/ShortcutPlugin.ts
Adds the Mod-i keymap. The command checks the AI extension and menu state, selects the current or previous block, and opens the AI menu.
Editor plugin integration
packages/xl-ai/src/AIExtension.ts, packages/xl-ai/package.json
Registers the shortcut plugin with the editor and adds prosemirror-keymap as a runtime dependency.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to 678ee

The new Mod-I shortcut can bypass the existing read-only restriction and may leave a read-only editor editable after the AI menu is closed. This could allow unintended edits, so the read-only behavior should be corrected or explicitly accepted before merging.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ShortcutPlugin
  participant AIMenuExtension
  User->>ShortcutPlugin: Press Mod-i
  ShortcutPlugin->>AIMenuExtension: Check menu state
  ShortcutPlugin->>AIMenuExtension: Open menu at selected block
Loading

Suggested reviewers: nperez0111

Poem

A rabbit taps Mod-i with care
The AI menu opens there
Empty blocks look behind
Closed menus spring to mind
A shortcut hops through code anew

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the shortcut, dependency update, plugin addition, and integration. It does not include the required rationale, impact, testing, checklist, screenshots/video, or additional not… Update the description to follow the repository template. Add the rationale, impact, testing details, checklist status, screenshots/video information when applicable, and additional notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding an AI menu keyboard shortcut. It is concise and related to the pull request objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the shortcut, dependency update, plugin addition, and integration. It does not include the required rationale, impact, testing, checklist, screenshots/video, or additional notes sections.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Warning

⚠️ This pull request shows signs of AI-generated slop (redundant_comments, defensive_cruft, description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

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