Skip to content

feat(clipboard): review and copy combined text - #143

Merged
johnny4young merged 4 commits into
mainfrom
codex/combined-text
Sep 18, 2026
Merged

johnny4young merged 4 commits into
mainfrom
codex/combined-text

Conversation

@johnny4young

@johnny4young johnny4young commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

Review and copy multiple text-backed clips as one plain-text result, preserving visible selection order and leaving PasteStack as sequential paste.

Changes

  • Present an immutable ordered selection snapshot, with reordering and newline, blank-line default or custom separators.
  • Share pure composition with MCP without changing its response contract.
  • Explain missing, incompatible, protected or oversized selections rather than silently dropping or truncating content. Enforce 100 clips and 1 MiB explicitly.
  • Revalidate current metadata, privacy, versions and clipboard revision before copying. No automatic save or paste; cancel preserves the clipboard.
  • Keep native tests isolated from production Keychain, StoreKit and clipboard state; use literal macOS search input without system autocorrection obscuring selection. Include English/Spanish strings and related changelog/tests.

Testing

  • Local format/lint, 1,119 Swift Testing tests / 170 suites, 82.2% package coverage, macOS+iOS builds, release/site checks and unchanged strict compiler-warning checks passed.
  • Focused native flow passed without skips using real discontinuous Command-click selection: exact first/third fixture composition, enabled Copy before cancellation and after reopening, final dismissal and unchanged clip count. Clean synthetic app-window screenshot inspected.
  • Unit coverage includes deterministic ordering, separators/Unicode/limits, incompatibility, disappearance and stale content/metadata/privacy. The same injected MainActor copy operation used by the view now has deterministic tests for a replaced clipboard, revoked eligibility, child-operation cancellation, changed text requiring review, exactly-one write and an empty selection preserving the clipboard. The native flow also exercises cancellation and reopening. Existing MCP and PasteStack suites passed in the full package run.
  • Renewed focusedr5 passed both the complete combination flow and the keyboard filter-rail path without skips. An earlier full run failed the rail assertion; a later focused run encountered an autocomplete window covering the controls. Retained these failures and added explicit first-responder setup, literal search input and a no-overlay assertion; budgets/assertions were not lowered.
  • Final copy feedback uses the existing correction message for blocked/invalid attempts. All headless gates and signed UI compilation were renewed successfully after this last source change. The intentionally interrupted full r2 is retained as incomplete, not success.
  • Full final-source local macOS UI suite passed57 tests/3 existing skips/0 failures after the final correction. The combined flow executed15.867s and the formerly failing keyboard rail executed5.469s. Skips were typed denylist focus and two status-item actions not hittable on this display/Space; no combination feature test was skipped.
  • Inspected final synthetic app-window screenshot BCC3148B-45AB-4474-89D9-18AA13E2AD65.png from combined-text-copy-feedback-full-r3.xcresult: ordered text, separator and Copy controls are visible without any autocomplete overlay.
  • Final head: 23701d17059fdb7c89ef98bcc8a5d6a994a59669.
  • CI passed on that exact SHA:1,119 tests/170 suites/82.2%, four StoreKit tests, macOS+iOS builds. The optional beta canary was skipped by workflow design; no beta SDK was installed.
  • Explicitly dispatched UI workflow also passed on the same SHA. Inspected logs: hosted macOS57 tests/4 skips/0 failures; iOS11 tests/1 skip/0 failures. The combination case executed18.684s and the keyboard-rail regression executed5.627s; neither was skipped.
  • Hosted macOS skips: typed denylist focus; two helper-launch cases requiring Apple Development rather than CI ad-hoc signing; status-menu Settings not surfacing a window on the hosted runner. iOS skipped PasteControl because it was not exposed to its UI runner. These are coverage boundaries, not completed tests.
  • macOS native result and synthetic screenshot artifacts and iOS evidence use the existing14-day retention. The macOS evidence includes the synthetic combined review attachment; no personal clipboard content or full-desktop screenshot was published here.

Risks and boundaries

  • Synthetic UI tests use an injected paste sink; they do not claim an actual cross-application paste roundtrip.
  • No binary/image composition, new dependencies, merge, installation or release.
  • Xcode UI-test dependency scanning emits a separately reproduced main-baseline GRDB diagnostic; it is not suppressed.

@johnny4young johnny4young left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 23701d17059fdb7c89ef98bcc8a5d6a994a59669: three actionable findings are attached inline (one P1 privacy issue and two P2 clipboard/cancellation issues).

Validation:

  • Reviewed the changed composition service, copy operation, macOS sheet/selection integration, MCP reuse, store bootstrap and UI-test harness changes.
  • Local focused Swift Testing run: 24 tests across 6 suites passed (CombinedText, StoreBootstrap, ClipPreviewLoader). An additional review-only parameterized regression test failed for both intrinsically masked kinds as described inline. It was added only in a temporary source snapshot, not to the branch.
  • A synthetic native SwiftUI lifecycle probe reproduced a write after sheet dismissal; a synchronous-cancellation control prevented it. This was not a full Gancho UI run and did not access the system clipboard.
  • The preview native-copy finding is based on the source path and Apple's documented Text selection behavior, not a new keyboard UI test.
  • Inspected existing exact-head CI/UI logs: 1,119 package tests passed; hosted macOS UI reported 57 tests / 4 skips / 0 failures, and iOS 11 tests / 1 skip / 0 failures. Those passes do not cover the findings above. No full local app build or full local UI suite was rerun for this review.

No product changes, commits, pushes, or thread resolutions were made. GitHub currently reports merge conflicts against main; integration with the latest main is not validated by these older exact-head runs.

Comment thread Packages/GanchoKit/Sources/GanchoAppCore/CombinedTextService.swift Outdated
Comment thread Apps/GanchoMac/CombinedTextReview.swift Outdated
Comment thread Apps/GanchoMac/CombinedTextReview.swift Outdated
…d-only preview

Three review findings on combined text:

- `CombinedTextService.load` protected only detector-flagged rows and
  `.secret`, so a bare JWT or card number — stored non-sensitive on
  purpose, masked by every preview — came out in clear in the review
  list and preview. Both metadata checks now use
  `ClipSafePresentation.requiresMasking`, the same policy previews apply.
- Cancel only dismissed; the in-flight copy task was cancelled later in
  `onDisappear`, leaving a window where a resumed store read wrote to
  the clipboard with no sheet left. Cancel (and Escape) now cancels the
  task synchronously before dismissing; the lifecycle hook stays as the
  fallback for private mode and window close.
- The preview's text selection gave ⌘C and the context menu a second
  write path around revalidation and the self-write marker. The preview
  is read-only; the Copy button is the only way out.

Covered by the source-validation test (jwt and creditCard parts read as
protected), the batch revalidation cases (a kind that turns masked
mid-batch), and the native flow, which now sends ⌘C over the open
review and expects nothing to change.
@johnny4young
johnny4young merged commit 83fb61f into main Sep 18, 2026
6 checks passed
@johnny4young
johnny4young deleted the codex/combined-text branch September 18, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant