uttrflow / uttrflow/uttrflow-swift
The clipboard formatting sheet draws its whole diff eagerly, thousands of rows at once
- Dominant language
- Swift
- Stars
- 4
- Forks
- 17
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 277
Description
## What happens
`QuickPanelView.diffView(_:)` (`Sources/Uttrflow/Panel/QuickPanelView.swift:809-829`) puts every diff line in a `VStack` inside a `ScrollView` capped at 150 points tall. `VStack` builds every row up front. `TextDiff` allows up to 4,000 changes on texts of up to 20,000 lines (`Sources/UttrflowClipboard/TextDiff.swift:42-48`), so the sheet can build many thousands of rows (up to about 12,000 in a worst case) to show about ten of them.
## Why it matters
Formatting a large code clip is where this sheet is most useful, and that is exactly when opening it stalls the panel.
## How to check
Read lines 809-829. For a feel of it, format a large clip in the panel with `make app`; the delay before the sheet appears grows with the clip.
## Acceptance criteria
- The rows are drawn with `LazyVStack`, so only visible rows are built.
- Row appearance is unchanged: the signs, colours, monospaced font and backgrounds stay as they are, and VoiceOver still reads the rows.
- The pull request says how it was checked (for example, opening the sheet on a clip of a few thousand lines before and after).
`QuickPanelView.swift` is SwiftUI and excluded from coverage, so no unit test is expected. Recomputing the diff on every panel update is a separate, larger issue and is not part of this one.
## Where to start
- `Sources/Uttrflow/Panel/QuickPanelView.swift:809-829`
- Tests to extend: none expected for a SwiftUI view; `make verify` must stay green.
- Before pushing, run `make verify` (export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer first). It is the same command CI runs, and it enforces the 95% coverage floor per module.
- Read [CONTRIBUTING.md](https://github.com/uttrflow/uttrflow-swift/blob/main/CONTRIBUTING.md) first, and say on this issue that you are taking it.
**Size:** XS to S, about 1 hour.
Contributor guide
Research direction
Read CONTRIBUTING.md, then inspect Sources/Uttrflow/Panel/QuickPanelView.swift:809-829 and the diff row styling. Check the clipboard formatting sheet with a large clip, and run make verify with the documented DEVELOPER_DIR setting. Done means the sheet builds visible rows lazily while preserving signs, colours, monospaced styling, backgrounds, and VoiceOver behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, swift
- Domain
- accessibility, desktop, performance
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100