Skip to content

feat(js): add sandbox command palette#8672

Merged
kylemac merged 1 commit into
mainfrom
kylemac/sandbox-cmdk-interface
May 27, 2026
Merged

feat(js): add sandbox command palette#8672
kylemac merged 1 commit into
mainfrom
kylemac/sandbox-cmdk-interface

Conversation

@kylemac

@kylemac kylemac commented May 27, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a keyboard command palette to the clerk-js sandbox so developers can jump to sandbox routes and toggle appearance controls with Cmd/Ctrl+K.
It also prevents the existing / sidebar shortcut from firing while typing in inputs, textareas, or contenteditable regions.
Tested with pnpm --filter @clerk/clerk-js build:sandbox and pnpm changeset status --since=origin/main; pnpm printed the local Node engine warning because this shell is on Node v22.22.0 instead of the repo's Node >=24.15.0 requirement.

https://clerk-js-sandbox-git-kylemac-sandbox-cmdk-interface.clerkstage.dev/ - and hit cmd+k and try searching

Checklist

  • pnpm test runs as expected.
  • pnpm --filter @clerk/clerk-js build:sandbox runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented May 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 388fcda

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 27, 2026 6:40pm

Request Review

@kylemac kylemac marked this pull request as ready for review May 27, 2026 18:42
@kylemac kylemac changed the title Add sandbox command palette feat(js): add sandbox command palette May 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Snapi: no API changes detected in @clerk/backend, @clerk/clerk-js, @clerk/nextjs, @clerk/react, @clerk/shared, @clerk/ui.

@pkg-pr-new

pkg-pr-new Bot commented May 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8672

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8672

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8672

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8672

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8672

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8672

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8672

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8672

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8672

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8672

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8672

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8672

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8672

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8672

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8672

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8672

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8672

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8672

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8672

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8672

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8672

commit: 388fcda

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds an interactive command palette to the Clerk JS sandbox using a lightweight, self-contained implementation. A new cmdk.ts module defines a CommandItem model and exports initCommandPalette(), which builds a searchable, keyboard-navigable palette populated by collecting sidebar navigation links and appearance toggles (dark mode, sidebar collapse). The app.ts integrates the palette on startup and improves the existing "/" key handler to skip toggle behavior when focus is on text input elements. A changeset file documents the change for release notes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • clerk/javascript#8605: Modifies the same "/" key handler in app.ts for the sidebar/pane toggle, providing context for the input-focused guard logic added here.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(js): add sandbox command palette' clearly and concisely describes the main change—adding a command palette feature to the sandbox environment.
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.
Description check ✅ Passed The pull request description clearly describes the changeset: adding a command palette to the sandbox and preventing the / shortcut from firing in input fields.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.changeset/polite-papers-watch.md:
- Around line 1-2: The changeset file polite-papers-watch.md currently contains
only delimiters and must either be deleted or replaced with a valid changeset
frontmatter entry; if the sandbox output is included in the published build
(i.e., affects the `@clerk/clerk-js` package which publishes "dist"), replace the
delimiter-only content with a proper frontmatter mapping that lists the affected
package (e.g., `@clerk/clerk-js`) and a bump type (patch/minor/major) plus an
optional description so Changesets can generate a release, otherwise remove the
polite-papers-watch.md file entirely to avoid breaking changelog/release
tooling.
🪄 Autofix (Beta)

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: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 02e8563a-054e-48ee-887e-6277b6c239e3

📥 Commits

Reviewing files that changed from the base of the PR and between 9e66015 and 388fcda.

📒 Files selected for processing (3)
  • .changeset/polite-papers-watch.md
  • packages/clerk-js/sandbox/app.ts
  • packages/clerk-js/sandbox/cmdk.ts

Comment on lines +1 to +2
---
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if sandbox is excluded from the clerk-js package

# Look for files configuration in package.json
cat packages/clerk-js/package.json | jq -r '.files // "no files field"'

# Check for .npmignore if present
if [ -f packages/clerk-js/.npmignore ]; then
  echo "=== .npmignore content ==="
  cat packages/clerk-js/.npmignore
fi

# Look for any references to sandbox in publish configuration
rg -n "sandbox" packages/clerk-js/package.json -A 2 -B 2 || echo "No sandbox references in package.json"

Repository: clerk/javascript

Length of output: 1508


Fix empty Changesets file—either add bump metadata or remove it

  • .changeset/polite-papers-watch.md contains only the --- delimiters (no package bump entries), which makes it unclear/likely invalid for Changesets processing.
  • @clerk/clerk-js publishes only "files": ["dist","no-rhc"], so if the sandbox feature outputs into dist during the publish/release build, the change should include a proper version bump; if the sandbox is not part of the publish build, the changeset file should be removed.
  • Replace the delimiter-only content with a valid frontmatter/bump entry (or delete the file) so release tooling and changelog generation don’t miss or fail on this PR.
🤖 Prompt for 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.

In @.changeset/polite-papers-watch.md around lines 1 - 2, The changeset file
polite-papers-watch.md currently contains only delimiters and must either be
deleted or replaced with a valid changeset frontmatter entry; if the sandbox
output is included in the published build (i.e., affects the `@clerk/clerk-js`
package which publishes "dist"), replace the delimiter-only content with a
proper frontmatter mapping that lists the affected package (e.g.,
`@clerk/clerk-js`) and a bump type (patch/minor/major) plus an optional
description so Changesets can generate a release, otherwise remove the
polite-papers-watch.md file entirely to avoid breaking changelog/release
tooling.

@kylemac kylemac requested a review from a team May 27, 2026 18:48
@kylemac kylemac merged commit 7f13f28 into main May 27, 2026
52 of 58 checks passed
@kylemac kylemac deleted the kylemac/sandbox-cmdk-interface branch May 27, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants