uttrflow / uttrflow/uttrflow-swift
The clipboard panel's ⌘-chord and Escape handling lives in an excluded SwiftUI file, so none of it is tested
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
`Sources/Uttrflow/Panel/QuickPanelView.swift` is excluded from coverage as "SwiftUI, drawn from a tested presentation" (`Scripts/coverage_report.py`), but it holds keyboard decisions of its own:
- `commandKey(_:)` (line 911): ⌘Z sends `.undoDelete`, ⌘⏎ sends `.returnPlain`, anything else goes to `commandDigit`.
- `commandDigit(_:)` (line 926): ⌘1…⌘9 send `.category(number:)`, and any other ⌘-key is ignored so it reaches the search field.
- `relayKey(_:)` (line 934): Escape closes an open row menu instead of the panel; any other key closes the menu and is then sent.
None of this has a test, while the controller side (`PanelKey`, `Sources/UttrflowUX/PanelKeyboard.swift`) does.
## Why it matters
These are the shortcuts people use most in the panel. A change that makes ⌘0 or ⌘C get swallowed, or Escape close the whole panel with a menu open, passes `make verify`.
## Acceptance criteria
- A small pure type in `Sources/UttrflowUX/` (for example `PanelChord`) takes the pressed characters, whether ⌘ is held, whether the key is Return or Escape, and whether a row menu is open, and returns what should happen: a `PanelKey`, a `PanelIntent`, close the menu, or ignore.
- `QuickPanelView` calls it and keeps only the SwiftUI plumbing.
- Tests cover ⌘Z, ⌘⏎, ⌘1, ⌘9, ⌘0, ⌘C (ignored), Escape with and without an open menu, and a non-⌘ key.
- Behaviour in the app is unchanged.
## Where to start
- `Sources/Uttrflow/Panel/QuickPanelView.swift` lines 905-950.
- `Sources/UttrflowUX/PanelKeyboard.swift`; tests to extend or sit beside: `Tests/UttrflowUXTests/PanelScopeTests.swift` and `PanelEndToEndTests.swift`.
- Read [CONTRIBUTING.md](https://github.com/uttrflow/uttrflow-swift/blob/main/CONTRIBUTING.md) first, and say on this issue that you are taking it.
- Before pushing, run `make verify` (with `DEVELOPER_DIR` pointing at Xcode 26.6 or later). It is the same command CI runs.
**Size:** S, about 2 hours.
Contributor guide
Research direction
Read CONTRIBUTING.md first, then inspect keyboard handling around lines 905-950 of Sources/Uttrflow/Panel/QuickPanelView.swift and compare it with Sources/UttrflowUX/PanelKeyboard.swift. Extract the decisions into a pure type in Sources/UttrflowUX/, add coverage in PanelScopeTests.swift or PanelEndToEndTests.swift for the listed chords and menu behavior, and run make verify. Done means the tests cover every acceptance case while app behavior is unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- desktop, testing
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100