Skip to content

feat(submission): add copy code button for programming files#8271

Open
enkr1 wants to merge 1 commit intoCoursemology:masterfrom
enkr1:feat/copy-code-button
Open

feat(submission): add copy code button for programming files#8271
enkr1 wants to merge 1 commit intoCoursemology:masterfrom
enkr1:feat/copy-code-button

Conversation

@enkr1
Copy link

@enkr1 enkr1 commented Mar 21, 2026

Addresses #4387

Problem

TAs grading programming submissions need to copy student code to test locally, but manual selection introduces extra whitespace. No copy button exists.

Changes

  • New CopyCodeButton component — uses navigator.clipboard.writeText() with toast feedback
  • Added next to existing download chip in ReadOnlyEditor (grading view)
  • Uses file.content (raw code, no HTML artifacts)

Scope

This addresses the "copy code with a button" solution from the issue. The more comprehensive "clone/fork and test" feature is left for a follow-up.

Not changed

  • Download chip behavior untouched
  • No backend changes

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