uttrflow / uttrflow/uttrflow-swift
Test the menu bar's "Getting ready…", "Checking for updates…", countdown and Check for Updates item
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
`Sources/UttrflowUX/MenuBarPresentation.swift`:
- line 384: the status line while the speech model is `.loading` ("Getting ready…");
- line 404: `updateLine(for: .checking)` ("Checking for updates…");
- lines 478-482: the "Check for Updates…" menu item, shown only when `state.canCheckForUpdates`;
- line 508: `listeningLine(for:)` when the recording is near its cap and a remaining-time phrase is shown.
None of these has run under test.
Measured on origin/main `26d7bc1` with `swift test --enable-code-coverage` (5,384 tests, all passing) and `xcrun llvm-cov export` over the test binary. The regions named below have an execution count of 0: no test runs them, so a change that breaks them passes `make verify`.
## Why it matters
The menu bar is where people look when dictation doesn't start. "Getting ready…" is the only sign the model is still loading after launch, and the countdown is the only warning before a long dictation is cut off at the cap. If the Check for Updates item disappears from builds that can update, users have no manual way to update.
## How to reproduce
Run `swift test --enable-code-coverage`, then `xcrun llvm-cov show -instr-profile .build/debug/codecov/default.profdata .build/debug/UttrflowPackageTests.xctest/Contents/MacOS/UttrflowPackageTests Sources/UttrflowUX/MenuBarPresentation.swift` and look for the `0` counts on the lines named above.
## Acceptance criteria
- A state with `speechModel: .loading` gives "Getting ready…".
- `updateLine(for: .checking)` is "Checking for updates…".
- With `canCheckForUpdates: true` the items include a command with intent `.checkForUpdates`. With `false` they don't.
- A listening state whose advice is near the cap gives "Listening… ", using `RemainingTime.phrase(for:)`.
- Each new test fails when the branch it covers is broken. Check this by hand before opening the PR: temporarily change the branch (flip the condition or return the other value), see the test fail, then restore it.
## Where to start
- `Tests/UttrflowUXTests/MenuBarPresentationTests.swift`, suites "What the menu bar says", "What the menu offers" and "Updating, in the menu bar".
Read `CONTRIBUTING.md` first. Iterate with `swift test --filter `, then run `make verify` before pushing. Only tests change; no product code needs to.
**Size:** S, under an hour.
Contributor guide
Research direction
Read CONTRIBUTING.md, then open Tests/UttrflowUXTests/MenuBarPresentationTests.swift and the named suites. Run the focused suite with swift test --filter and add tests for loading, checking, update availability, and near-cap listening states. Done means each acceptance criterion is covered and make verify passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- desktop, testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100