fix(tui): insert skill name without wiping existing prompt text#27584
fix(tui): insert skill name without wiping existing prompt text#27584HaleTom wants to merge 0 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PRs Found#27160 - fix(tui): insert selected skill into prompt Why it's related: This is one of the prior community PRs mentioned in your PR description (by @eyenalxai). It attempted the same fix using The search also correctly identified PR 27584 as the current PR, which should be excluded from the duplicate check per instructions. |
Production Review: fix(tui): insert skill name without wiping existing prompt textChange SummaryA 3-line change to the - input.setText(`/${skill} `)
- setStore("prompt", {
- input: `/${skill} `,
- parts: [],
- })
- input.gotoBufferEnd()
+ input.insertText(`/${skill} `)
+ setStore("prompt", "input", input.plainText)
+ syncExtmarksWithPromptParts()What Changed
Review ChecklistCorrectness
Edge Cases
Risk Assessment
Issues
This won't prevent merging since GitHub will handle the diff correctly against the base branch, but it makes review harder to skim. Recommendation✅ Approve. The change is correct, minimal, and uses established patterns. Please squash-merge to clean up the noisy diff. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
76052f9 to
d353a6b
Compare
9c9775f to
f6c8e35
Compare
|
Replaced by #27632 — this PR got stuck in a closed state after a close/reopen trick during rebasing. |
Issue for this PR
Closes #27578
Type of change
What does this PR do?
When selecting a skill from the TUI skill picker, the skill name is now inserted at the current cursor position using input.insertText() instead of replacing the entire prompt with input.setText(). This preserves any text the user has already typed in the prompt box.
Previously, typing /skill and selecting a skill would destructively wipe the entire prompt — a frustrating UX that has been reported multiple times.
Credits
This fix borrows from and improves upon two prior community PRs:
Both approaches used input.insertText() but differed in how they synced state. This PR combines the best of both: insertText for non-destructive insertion + syncExtmarksWithPromptParts to keep the prompt parts store in sync.
How did you verify your code works?
Manually verified the logic by inspecting the existing patterns in the codebase:
Typechecks: bun run --cwd packages/opencode typecheck passes.
Checklist