Skip to content

feat(code): cmd palette on quill autocomplete + bump quill#2100

Merged
adamleithp merged 3 commits intomainfrom
ux/cmd-menu
May 8, 2026
Merged

feat(code): cmd palette on quill autocomplete + bump quill#2100
adamleithp merged 3 commits intomainfrom
ux/cmd-menu

Conversation

@adamleithp
Copy link
Copy Markdown
Contributor

@adamleithp adamleithp commented May 8, 2026

Summary

  • Migrate Cmd+K command menu (and CommandKeyHints) from cmdk + Radix Kbd to quill's Autocomplete* + Kbd/KbdGroup, matching the Storybook CommandPalette pattern. Settings dialog now closes when "Home" / "New task" is run.
  • Bump @posthog/quill 0.1.0-alpha.7 → 0.3.0-beta.1, install tailwindcss-scroll-mask so quill's scroll-mask-* utilities compile, fix the @source glob pointing at the npm dist.
  • Drop variant from Chip in GithubRefChip and MentionChipView — quill 0.3 removed the prop.
  • Theme commands now show explicit "Switch to light/dark/system" entries based on current theme (system option hidden when it would be a no-op vs prefers-color-scheme), eliminating drift from the old cycling toggle.
  • ESC closes the palette in a single press (inline prop on Autocomplete lets base-ui's dismiss handler bubble to the parent Dialog).
2026-05-08 06 28 02

Test plan

  • Cmd+K opens, type filters, ↑/↓ navigates, Enter runs the highlighted command, Esc closes in one press.
  • "Home" and "New task" work from inside Settings (Settings dialog dismisses, view routes).
  • Theme entries match current state: in light mode see "Switch to dark mode" + "Switch to system theme"; flip OS dark mode and the system option disappears when redundant.
  • No console errors from the quill bump elsewhere in the app (sidebar, project switcher, file picker still using cmdk path).
  • pnpm --filter code typecheck is clean.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/command/components/CommandMenu.tsx:243-253
**Keyboard Enter does not run commands**

`onValueChange` early-returns for every reason except `"input-change"`, so when the user navigates to an item with ↑/↓ and presses Enter, base-ui fires `onValueChange` with `reason: "item-select"` — but the handler ignores it. Command execution only works via mouse click (the `onClick` on each `AutocompleteItem`). The test plan line "Enter runs the highlighted command" will fail.

Reviews (1): Last reviewed commit: "fix: close cmd on esc with inline, close..." | Re-trigger Greptile

Comment on lines +243 to +253
onValueChange={(val, eventDetails) => {
if (eventDetails.reason !== "input-change") return;
if (typeof val === "string") {
setQuery(val);
}
}}
filter={(cmd, q) => {
if (!q) return true;
const haystack = `${cmd.label} ${cmd.keywords ?? ""}`.toLowerCase();
return haystack.includes(q.toLowerCase());
}}
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.

P1 Keyboard Enter does not run commands

onValueChange early-returns for every reason except "input-change", so when the user navigates to an item with ↑/↓ and presses Enter, base-ui fires onValueChange with reason: "item-select" — but the handler ignores it. Command execution only works via mouse click (the onClick on each AutocompleteItem). The test plan line "Enter runs the highlighted command" will fail.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/command/components/CommandMenu.tsx
Line: 243-253

Comment:
**Keyboard Enter does not run commands**

`onValueChange` early-returns for every reason except `"input-change"`, so when the user navigates to an item with ↑/↓ and presses Enter, base-ui fires `onValueChange` with `reason: "item-select"` — but the handler ignores it. Command execution only works via mouse click (the `onClick` on each `AutocompleteItem`). The test plan line "Enter runs the highlighted command" will fail.

How can I resolve this? If you propose a fix, please make it concise.

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.

is this legit ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not legit anymore — fixed in 1ccae8e by adding defaultOpen on Autocomplete (line 240). Selection routes through onClick on AutocompleteItem (line 277); base-ui's combobox fires the highlighted item's click on Enter when the popup is open, and defaultOpen keeps it open inside the Dialog. onValueChange is intentionally text-input-only — item-select is handled by the click path, not the value path.

Test: Cmd+K → type to filter → ↑/↓ → Enter runs the highlighted command. Esc closes in one press.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Reviews (2): Last reviewed commit: "fix: enter on cmd items by setting defau..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@adboio adboio left a comment

Choose a reason for hiding this comment

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

one greptile comment that looks maybe legit, but otherwise lgtm!

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Reviews (3): Last reviewed commit: "chore: biome format globals.css" | Re-trigger Greptile

@adamleithp adamleithp merged commit 50ec98b into main May 8, 2026
15 checks passed
@adamleithp adamleithp deleted the ux/cmd-menu branch May 8, 2026 16:18
adboio added a commit that referenced this pull request May 8, 2026
…#2112)

## TL;DR

Adds comprehensive analytics tracking for task creation events, capturing workspace mode (local/worktree/cloud), worktree file usage (.worktreelink/.worktreeinclude), and environment configuration details to enable insights into user preferences across different workspace modes.

## Problem

We need to audit task creation events across different workspace modes (local, worktree, cloud) to understand which modes users prefer and identify feature usage patterns. The existing task creation tracking was incomplete and lacked the necessary data to build these insights.

Closes #2100

## Changes

### Backend (Workspace Service)
- Added `getWorktreeFileUsage()` method to detect whether `.worktreelink` or `.worktreeinclude` files exist and contain non-empty, non-comment entries
- Added `hasExcludeFileEntries()` helper to safely read and parse worktree exclude files
- Added new Zod schemas `getWorktreeFileUsageInput` and `getWorktreeFileUsageOutput` for type safety

### API (tRPC Router)
- Exposed `getWorktreeFileUsage` as a public tRPC procedure to allow frontend queries for worktree file usage data

### Frontend (Task Creation Tracking)
- Added `trackTaskCreated()` function to comprehensively track task creation with:
  - Workspace mode (local/worktree/cloud)
  - Auto-run status
  - Repository provider (GitHub or none)
  - Branch information
  - Environment/sandbox environment configuration
  - Cloud run source and PR authorship mode
  - Worktree file usage (`.worktreelink` and `.worktreeinclude`)
  - Adapter type
- Integrated tracking into task creation flow in `useTaskCreation` hook
- Removed incomplete task creation tracking from `useTasks` hook to consolidate in one place

## How did you test this?

- Verified the new tRPC endpoint is properly typed with input/output schemas
- Confirmed worktree file parsing correctly identifies non-empty, non-comment lines
- Validated task creation tracking captures all required analytics properties
- Error handling ensures failed analytics calls don't block task creation

## Publish to changelog?

yes

---
*Created with [PostHog Code](https://posthog.com/code?ref=pr)*
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