Skip to content

refactor(emcn): share code-header copy action - #8247

Open
BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
codex/emcn-next-copy-code
Open

BillLeoutsakosvl346 wants to merge 2 commits into
stagingfrom
codex/emcn-next-copy-code

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

Add a shared code-header appearance to EMCN CopyCodeButton and migrate its two matching chat code-header consumers. Keep the third, distinct consumer on the default appearance. Give the icon-only button a stable accessible name while preserving copied/check feedback.

Base and validation

Targets live staging at 316fea02ec. Six EMCN tests cover both appearances, clipboard copying, the temporary Check icon, and the accessible name. EMCN and app type checks, Biome, and diff whitespace checks passed. Independent source review found no remaining code blocker.

Matched source-derived captures cover light/dark, 16px/20px root text, and rest/hover/focus/disabled states. Computed visual styles match in all 16 pairs; 15 pairs are pixel identical, and one unchanged manifest-card border differs by at most 2/255 in 23 pixels. Evidence is stored outside the product checkout.

The local design diff check and comparable full scans are queued. Keep this PR unmerged until those results, both bot reviews, all required checks, and all review threads are complete.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile review this PR

@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 24, 2026 7:18pm UTC

Request Review

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge from this code review, subject to the required checks and reviews noted by the author.

Summary

The PR centralizes the code-header appearance for CopyCodeButton, applies it to two matching chat code headers, and adds an accessible name and component tests.

  • The previous test-coverage finding is resolved: both appearances now have class assertions.
  • No new actionable issue was identified in the PR changes.

Reviews (2) · Last reviewed commit: "test(emcn): assert copy code appearances"

Comment thread packages/emcn/src/components/code/copy-code-button.test.tsx
@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

Visual review: code-header copy action

What changed: Both code-block headers now ask EMCN CopyCodeButton for the same code-header appearance. EMCN owns the muted ink and hover colours; the workspace caller keeps its local -mr-2 layout offset. The button also gets the accessible name “Copy code.” The copy/check interaction remains in the shared component.

// Before — workspace code header
<CopyCodeButton
  code={codeString}
  className='-mr-2 text-[var(--text-tertiary)] hover-hover:bg-[var(--surface-5)] hover-hover:text-[var(--text-secondary)]'
/>

// After
<CopyCodeButton code={codeString} appearance='code-header' className='-mr-2' />

What to inspect: Header button size, muted ink, hover fill, focus, and disabled appearance. These are labeled isolated renders of the actual EMCN button with source-derived chat code headers and product CSS, captured against staging 316fea02ec; they are not authenticated chat-route screenshots. The current PR diff at 1312c6d158a1 retains this treatment. Across the full light/dark × 16px/20px × rest/hover/focus/disabled capture set, computed button and icon geometry and colours matched. The four representative pairs below are pixel identical.

Theme / root text / state Before After
Light / 16px / rest Before copy action, light 16px rest After copy action, light 16px rest
Dark / 16px / hover Before copy action, dark 16px hover After copy action, dark 16px hover
Light / 20px / focus Before copy action, light 20px focus After copy action, light 20px focus
Dark / 20px / disabled Before copy action, dark 20px disabled After copy action, dark 20px disabled

This branch was successfully deployed

1 active deployment
Preview — 1312c6d1 Deployed Sep 24, 2026 by vercel[bot]
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