uttrflow / uttrflow/uttrflow-swift

Ten source files over 580 lines, with a suggested split for each

Open
#661 0 comments 0 reactions 0 assignees View on GitHub
area:general enhancement P2
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

## What happens

The ten largest files in `Sources/` on origin/main, with one seam each that moves a self-contained part out. Line ranges are approximate starting points, not a prescription.

| Lines | File | Suggested seam |
|---|---|---|
| 1,930 | `Sources/Uttrflow/AppDelegate.swift` | The second `// MARK: The clipboard` block (about 648-1128: watching, the quick panel, `carryOut(PanelChange/PanelIntent)`, insert and paste) into `AppDelegate+Clipboard.swift`; the private store adapters at the end (about 1845-1930: `DictionaryCorrections`, `StoredSnippets`, `StoreCounters`, `LearnedVocabulary`) into their own file where they can be tested. The `MARK: The clipboard` label appears twice (lines 73 and 648). |
| 1,631 | `Sources/UttrflowEval/EvaluationCorpus.swift` | Pure data: `contextual` (about 607-1418) into `EvaluationCorpus+Contextual.swift` as an extension (#631). |
| 1,083 | `Sources/Uttrflow/Panel/QuickPanelView.swift` | `// MARK: - Sheets` (about 719-902) into a `QuickPanelSheets` view; `RightClickWatch` and `PointerWatch` (about 965-1040) into their own file. |
| 848 | `Sources/UttrflowPipeline/DictationPipeline.swift` | The stages after transcription (`correct`, `tidy`, `finishMessage`, `expand`, about 615-700) and the helper extensions at the end into `DictationPipeline+Cleaning.swift`. |
| 770 | `Sources/Uttrflow/Suggestion/SuggestionCoordinator.swift` | `SuggestionReason` and the snapshot-to-model mappers (`situation(of:for:store:)`, `reading(of:)`, `context(of:at:)`) into a builder outside the main-actor loop. |
| 750 | `Sources/UttrflowUX/SettingsPresenter.swift` | `// MARK: - Suggestions` (about 343-539) into `SettingsPresenter+Suggestions.swift`. |
| 729 | `Sources/UttrflowClipboard/RichTextPlainForm.swift` | The HTML tokenizer and entity tables (about 18-346) into `HTMLTokenizer.swift`, testable without rendering. |
| 728 | `Sources/UttrflowAI/MeaningPreservationGuard.swift` | `// MARK: Checks` for numbers (about 585-728) into `NumberPreservation.swift`. |
| 689 | `Sources/UttrflowLocalModel/MLXCandidateScorer.swift` | The text helpers that never touch MLX (about 235-292 and 404-597) into a file tests can reach without linking MLX. |
| 678 | `Sources/UttrflowUX/PanelPresentation.swift` | The empty-state logic (about 551-678) into `PanelEmptyState.swift`. |

## Why it matters

Files this size are where a newcomer gets lost and where two pull requests collide. Four of them (`AppDelegate`, `QuickPanelView`, `SuggestionCoordinator`, `MLXCandidateScorer`) are also excluded from coverage whole, so a split that moves logic out is also a split that brings it under the floor.

## Acceptance criteria

- One pull request per file, each a move with no behaviour change, and `make verify` green.
- Splits of files with open work against them wait for that work: #572 and #573 add cases to `EvaluationCorpus.swift`.
- Tick the file off here when its split lands.

Contributor guide

Open the contributing guide

Research direction

Choose one source file from the table and read its suggested seam, checking for open work before starting; #572 and #573 affect EvaluationCorpus.swift. Move only the named self-contained section into the proposed file, preserving behavior, then run make verify. Tick the selected file off when its split lands.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
desktop
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.