feat(vscode): add slash command autocomplete quick actions - #802
feat(vscode): add slash command autocomplete quick actions#802hiarun02 wants to merge 3 commits into
Conversation
|
@hiarun02 Thanks for the PR! I like the overall direction, but I don't think it's ready to merge yet. I noticed a few things that should be addressed first:
Once these are addressed, I'd be happy to review it again. Overall, the feature is heading in the right direction. |
|
Thanks! I only modified 5 files, all within the VS Code extension. Could you clarify which unrelated changes you're referring to? Is it the formatting changes ' → ", or something else? |
|
Hi @hiarun02, thanks for following up! To answer your question about the unrelated changes: Yes, it is exactly the formatting changes ( The Nanocoder project uses Biome with strict formatting rules (tabs, single quotes). Because your editor is likely running Prettier or a different local formatter, it rewrote hundreds of lines of code in Please revert the formatting changes so the PR only highlights the actual logic you added. Running In addition to the formatting, here is what still needs to be addressed before we can merge: 1. Data Safety: Hidden Prompt Persistence
2. Test Coverage
3. Changeset Missing
Once the formatting churn is removed and the history pollution is fixed, we'll be good to go! |
|
Hey @hiarun02, are you still working on this issue? Just wanted to check in on the progress. |
- Add /test, /explain, /doc dropdown in chat input - Template text injected into textarea on selection - What user sees is exactly what gets sent to AI - Add 6 tests in chat-webview-provider.spec.ts - Add changeset for patch release
akramcodez
left a comment
There was a problem hiding this comment.
Hey @hiarun02, thanks for the update! I checked the latest PR state and the overall implementation direction looks good. The previous formatting churn and hidden-prompt persistence issue are resolved, and the scope is now clean.
There are a few things I'd like you to address before we merge:
-
Tests: The new
chat-webview-provider.spec.tstests duplicate theSLASH_COMMANDSdata instead of testing the actual implementation. This means the tests can pass even if the real slash-command logic breaks. Please add tests that exercise the actualchat-panel.jslogic (or move the command definitions into a shared module that both the implementation and tests import). -
Slash detection: The current regex can trigger on URLs/paths ending with
/, e.g.https://or/tmp/. This could cause the user's input to be unexpectedly replaced by a command template. Please tighten the matching logic so/is only treated as a slash command when it's actually being used as one. -
PR description: The implementation no longer uses hidden prompt metadata or modifies
chat-webview-provider.ts; the command template is now inserted directly into the textarea, which is actually the safer approach. Please update the PR description so it reflects the current implementation. -
Accessibility: Please add the appropriate
role="listbox"/role="option"and selection state to the slash-command dropdown, following the existing mention-dropdown pattern.
The first two are the main blockers for me. Once those are addressed, I think we're very close to merging this. Thanks!
|
@akramcodez, Thanks for the detailed review, I’ll address the tests and slash detection first, then update the PR description and accessibility changes. Appreciate the feedback I’ll push the updates soon. |
|
Updated the PR based on the latest review feedback:
I also manually verified the behavior and recorded a video showing Screen.Recording.2026-08-22.at.1.19.24.AM.mov |
Description
This PR adds slash-command quick actions to the VS Code extension chat input.
Typing
/in the Nanocoder chat box opens an autocomplete menu with quick actions like:/test/explain/docWhen the user selects one of these commands, the command inserts a visible, editable prompt template directly into the textarea. For example, selecting
/explaininserts:Explain the following clearly:This keeps the prompt transparent: the user sees exactly what will be sent to the AI, and no hidden prompt prefix is persisted in backend chat history.
This keeps the existing
/clearbehavior intact and only adds new quick-action support on top of the current slash-command flow.Why
Users often repeat the same kinds of prompts, like asking for tests, explanations, or documentation. This feature makes those actions faster and less repetitive in the VS Code extension.
What changed
/autocomplete in the chat input UI/test/explain/dochttps://and/tmp/do not trigger command replacement/clearflowFiles changed
plugins/vscode/media/chat-panel.htmlplugins/vscode/media/chat-panel.jsplugins/vscode/media/slash-command-utils.jsplugins/vscode/src/chat-webview-provider.tsplugins/vscode/src/chat-webview-provider.spec.ts.changeset/vscode-slash-command-actions.mdType of Change
Changeset
Testing
Automated Tests
.spec.tsfilesManual Testing
/autocomplete shows commands/explaininsertsExplain the following clearly:into the textarea/clearbehavior is preservedNotes