You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add injectable production-default seams for clipboard, Cmd+V, audio capture, transcription, enhancement, pasting, and overlay presentation
add hardware-free tests for clipboard transactions and the primary dictation success/failure paths
preserve complete clipboard contents by cancelling auto-paste whenever any declared representation cannot be snapshotted safely
surface clipboard-preservation cancellation as a recoverable error instead of incorrectly showing success
use two-phase pasteboard writes so failed preparation cannot clear the current clipboard
cover stale captures, short-recording padding, enhancement fallback, error recovery, second-paste handling, external clipboard changes, empty clipboards, and auto-paste-off behavior
move S02 to pass with 38 tests and synchronized conformance evidence
Privacy tradeoff
For protected, promised, or otherwise unreadable clipboard representations, OpenWritr fails closed instead of restoring only a readable subset. This intentionally prefers preserving the user’s entire clipboard over completing automatic paste, and the overlay now explains the cancellation.
Validation
swift build -c release -Xswiftc -warnings-as-errors
swiftlint lint --strict
swift test — 38 tests
conformance check — Healthy, 85 passes
signed app bundle and synthetic self-test
targeted mutation checks for every new behavioral invariant
The reason will be displayed to describe this comment to others. Learn more.
No high-confidence, actionable HIG defects were found. This PR is a pure protocol-extraction refactor for testability/dependency injection (AudioCapturing, TranscriptEnhancing, TextPasting/PasteboardManaging/PasteCommandPosting, OverlayPresenting, Transcribing), plus minor behavioral tweaks (transcript padding moved to a shared TranscriptionInput.paddedIfNeeded helper, doneDisplayDuration/transientErrorDisplayDuration made injectable constants, and clipboard-restore now cancels on any unreadable/incomplete representation instead of silently dropping it). None of the changed files (AudioEngine.swift, GrammarEnhancer.swift, OpenWritrApp.swift, OverlayPanel.swift, PasteManager.swift, TranscriptionManager.swift) touch SwiftUI view bodies, layout, colors, text styles, focus/keyboard handling, or accessibility labels; no Settings or About view source is modified. Rendered surfaces reviewed, all consistent between variants with no legibility, contrast, layout, or scaling regressions observed: Settings light, dark, and light with accessibility larger text; About light, dark, and dark with accessibility larger text; Overlay listening, transcribing, enhancing, done, and error in both light and dark. The clipboard-restore behavior change, cancelling the paste instead of partially restoring an incomplete snapshot, is a defensive improvement for clipboard-integrity privacy but has no visible UI surface to evaluate from screenshots alone, so it is not reported as a defect.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the rendered macOS UI evidence for this PR (Settings, About, and overlay surfaces in light/dark, plus larger accessibility-text Settings and About variants) against the diff.
No high-confidence, actionable HIG defects found.
The diff for this PR is almost entirely internal refactoring and logic hardening:
Protocol-oriented dependency injection for AudioEngine -> AudioCapturing, PasteManager -> TextPasting, TranscriptionManager -> Transcribing, GrammarEnhancer -> TranscriptEnhancing, and OverlayPanel -> OverlayPresenting (enables testability; no behavioral or visual change).
Clipboard-safety hardening in PasteManager.swift: paste now cancels (rather than silently proceeding) if any pasteboard representation can't be read/restored, surfaced via a new .pasteRuntimeErrorKind and presentPasteCancelledError().
TranscriptionInput.paddedIfNeeded extraction (no behavior change) and configurable doneDisplayDuration/transientErrorDisplayDuration for test injection.
None of this touches the SwiftUI view code for Settings or About, so the corresponding screenshots are unaffected by this PR. The OverlayPanel diff only adds a protocol conformance with no rendering changes, and the new .paste error path reuses the existing .error(overlayMessage) overlay rendering already exercised by overlay-error-light.png/overlay-error-dark.png, which render with legible, appropriately contrasted text in both appearances.
The one user-facing change -- adding .paste alongside .transcription in MenuBarView.swift's error-menu switch, and its "Dismiss Error" button/transient auto-dismiss -- is not depicted in any of the provided screenshots (no menu-bar dropdown capture was included), so I can't verify its rendering and won't speculate on unrendered behavior.
Rendered surfaces and variants reviewed:
Settings: light, dark, light (accessibility text size)
About: light, dark, dark (accessibility text size)
Overlay: listening, transcribing, enhancing, done, error -- each in light and dark
Reconcile unreadable clipboard behavior with acceptance criteria
Sources/OpenWritr/PasteManager.swift:272
The linked #55 acceptance criteria still explicitly requires the unreadable-clipboard case to paste successfully (issue #37) and excludes user-visible behavior changes, but this branch now returns .cancelled for any unreadable declared representation. Because this PR closes #55 and marks S02 healthy, please reconcile the requirement—either update the issue/evidence to record this intentional fail-closed scope change or preserve the required behavior.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all prepared surfaces and variants: Settings (light, dark, light-accessibility-text), About (light, dark, dark-accessibility-text), and the six overlay states (listening, transcribing, enhancing, done, error) in light and dark. No high-confidence, actionable HIG defects were found that are introduced or exposed by this PR's rendered UI. Notes: Settings.swift and About.swift are not touched by this diff, so those screenshots show no PR-attributable regressions. The diff's UI-visible surface is the new .paste runtime-error kind (overlay error state plus the MenuBarView Dismiss Error action) and the doneDisplayDuration/transientErrorDisplayDuration injection. The new Clipboard could not be preserved; paste cancelled overlay message (the longest error string in the app) fits within the overlay's constrained error text region (lineLimit 2, truncationMode tail) without visible clipping or contrast loss in either light or dark, matching the existing error-state color, icon, and motion treatment used for other runtime errors. The underlying PasteManager cancellation-logic issues (nil pasteboardItems handling, restore-before-write ordering, delayed-restore failure tracking, and the recovery-suggestion text versus actual transcript availability) are already tracked in this PR's existing review threads and are not duplicated here. No further action requested from this pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Privacy tradeoff
For protected, promised, or otherwise unreadable clipboard representations, OpenWritr fails closed instead of restoring only a readable subset. This intentionally prefers preserving the user’s entire clipboard over completing automatic paste, and the overlay now explains the cancellation.
Validation
swift build -c release -Xswiftc -warnings-as-errorsswiftlint lint --strictswift test— 38 testsCloses #55
Closes #44