Skip to content

feat(cli): add type-to-filter organization, team, and project pickers - #1495

Merged
betegon merged 3 commits into
mainfrom
bt/cli-filterable-selectors
Oct 13, 2026
Merged

betegon merged 3 commits into
mainfrom
bt/cli-filterable-selectors

Conversation

@betegon

@betegon betegon commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Organization, team, project, and monorepo app pickers now filter their loaded choices as users type, matching names, slugs, and hints with tolerance for small typos, without a separate search input. The /query row stays below the original list viewport as results shrink, including when nothing matches.

Arrow keys navigate the filtered list, Backspace edits the query, and Esc clears it before cancelling. Init and standalone target selection share the Ink control and reuse the CLI's existing fuzzy matcher, with regression coverage for rapid keyboard input, pasted text, terminal cleanup, and narrow-terminal layouts.

Validated with repository typecheck and lint, CLI policy checks and bundle, and all workspace test suites on Linux. The CLI suite passes all 10,659 tests, with 16 skipped.

@betegon
betegon marked this pull request as ready for review October 13, 2026 16:32
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 13, 2026

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread packages/cli/src/lib/init/ui/ink-app.tsx Outdated

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 88b5f4c. Configure here.

candidates.push(option.hint);
}
return fuzzyMatch(query, candidates).length > 0;
});

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.

Fuzzy filter misfires on typed queries

Medium Severity

filterSelectOptions now uses fuzzyMatch, which scores whole-string Levenshtein distance with a minimum threshold of 2. Short queries then keep unrelated short names, and a typo in a prefix of a longer org or project name drops the match until the query is nearly the full string.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 88b5f4c. Configure here.

@betegon
betegon merged commit f29cfde into main Oct 13, 2026
23 checks passed
@betegon
betegon deleted the bt/cli-filterable-selectors branch October 13, 2026 18:11
BYK pushed a commit that referenced this pull request Oct 14, 2026
Follow-up to #1495: use `mode: "search"` for selectors
and autocomplete.

The same matcher serves two cases: 

* resolving names in submitted commands
* suggesting candidates while typing.

`"search"` mode separates their matching rules.

Short queries match literal text only; longer queries tolerate typos in
unfinished prefixes.

```ts
fuzzyMatch("zz", ["UI"], { mode: "search" }); // []
fuzzyMatch("frone", ["frontend-web"], { mode: "search" }); // ["frontend-web"]
fuzzyMatch("frone", ["frontend-web"]); // [] — submitted-command behavior stays unchanged
```

Selectors let users choose a candidate. Command recovery automatically
uses a sole match, with a warning. Applying search rules globally would
therefore change which project a command uses, or make an existing
recovery ambiguous:

```ts
const projects = ["sentry", "sentry-relay"];
fuzzyMatch("senry", projects); // ["sentry"]
fuzzyMatch("senry", projects, { mode: "search" }); // ["sentry", "sentry-relay"]
```

The mode keeps these policies separate while reusing the same matcher.
Regression tests cover both search behavior and unchanged command
resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant