feat(desktop): set project, host, environment and size with # in the new-workspace composer
Summary
- Typing
#in the new-workspace composer opens a menu for the pickers under it: project, host (local device, Cloud, other hosts), and on Cloud, environment and machine size. Picking an entry removes the typed#tokenand changes the setting. Nothing is added to the prompt. - The placeholder now mentions it, e.g. "Track down that flaky test… · # to change project, host, and more".
- chat-ui fix: the composer's "Add → Attach files" row and
completionQuerydrill-down were hardcoded to@. They now follow the trigger character that opened the menu.
Why / Context
Setting up a workspace meant typing the prompt, then moving to the mouse for up to four pickers. With # you can set them without leaving the keyboard. # is separate from @ on purpose: @ adds context to the prompt (issues, PRs, plugins, files), while # changes workspace settings and adds nothing to the prompt.
How It Works
PromptInputalready supports atriggercharacter per mention provider. The newuseWorkspaceSettingMentionProvidershook returns static#providers. Each entry'sselect()calls the same handler as the matching picker.- In
NewWorkspaceScreen.tsx, the pickers' inline handlers moved into shareduseCallbacks (handleSelectProject,handleSelectHostId,handleSelectEnvironment,handleSelectMachineSize), so the pickers and the#menu run the same logic. - Entries carry their section name as a keyword, so
#env,#size,#hostand#projectfilter to one section. Typing part of a value's name (#large,#pdev) also works. - Environment and size providers only exist when the host is Cloud. The menu rebuilds after a host switch.
#only reaches this screen. The in-workspace chat composer and the channel composer (where#references channels) are unchanged.
Manual QA Checklist
Done in the dev desktop app in a cloud workspace, using real keyboard input via xdotool:
-
#on Local Device shows Project and Host sections. No "Attach files" row. -
#clo+ Enter switches host to Cloud. The token is removed, and the environment and size pickers appear. - On Cloud,
#lists cloud projects (including GitHub App repos).#envlists environments, and picking "Paradev" updates the environment picker. -
#large+ Enter sets the size picker to Large · 8 vCPU · 16 GB. -
Fix the flaky login test #pdev+ Enter keeps the prompt text, removes#pdev, and switches the project. -
@still shows Add / Link / Plugins as before. - Placeholder shows the hint on one line at the default window width.
- Not checked: hosts other than this dev account's, a
completionQueryprovider on a non-@trigger (no such provider exists yet), and narrow windows where the placeholder wraps.
Testing
bunx tsc --noEmitinapps/desktopandpackages/chat-uibunx biome checkon changed filesbun test src/components/PromptInput(chat-ui): 54 passbun testonDashboardNewWorkspaceModal(desktop): 35 passbun run check:i18n: passes, no untranslated messages
No new automated tests. The hook is thin wiring over existing handlers. I'm happy to add one for the trigger-scoped "Add" row in ComposerBody if reviewers want it.
Design Decisions
#instead of@: the@menu is already long and adds references to the prompt. Putting settings there would mix two kinds of action, and names would collide (for example, a "Paradev" project, environment, plugin and task). The placeholder hint makes#easy to discover.- Flat lists, no drill-down: each section is a static provider, so one
#query searches all of them.
Known Limitations
- Translations for the new strings (section keywords, "Machine size", placeholder hint) were written by an agent. A native-speaker pass would help, especially for ja/ko/zh/tr word order.
- Environment and size are remembered per project (existing behavior). Switching the project with
#can reset the environment picker to "Select environment", the same as using the picker.
Summary by cubic
Typing # in the new-workspace composer now opens a menu for the pickers below it: project, host (local device, Cloud, other hosts), and on Cloud, environment and machine size. Selecting an entry removes the typed #token and updates the setting through the same handlers the pickers use; nothing is added to the prompt. The placeholder now shows the hint, and offline hosts are marked as such, matching the device picker.
# stays separate from @: @ adds references to the prompt, while # changes workspace settings and adds nothing. Environment and size entries only appear when the host is Cloud, and the menu rebuilds after a host switch. Only the new-workspace screen is affected; the in-workspace chat and channel composers are unchanged.
Refactors
useMachineSizeOptionsis memoized so an open#menu no longer reloads its entries on each keystroke.- Each section search matches both the translated and English section names, so
#env,#size,#host, and#projectwork in every locale.
Bug fixes
- The composer's "Add → Attach files" row and
completionQuerydrill-down were hardcoded to@; they now follow the trigger that opened the menu.
Summary by CodeRabbit
- New Features
- Use
#in the new workspace prompt to choose a project, host, or session, and—when using a cloud host—an environment or machine size. - Prompt guidance and related labels are available in multiple languages.
- Use
- Bug Fixes
- Mention suggestions now match the active trigger, and file attachment options appear only for the default trigger.