uttrflow / uttrflow/uttrflow-swift
The floating button truncates every failure message to one line and cuts off the part that says what to do
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
The only form of the floating button that shows a failure draws the message with `.lineLimit(1)` inside a fixed 262-point width (`Sources/Uttrflow/Dock/DockView.swift:251-277`, `DockMetrics.noticeMaxWidth = 262`). After the 14-point padding on each side, the 22-point badge, the spacing and, when there is one, the recovery button, the text gets roughly 200 points without a button and about 120 with "Try Again".
Measured with `NSString.size(withAttributes:)` at 13 pt medium, the font the view uses:
| Message (`Sources/UttrflowCore/Errors/`) | Width |
|---|---|
| "Microphone access is required. Turn it on in System Settings to start dictating." | 486 pt |
| "There's no text field to type into. Click where you want the text, then try again." | 485 pt |
| "The text couldn't be inserted or copied. It's kept under Recent in the menu bar." | 488 pt |
| "Your words were captured, but couldn't be tidied up. The raw text is ready to paste." | 516 pt |
| "Speech recognition couldn't start. Try again, or reinstall it from Settings." | 448 pt |
| "Your dictation history could not be updated on this Mac." | 347 pt |
| "No microphone was found. Connect one and try again." | 336 pt |
| "Recording stopped unexpectedly. Try again." | 272 pt |
Every failure message is wider than the space, most by two to four times, and the second sentence (the instruction) is the part lost. The speech-model lines were deliberately shortened for this form (`SpeechModelLoad.line`, "short enough for its one line"); the failure messages were not. There is no tooltip with the full text.
## Why it matters
The notice is the main feedback for a failed dictation and stays up for 10 seconds (`AppDelegate.failureLingers`). A user sees "Microphone access is requ…" or "Your words were captured, b…" and has to open the menu bar to learn what happened and where their words are.
## How to reproduce
Trigger any failure (for example, unplug the only microphone and dictate) with the floating button on, and read the notice. Or run the width measurement above on the messages in `Sources/UttrflowCore/Errors/`.
## Acceptance criteria
- The full message is readable in the floating button: two lines, a wider form sized to the text, or a short line plus the instruction as the second line, as the speech-model notice already does.
- A unit test fails when a failure message shown in the button would exceed the space available (the view's metrics are constants, so this can be checked without drawing).
- The full message is also available on hover (`.help`) for anything that still has to be shortened.
Contributor guide
Research direction
Start in Sources/Uttrflow/Dock/DockView.swift:251-277 and inspect DockMetrics.noticeMaxWidth, then review the failure messages in Sources/UttrflowCore/Errors/ and the failureLingers setting in AppDelegate. Compare the available notice width with the full messages, add a metrics-based unit test, and verify that the complete failure text is readable or available through .help.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- accessibility, desktop, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100