Skip to content

Fix copied character announcements on macOS - #1150

Merged
trypsynth merged 2 commits into
trypsynth:masterfrom
johanntan:fix/macos-copy-announcement
Oct 21, 2026
Merged

trypsynth merged 2 commits into
trypsynth:masterfrom
johanntan:fix/macos-copy-announcement

Conversation

@johanntan

Copy link
Copy Markdown
Contributor

Copying selected document text with Command+C on macOS only made VoiceOver say “Copy”, because Cocoa handled the shortcut and bypassed Paperback’s character-count announcement. Route the reader’s copy command through the shared copy handler before Cocoa activates the menu item, so VoiceOver announces messages such as “626 characters copied.”

Native copying in editable fields and whole-document copying after Select All are preserved. The Mac keyboard regression test covers command dispatch, clipboard contents, selection preservation, and copying from an editable field.

Validation on macOS:

  • Manually tested with cargo run -p paperback --release: open a document, select text, and copy with Command+C; confirmed VoiceOver announces the copied character count.
  • cargo test --workspace
  • cargo clippy --release --workspace --all-targets (passes with existing warnings)
  • cargo +nightly fmt --all -- --check

Windows and Linux were not tested locally.

johanntan and others added 2 commits October 20, 2026 19:06
Route Command+C in the focused document reader through the shared copy handler
before Cocoa activates the Copy menu item. VoiceOver can then announce the
number of copied characters instead of only the menu label.

Enable the shared selection and whole-document copy path on macOS, remove the
old Mac-only widening helper, and preserve native copying in other controls.
Add native keyboard regression coverage for copying, selection preservation,
keyboard-source cleanup, and editable-field copying.
@trypsynth
trypsynth merged commit ecf2c7b into trypsynth:master Oct 21, 2026
17 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.

2 participants