[2/5] feat(muya): add accessible code copy and clipboard feedback by Jocs · Pull Request #5800 · marktext/marktext · GitHub
Skip to content

[2/5] feat(muya): add accessible code copy and clipboard feedback - #5800

Merged
Jocs merged 1 commit into
developfrom
split/muya-code-copy-feedback
Oct 20, 2026
Merged

Jocs merged 1 commit into
developfrom
split/muya-code-copy-feedback

Conversation

@Jocs

@Jocs Jocs commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Relates to #3688, #4532, #3745. Split from #5793, which stays open as layer 5.

Review stack

Review and merge in this order. Each PR targets the preceding branch, so its Files changed tab contains only its own layer.

Layer PR Responsibility
1 #5799 Muya asynchronous target validation
2 #5800 Accessible code copying and clipboard feedback
3 #5801 Muya read-only mode and reading interactions
4 #5802 MarkText document state, IPC and save protection
5 #5793 MarkText controls, menus, shortcuts and shell localization

After a preceding PR merges, retarget/rebase its successor onto develop before merging it. Keep intermediate branches until their downstream PR has been retargeted. #5793 is the original PR, retained and reused.

Summary

Make code-block copying keyboard accessible with a native button, an accessible name and localized success/failure feedback. Add an optional clipboard writer callback that reuses the existing window.electron.clipboard.writeText() API. Upgrade that API to return Promise<boolean> via one invoke/handle path and remove the former send/on path and send-channel contract. Keep the cursor regression aligned with the button element.

Type of change

  • New feature (non-breaking)

Test plan

  • Regression tests included with this layer.
  • Muya full unit suite: 295 files / 2765 tests passed. Desktop unit suite: 103 files / 1128 tests passed. Clipboard API, failure/success feedback, existing heading-anchor copying and cursor E2E: 10 passed. Root/Muya ESLint and typechecks, and desktop build passed.
  • Automated browser/Electron checks run on macOS where listed.

Notes for reviewers

Layer 2/5 of a linear PR stack. Review the diff against this PR’s base branch; merge in order. The next layer is rebased/retargeted after this one lands.

Follow-up review

Unified resolved/rejected clipboard failure feedback, including the accessible label and timed reset. Removed copy-button visibility updates duplicated in key handlers; update() owns this state. Independent Muya suite: 2765 tests passed.

Changes remain in their owning layer; all five existing PRs are retained. Additional IME handling was deferred as requested.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5800:

Run: https://github.com/marktext/marktext/actions/runs/39402038545

Artifact Size Link
marktext-macos-arm64 300.3 MB Download
marktext-windows-arm64 291.1 MB Download
marktext-linux-x64 667.6 MB Download
marktext-linux-arm64 522.5 MB Download
marktext-macos-x64 313.7 MB Download
marktext-windows-x64 299.2 MB Download

@Jocs
Jocs force-pushed the split/muya-async-target-validation branch from 75bf891 to 3667d37 Compare October 20, 2026 08:54
@Jocs
Jocs force-pushed the split/muya-code-copy-feedback branch 3 times, most recently from ade176c to 97454e9 Compare October 20, 2026 09:23
@Jocs
Jocs force-pushed the split/muya-async-target-validation branch from 3667d37 to 024bebe Compare October 20, 2026 09:23
@Jocs
Jocs force-pushed the split/muya-code-copy-feedback branch from 97454e9 to 7a9f072 Compare October 20, 2026 09:25
@Jocs
Jocs force-pushed the split/muya-code-copy-feedback branch from 7a9f072 to 6e56326 Compare October 20, 2026 09:37
@Jocs
Jocs changed the base branch from split/muya-async-target-validation to develop October 20, 2026 09:37
@Jocs
Jocs merged commit deb03a7 into develop Oct 20, 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.

1 participant