fix(app): complete mentions at cursor (#37941)

Co-authored-by: Brendan Allan <14191578+Brendonovich@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot]
2026-07-20 22:53:10 +08:00
committed by GitHub
co-authored by Brendan Allan
parent 47fc6f2991
commit 4872c48c23
2 changed files with 22 additions and 3 deletions
@@ -26,6 +26,20 @@ describe("prompt input v2 interaction machine", () => {
expect(closed.state.popover).toEqual({ type: "closed" })
})
test("opens context completion at the cursor", () => {
const value = "alpha @sr omega"
const input = persisted(value)
input.cursor = 9
const result = transitionPromptInputV2(
createPromptInputV2InteractionState(),
{ type: "input.changed", value, persist: false },
input,
)
expect(result.state.popover).toEqual({ type: "context", query: "sr" })
})
test("enters shell mode from an initial exclamation mark", () => {
const result = transitionPromptInputV2(
createPromptInputV2InteractionState(),