uttrflow / uttrflow/uttrflow-swift
The snippet editor accepts an everyday word as a trigger, which then replaces that word in every dictation
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
A snippet fires wherever its trigger's words are said as a phrase: "Say the trigger anywhere in a sentence and Uttrflow swaps in the text." (`Sources/UttrflowUX/SnippetsPresentation.swift:216-219`). `SnippetExpander.expand` replaces every place the trigger's words appear with nothing glued to either end (`Sources/UttrflowAI/SnippetExpander.swift:21-53`, `fits` at `:57-80`).
The editor accepts any trigger that has at least one word and is not already used (`SnippetsPresenter.problem`, `SnippetsPresentation.swift:274-293`; `SnippetStore.save`, `Sources/UttrflowAI/SnippetStore.swift:41-61`). There is no warning for a trigger that is an everyday word or phrase. A one-word trigger such as "thanks", "address" or "yes" is saved without comment and then replaces that word in every dictation, in every app, from then on. The only feedback is afterwards, in the row's "Used" count.
The empty state's own examples, "an address, a standup format, a sign-off" (`:300-305`), invite exactly the short, common triggers ("sign off", "standup") that also occur in ordinary speech.
## Why it matters
A new user makes a snippet "address" for their postal address, then dictates "what's the address of the venue?" and gets their home address pasted into a message to someone else. That is both confusing and a small privacy leak, and nothing in the editor warned them.
## How to reproduce
Create a snippet with the trigger "address" and any text, then dictate a sentence containing the word "address". Or in a test: `SnippetExpander(snippets: [Snippet(trigger: "address", expansion: "X", created: .now)]).expand("what is the address of the venue")` returns the sentence with "address" replaced by the expansion (read from the matcher above; the expected output is worth pinning in the test this issue adds).
## Acceptance criteria
Product call (hence `needs-info`): warn, refuse, or require a distinctive shape (for example two or more words, or a word that is not in a common-word list)?
Then:
- The editor shows a non-blocking warning (or a refusal) under "When I say" for a trigger that is a single common word, in the product's plain tone, suggesting a more distinctive phrase such as "my home address".
- The empty-state example and footnote steer towards a distinctive trigger.
- Tests in `Tests/UttrflowUXTests/SnippetsPresentationTests.swift` cover the warning.
Contributor guide
Research direction
Resolve the product choice for common-word triggers first. Read SnippetsPresenter.problem and Sources/UttrflowUX/SnippetsPresentation.swift around the editor and empty-state text, then review Tests/UttrflowUXTests/SnippetsPresentationTests.swift. Done means the editor gives the agreed warning or refusal, the guidance favors distinctive phrases, and tests cover it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100