Skip to content

Test the code card's copy action without the system clipboard - #286

Merged
nicosuave merged 2 commits into
native-conversation-workspacesfrom
hermetic-copy-test
Nov 16, 2026
Merged

nicosuave merged 2 commits into
native-conversation-workspacesfrom
hermetic-copy-test

Conversation

@nicosuave

Copy link
Copy Markdown
Owner

shortCodeCardHasTightGeometryAndCopiesExactOriginal wrote to NSPasteboard.general and read it back. In sidequery/mono's "Memex runtime integration" job that read has returned nil since 2026-10-26: the job passed on every runner through 2026-10-25 and has failed on every runner since, with the same pinned Memex revision, and this is the only test that fails in the recent runs. So the runners stopped giving tests a usable clipboard, and that job has been red for every change to the agent packages.

The test also overwrote and then restored whatever the developer had last copied.

CodeContentView now sends the copied code through a copyToClipboard closure that defaults to the general pasteboard, and the test replaces it. The other two clipboard call sites are untouched.

Checked locally: with MEMEX_HISTORY_ONLY=1, the changed test and codeDisplayRemovesOnlyOneTerminalNewline pass; cargo fmt --check and cargo clippy -- -D warnings pass. Not checked here: the runtime-enabled build and the full suite. The real check is the mono job with its pin on this commit, which is being run from a draft pin bump in sidequery/mono.

This targets native-conversation-workspaces because that is the branch sidequery/mono pins.

shortCodeCardHasTightGeometryAndCopiesExactOriginal wrote to
NSPasteboard.general and read it back. On the sidequery/mono runners the
read has returned nil since 2026-10-26, on every runner and with the same
pinned code that passed there the day before, so the Memex runtime
integration job has been red since then. The test also overwrote and then
restored whatever the developer had last copied.

CodeContentView now sends the copied code through a replaceable
copyToClipboard closure that defaults to the general pasteboard, and the
test substitutes it.
Clippy in Rust 1.100 extends needless_bool to an `if` that returns true
followed by a trailing false, so CI's `cargo clippy -- -D warnings` fails on
this closure. Behaviour is unchanged.
@nicosuave
nicosuave merged commit 9485e48 into native-conversation-workspaces Nov 16, 2026
11 checks passed
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