fix(link): pin the create-application option to the top of the app picker - #401
Conversation
…cker The "+ Create a new application" choice in the shared app picker was appended after all applications, so with a long app list it was hidden below the truncation fold in `clerk link`, `clerk init`, and the `clerk users` fallback picker. Render it as the first row, both in the unfiltered list and while a search term is typed.
🦋 Changeset detectedLatest commit: 9ae01f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📝 WalkthroughWalkthroughThe interactive application picker now displays “+ Create a new application” before matching applications. Tests cover empty searches, name filtering, and app ID filtering, and a patch changeset documents the behavior for Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
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/commands-update-order-explore.md:
- Around line 1-5: Update the changeset description to include clerk init
alongside clerk link and clerk users, since the shared application picker change
affects all three CLI flows.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 52f1bd9c-7c02-47e1-9a4c-d66641f0f289
📒 Files selected for processing (3)
.changeset/commands-update-order-explore.mdpackages/cli-core/src/commands/link/index.test.tspackages/cli-core/src/lib/app-picker.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
clerk/clerk_go(manual)clerk/dashboard(manual)clerk/accounts(manual)clerk/backoffice(manual)clerk/clerk(manual)clerk/clerk-docs(manual)clerk/cloudflare-workers(manual)
| --- | ||
| "clerk": patch | ||
| --- | ||
|
|
||
| Show the "+ Create a new application" option first in the interactive application picker used by `clerk link` and `clerk users`. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Include clerk init in the release note.
The shared picker change also affects clerk init, but the changeset currently mentions only clerk link and clerk users. Add clerk init so the patch note covers every affected CLI flow.
🤖 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/commands-update-order-explore.md around lines 1 - 5, Update the
changeset description to include clerk init alongside clerk link and clerk
users, since the shared application picker change affects all three CLI flows.
Summary
lib/app-picker.ts, used byclerk link,clerk init, and theclerk usersfallback) appended the "+ Create a new application" choice after all applications. With a long app list the option was hidden below the truncation fold and effectively invisible unless the user scrolled past every app or typed a term with no matches.clerk usersaction menu already lists "Create user" first; a sweep of all other interactive list prompts (init, deploy, switch-env, api, skills) found no other selectable "create" options, so this is the only ordering change needed. This also brings the code in line withcommands/link/README.md, which already documented the option as "pinned at the top".Test plan
clerk linkapp-selection tests to assert the create option is index 0 (empty term, name-filtered term, and ID-filtered term), and strengthened the previously length-only unfiltered assertion to pin the full order.bun run format,bun run lint,bun run typecheckpass.bun run test— 2123 tests pass.patch).