Skip to content

feat: cleaner, smaller code block copy button - #633

Draft
eszlamczyk wants to merge 3 commits into
feat/51/code-block-highlighter-treesiter-vendorfrom
feat/51/code-block-button-polish
Draft

feat: cleaner, smaller code block copy button#633
eszlamczyk wants to merge 3 commits into
feat/51/code-block-highlighter-treesiter-vendorfrom
feat/51/code-block-button-polish

Conversation

@eszlamczyk

@eszlamczyk eszlamczyk commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What/Why?

Makes the code block copy button look cleaner: the iOS doc.on.doc SF Symbol is rendered a touch smaller at a regular (not medium) weight, and the Android header + context-menu icons are redrawn as matching portrait doc.on.doc / doc.text shapes so both platforms look the same.

Testing

Open a flavor="github" code block and compare the header copy button and long-press context-menu icons across iOS, macOS, and Android.

iOS Android
image image

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refines the visual design of the fenced code block “copy” affordance to better match iOS’s doc.on.doc SF Symbol across platforms, making the iconography cleaner and more consistent between iOS/macOS and Android.

Changes:

  • iOS/macOS: adjust the copy icon’s SF Symbol point size and weight independently from the header label.
  • Android: replace the previous rounded-rect “copy” icon with a custom-drawn doc.on.doc-style glyph shared between the header button and the context menu.
  • Android: tweak the context-menu “document” icon geometry to better match doc.text.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/react-native-enriched-markdown/ios/views/ENRMCodeBlockContainerView.m Sizes the SF Symbol copy icon smaller and at regular weight (iOS + macOS) via a new independent scale constant.
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/views/CopyGlyph.kt Introduces a shared, custom-drawn copy glyph intended to match SF Symbol doc.on.doc.
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/views/ContextMenuPopup.kt Uses the shared copy glyph for the COPY icon and redraws the DOCUMENT icon for closer visual parity.
packages/react-native-enriched-markdown/android/src/main/java/com/swmansion/enriched/markdown/views/CodeBlockContainerView.kt Updates header copy button sizing and switches the drawable to use the shared copy glyph.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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