Skip to content

Studio Code TUI: sort slash command autocomplete alphabetically - #4116

Merged
youknowriad merged 2 commits into
trunkfrom
sort-slash-commands-alphabetically
Jul 8, 2026
Merged

Studio Code TUI: sort slash command autocomplete alphabetically#4116
youknowriad merged 2 commits into
trunkfrom
sort-slash-commands-alphabetically

Conversation

@youknowriad

@youknowriad youknowriad commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

The change and tests were written by Claude Code (Fable 5), guided and reviewed by the author. AI also traced how pi-tui's fuzzyFilter orders suggestions to confirm the scoring behavior is unaffected.

Proposed Changes

  • When you type a bare / in the Studio Code TUI, the command popup previously listed commands in their source-definition order, which was almost-but-not-quite alphabetical (e.g. api-key after clear) and always showed skill commands last. It now lists them alphabetically, making commands easier to scan and predict.
  • Once you start typing a query, ordering is unchanged: fuzzy-match scoring still ranks best matches first. Equal-score matches now tie-break alphabetically instead of by definition order.

Testing Instructions

  • npm run cli:build && node apps/cli/dist/cli/main.mjs ai
  • Type / in the composer — the command list should be alphabetical (api-key, browser, clear, …) with skill commands interleaved rather than appended at the end.
  • Type /p — fuzzy ranking still applies (preview, provider, publish ranked by match quality).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing f42ae74 vs trunk

app-size

Metric trunk f42ae74 Diff Change
App Size (Mac) 1412.01 MB 1411.51 MB 0.50 MB ⚪ 0.0%

site-editor

Metric trunk f42ae74 Diff Change
load 723 ms 756 ms +33 ms ⚪ 0.0%

site-startup

Metric trunk f42ae74 Diff Change
siteCreation 6512 ms 6499 ms 13 ms ⚪ 0.0%
siteStartup 2393 ms 2390 ms 3 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@youknowriad
youknowriad merged commit c5ff752 into trunk Jul 8, 2026
12 checks passed
@youknowriad
youknowriad deleted the sort-slash-commands-alphabetically branch July 8, 2026 10:34

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

Change looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants