Skip to content

fix command menu hotkey#863

Merged
hatemhosny merged 2 commits into
developfrom
fix-command-menu
Aug 23, 2025
Merged

fix command menu hotkey#863
hatemhosny merged 2 commits into
developfrom
fix-command-menu

Conversation

@hatemhosny
Copy link
Copy Markdown
Collaborator

@hatemhosny hatemhosny commented Aug 23, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Command palette (Ctrl+K) now opens only when hidden or empty, preventing unexpected pop-ups and improving predictability.
    • Eliminated an intermittent delayed opening, improving responsiveness when triggering the palette.
  • Refactor

    • Activation flow now relies on preloaded command data for faster, smoother opening and reduced latency.

@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 23, 2025

Deploy Preview for livecodes ready!

Name Link
🔨 Latest commit 0c25761
🔍 Latest deploy log https://app.netlify.com/projects/livecodes/deploys/68aa1ad5b5d9e100080e441f
😎 Deploy Preview https://deploy-preview-863--livecodes.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 23, 2025

Walkthrough

Modifies the Ctrl+K command-palette handler in src/livecodes/core.ts to open the menu only when ninja.__visible === false or ninja.data.length === 0, removes the unconditional 500ms delayed open and lazy loadNinjaKeys() call, and moves ninja.focus() / openCommandMenu() inside the new conditional.

Changes

Cohort / File(s) Summary
Command palette hotkey logic
src/livecodes/core.ts
Refactors Ctrl+K handler: relies on preloaded ninja keys; replaces loose visibility check with `ninja.__visible === false

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App
  participant Ninja as Ninja (preloaded state)
  participant CmdMenu as Command Menu

  User->>App: Press Ctrl+K
  App->>Ninja: Inspect ninja.__visible and ninja.data.length
  alt ninja.__visible === false OR ninja.data.length === 0
    App->>Ninja: ninja.focus()
    App->>CmdMenu: requestAnimationFrame(openCommandMenu)
    Note right of CmdMenu: Command menu opens
  else visible with data
    App-->>User: No open triggered
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A rabbit taps Ctrl+K with cheer,
Sees if ninja’s gone or clear—
If hidden or empty, up it springs,
Otherwise hush, no noisy things.
Preloaded keys, a nimble hop, menu appears without a stop. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2f857f8 and 0c25761.

📒 Files selected for processing (1)
  • src/livecodes/core.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/livecodes/core.ts
⏰ 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). (15)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Redirect rules - livecodes
  • GitHub Check: Header rules - livecodes
  • GitHub Check: Pages changed - livecodes
  • GitHub Check: tests (18.x, 4)
  • GitHub Check: tests (18.x, 5)
  • GitHub Check: tests (18.x, 1)
  • GitHub Check: tests (18.x, 3)
  • GitHub Check: tests (18.x, 2)
  • GitHub Check: type-check (18.x)
  • GitHub Check: build
  • GitHub Check: build (18.x)
  • GitHub Check: type-check (18.x)
  • GitHub Check: build (18.x)
  • GitHub Check: Cloudflare Pages
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-command-menu

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 23, 2025

Size Change: +314 B (+0.03%)

Total Size: 947 kB

ℹ️ View Unchanged
Filename Size Change
./build/404.html 1 kB 0 B
./build/app.html 250 B 0 B
./build/index.html 2.46 kB 0 B
./build/livecodes/app.js 111 kB +81 B (+0.07%)
./build/livecodes/app.css 22.4 kB 0 B
./build/livecodes/assets.js 8.61 kB +3 B (+0.03%)
./build/livecodes/assets/noop.js 18 B 0 B
./build/livecodes/assets/templates/diagrams-starter.html 2.19 kB 0 B
./build/livecodes/backup.js 3.69 kB +1 B (+0.03%)
./build/livecodes/blockly.js 13.2 kB 0 B
./build/livecodes/broadcast.js 1.19 kB 0 B
./build/livecodes/bundle-types.js 4.35 kB 0 B
./build/livecodes/code-to-image.js 9.06 kB -28 B (-0.31%)
./build/livecodes/codejar.js 17.6 kB 0 B
./build/livecodes/codemirror.js 6.29 kB 0 B
./build/livecodes/compile.page.js 2.36 kB 0 B
./build/livecodes/compile.worker.js 14.1 kB 0 B
./build/livecodes/compiler-utils.js 3.15 kB 0 B
./build/livecodes/custom-editor-utils.js 198 B 0 B
./build/livecodes/deploy.js 6.86 kB +2 B (+0.03%)
./build/livecodes/editor-settings.js 17.7 kB +5 B (+0.03%)
./build/livecodes/embed-ui.js 5.51 kB -4 B (-0.07%)
./build/livecodes/embed.js 89.1 kB +103 B (+0.12%)
./build/livecodes/export.js 3.87 kB 0 B
./build/livecodes/firebase.js 22.7 kB 0 B
./build/livecodes/format.worker.js 13.3 kB 0 B
./build/livecodes/google-fonts.js 7.12 kB 0 B
./build/livecodes/headless.js 77.8 kB +80 B (+0.1%)
./build/livecodes/i18n-ar-language-info.json 5.17 kB 0 B
./build/livecodes/i18n-ar-translation.json 9.32 kB 0 B
./build/livecodes/i18n-de-language-info.json 5.21 kB 0 B
./build/livecodes/i18n-de-translation.json 9.43 kB 0 B
./build/livecodes/i18n-en-language-info.json 4.5 kB 0 B
./build/livecodes/i18n-en-translation.json 8.02 kB 0 B
./build/livecodes/i18n-es-language-info.json 4.95 kB 0 B
./build/livecodes/i18n-es-translation.json 9.16 kB 0 B
./build/livecodes/i18n-fa-language-info.json 5.28 kB 0 B
./build/livecodes/i18n-fa-translation.json 9.46 kB 0 B
./build/livecodes/i18n-fr-language-info.json 5.13 kB 0 B
./build/livecodes/i18n-fr-translation.json 9.4 kB 0 B
./build/livecodes/i18n-hi-language-info.json 5.71 kB 0 B
./build/livecodes/i18n-hi-translation.json 9.94 kB 0 B
./build/livecodes/i18n-it-language-info.json 5 kB 0 B
./build/livecodes/i18n-it-translation.json 9.25 kB 0 B
./build/livecodes/i18n-ja-language-info.json 5.51 kB 0 B
./build/livecodes/i18n-ja-translation.json 9.6 kB 0 B
./build/livecodes/i18n-pt-language-info.json 4.99 kB 0 B
./build/livecodes/i18n-pt-translation.json 9.33 kB 0 B
./build/livecodes/i18n-ru-language-info.json 5.52 kB 0 B
./build/livecodes/i18n-ru-translation.json 10.3 kB 0 B
./build/livecodes/i18n-ur-language-info.json 5.73 kB 0 B
./build/livecodes/i18n-ur-translation.json 9.77 kB 0 B
./build/livecodes/i18n-zh-CN-language-info.json 4.87 kB 0 B
./build/livecodes/i18n-zh-CN-translation.json 8.63 kB 0 B
./build/livecodes/i18n.js 20.2 kB +1 B (0%)
./build/livecodes/import-src.js 15.8 kB 0 B
./build/livecodes/import.js 14.4 kB +39 B (+0.27%)
./build/livecodes/index.js 5.34 kB +18 B (+0.34%)
./build/livecodes/lang-art-template-compiler.js 1.63 kB 0 B
./build/livecodes/lang-assemblyscript-compiler.js 290 B 0 B
./build/livecodes/lang-assemblyscript-script.js 386 B 0 B
./build/livecodes/lang-astro-compiler.js 2.32 kB 0 B
./build/livecodes/lang-clio-compiler.js 1.53 kB 0 B
./build/livecodes/lang-commonlisp-script.js 123 B 0 B
./build/livecodes/lang-cpp-script.js 1.73 kB 0 B
./build/livecodes/lang-cpp-wasm-script.js 2.82 kB 0 B
./build/livecodes/lang-csharp-wasm-script.js 2.16 kB 0 B
./build/livecodes/lang-diagrams-compiler-esm.js 5.08 kB 0 B
./build/livecodes/lang-dot-compiler.js 1.64 kB 0 B
./build/livecodes/lang-ejs-compiler.js 1.61 kB 0 B
./build/livecodes/lang-eta-compiler.js 1.63 kB 0 B
./build/livecodes/lang-fennel-compiler.js 1.59 kB 0 B
./build/livecodes/lang-gleam-compiler.js 3 kB 0 B
./build/livecodes/lang-haml-compiler.js 1.62 kB 0 B
./build/livecodes/lang-handlebars-compiler.js 1.9 kB 0 B
./build/livecodes/lang-imba-compiler.js 147 B 0 B
./build/livecodes/lang-java-script.js 4.03 kB 0 B
./build/livecodes/lang-jinja-compiler.js 1.63 kB 0 B
./build/livecodes/lang-julia-script.js 3.27 kB 0 B
./build/livecodes/lang-liquid-compiler.js 1.65 kB 0 B
./build/livecodes/lang-lua-wasm-script.js 205 B 0 B
./build/livecodes/lang-malina-compiler.js 2.91 kB 0 B
./build/livecodes/lang-mustache-compiler.js 1.63 kB 0 B
./build/livecodes/lang-nunjucks-compiler.js 1.91 kB 0 B
./build/livecodes/lang-perl-script.js 268 B 0 B
./build/livecodes/lang-php-wasm-script.js 347 B 0 B
./build/livecodes/lang-postgresql-compiler-esm.js 1.71 kB 0 B
./build/livecodes/lang-prolog-script.js 204 B 0 B
./build/livecodes/lang-pug-compiler.js 371 B 0 B
./build/livecodes/lang-python-wasm-script.js 1.9 kB 0 B
./build/livecodes/lang-r-script-esm.js 2.41 kB 0 B
./build/livecodes/lang-rescript-compiler-esm.js 2.13 kB 0 B
./build/livecodes/lang-rescript-formatter.js 1.49 kB 0 B
./build/livecodes/lang-riot-compiler.js 2.77 kB 0 B
./build/livecodes/lang-ruby-wasm-script.js 1.68 kB 0 B
./build/livecodes/lang-scss-compiler.js 1.69 kB 0 B
./build/livecodes/lang-solid-compiler.js 263 B 0 B
./build/livecodes/lang-sql-compiler.js 1.62 kB 0 B
./build/livecodes/lang-sql-script.js 1.93 kB 0 B
./build/livecodes/lang-svelte-compiler.js 4.56 kB 0 B
./build/livecodes/lang-tcl-script.js 1.8 kB 0 B
./build/livecodes/lang-teal-compiler.js 1.69 kB 0 B
./build/livecodes/lang-twig-compiler.js 1.62 kB 0 B
./build/livecodes/lang-vento-compiler.js 1.65 kB 0 B
./build/livecodes/lang-vue-compiler.js 5.99 kB 0 B
./build/livecodes/lang-vue2-compiler.js 3.43 kB 0 B
./build/livecodes/lang-wat-compiler.js 348 B 0 B
./build/livecodes/lang-wat-script.js 1.55 kB 0 B
./build/livecodes/language-info.js 7.65 kB -4 B (-0.05%)
./build/livecodes/monaco-lang-astro.js 947 B 0 B
./build/livecodes/monaco-lang-clio.js 639 B 0 B
./build/livecodes/monaco-lang-imba.js 7.35 kB 0 B
./build/livecodes/monaco-lang-wat.js 2.46 kB 0 B
./build/livecodes/monaco.js 10.1 kB 0 B
./build/livecodes/open.js 6.18 kB +5 B (+0.08%)
./build/livecodes/processor-lightningcss-compiler.js 1.85 kB 0 B
./build/livecodes/processor-postcss-compiler.js 2 kB 0 B
./build/livecodes/processor-tailwindcss-compiler.js 5.03 kB 0 B
./build/livecodes/processor-unocss-compiler.js 355 B 0 B
./build/livecodes/processor-windicss-compiler.js 450 B 0 B
./build/livecodes/quill.css 697 B 0 B
./build/livecodes/quill.js 5.74 kB 0 B
./build/livecodes/resources.js 3.43 kB 0 B
./build/livecodes/result-utils.js 1.17 kB 0 B
./build/livecodes/share.js 3.79 kB -2 B (-0.05%)
./build/livecodes/snippets.js 6.03 kB +14 B (+0.23%)
./build/livecodes/sync-ui.js 3.23 kB 0 B
./build/livecodes/sync.js 3.52 kB 0 B
./build/livecodes/sync.worker.js 29.7 kB 0 B
./build/livecodes/templates.js 24.6 kB 0 B
./build/sdk/livecodes.js 3.95 kB 0 B
./build/sdk/livecodes.umd.js 4.03 kB 0 B
./build/sdk/package.json 293 B 0 B
./build/sdk/react.js 4.25 kB 0 B
./build/sdk/vue.js 4.34 kB 0 B

compressed-size-action

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Aug 23, 2025

Deploying livecodes with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0c25761
Status: ✅  Deploy successful!
Preview URL: https://a294d4c7.livecodes.pages.dev
Branch Preview URL: https://fix-command-menu.livecodes.pages.dev

View logs

Copy link
Copy Markdown
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 708bf08 and 2f857f8.

📒 Files selected for processing (1)
  • src/livecodes/core.ts (1 hunks)
⏰ 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). (14)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Redirect rules - livecodes
  • GitHub Check: Header rules - livecodes
  • GitHub Check: Pages changed - livecodes
  • GitHub Check: build (18.x)
  • GitHub Check: tests (18.x, 1)
  • GitHub Check: tests (18.x, 5)
  • GitHub Check: tests (18.x, 4)
  • GitHub Check: tests (18.x, 2)
  • GitHub Check: tests (18.x, 3)
  • GitHub Check: build
  • GitHub Check: type-check (18.x)
  • GitHub Check: build (18.x)
  • GitHub Check: type-check (18.x)

Comment thread src/livecodes/core.ts Outdated
@sonarqubecloud
Copy link
Copy Markdown

@hatemhosny hatemhosny merged commit 7acda7f into develop Aug 23, 2025
22 checks passed
@hatemhosny hatemhosny deleted the fix-command-menu branch August 23, 2025 20:45
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