uttrflow / uttrflow/uttrflow-swift
An AI suggestion can only be accepted whole; there is no word-by-word accept
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
An AI suggestion can only be taken whole. There is no way to accept part of it, such as its next word.
`KeyRouting.decision` maps the accept key to `.accept(offered[index])`, the whole line (`Sources/UttrflowPredict/KeyRouting.swift:87`). `SuggestionSession.route` inserts that entire text (`Sources/UttrflowPredict/SuggestionSession.swift:288-295`). No stroke (for example ⌥→ or ⌘→) accepts a word, and `ArmedKeys` has no slot for one. The only alternative is to type the wanted part by hand, and typing past a remembered suggestion counts as a rejection (`adopt`, `:325-354`), which after three silences the field (`Quieting.rejectionsBeforeSilence`).
## Why it matters
Model-written prose is often right for a few words and wrong after. Today that is all or nothing: take a line you then have to delete, or type on and teach the field to stop suggesting. That hurts most in long replies and mail, where `Register.replyTokens` asks for a whole reply.
## Acceptance criteria (product decision needed: which key)
- A key accepts up to the end of the next word of the leader (keeping the seam's leading space) and leaves the rest drawn as the new ghost.
- Partial acceptance is recorded as neither a rejection nor a full acceptance in capture.
- The key does not collide with terminals (→ is the terminal accept key) or editors, and is shown in the list footer (`SuggestionPresentation.footer`).
- `KeyRouting`/`ArmedKeys` agreement tests and `Docs/predict-accept.md` are updated.
Contributor guide
Research direction
Start with KeyRouting.decision at Sources/UttrflowPredict/KeyRouting.swift:87, then trace SuggestionSession.route at Sources/UttrflowPredict/SuggestionSession.swift:288-295 and the adopt path at :325-354. Review ArmedKeys, SuggestionPresentation.footer, and the KeyRouting/ArmedKeys agreement tests before resolving which key is product-approved. Done means word-level acceptance preserves the remaining ghost, avoids rejection/full-accept capture, and updates Docs/predict-accept.md.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- desktop, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100