uttrflow / uttrflow/uttrflow-swift
Typing an alias with its slash hides the clip in the clipboard panel until the whole alias is typed
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
A clipboard clip's alias is saved and matched without its leading slash (`PanelAlias.handle`, `Sources/UttrflowUX/PanelAlias.swift:27-32`), and the panel's exact-alias test uses that reduction (`PanelSnapshot.isAlias`, `Sources/UttrflowUX/PanelResults.swift:134-140`). The partial match, which is what finds a clip while the user is still typing, does not: it searches the raw query, slash and spaces included, inside the alias, category and text (`field(matching:in:locale:)`, `:126-132`).
So typing the alias with its slash hides the clip for every keystroke until the last one. Measured with a throwaway test over `PanelFixture` (one clip aliased `pgprod` whose text contains no such letters):
| Query | Expected rows | Actual rows |
|---|---|---|
| `/p`, `/pg`, `/pgpro` | 1 | 0 |
| `/pgprod` | 1 | 1 |
| `pgp` | 1 | 1 |
| `pg pr` | 1 | 0 |
| `pg prod` | 1 | 1 |
## Why it matters
The alias field accepts and shows the slash form, so it is natural to type it. The row the user is reaching for disappears as soon as they start and comes back only when the name is complete, which looks as though the clip was lost and defeats search-as-you-type for aliases.
## How to reproduce
In `Tests/UttrflowUXTests/PanelResultsTests.swift`:
```swift
let clip = PanelFixture.clip("a connection string", alias: "pgprod")
#expect(PanelFixture.panel([clip], query: "/pg").results.rows.count == 1)
```
## Acceptance criteria
- The alias field is matched partially through the same `PanelAlias.handle` reduction as the exact test, so `/pg`, `/PG` and `pg pr` find a clip aliased `pgprod` as an alias match.
- Category and content matching are unchanged (a slash typed as part of a path still searches text as it does now).
- Tests pin the table above.
## Where to start
- `Sources/UttrflowUX/PanelResults.swift:126-140`.
- Tests: `Tests/UttrflowUXTests/PanelResultsTests.swift`, `Tests/UttrflowUXTests/PanelAliasTests.swift`.
- Run `make verify` (export `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer` first) and read CONTRIBUTING.md.
**Size:** XS, under an hour.
Contributor guide
Research direction
Start in Sources/UttrflowUX/PanelResults.swift around lines 126-140 and compare partial matching with PanelAlias.handle and the exact-alias test. Run the focused tests in Tests/UttrflowUXTests/PanelResultsTests.swift and PanelAliasTests.swift; done means the table's slash and spaced-alias queries find the clip while category and content matching remain unchanged, followed by make verify.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 90/100