Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add a Copy code button to the final report

Aperta Adatta ai principianti
#318 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
css, html, javascript
Ambito
frontend

Direzione di ricerca

Inizia dal markup dell'editor in web/interview.html, poi trova dove web/interview.js configura l'editor e i suoi gestori di eventi. Aggiungi accanto all'editor un pulsante che legge tutto il testo dell'editor e lo scrive con la Clipboard API, mostra brevemente il messaggio "Copied!", si disabilita quando l'editor è vuoto e intercetta gli errori di permesso. Definiscine lo stile in web/styles.css in modo che corrisponda ai controlli esistenti. È completato quando incollando altrove si ottiene il testo esatto e il contenuto, il cursore e la selezione dell'editor restano invariati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

Currently, candidates need to manually select all text in the code editor and copy it using keyboard shortcuts.

Adding a "Copy code" button would provide a convenient way to copy the current solution for debugging, reviewing, or sharing after practice.

Expected Behavior

  • Add a "Copy code" button near the code editor.
  • Clicking the button copies the entire current editor content to the clipboard.
  • Display brief feedback such as "Copied!" after a successful copy.
  • Disable the button when the editor is empty.
  • Handle clipboard permission errors gracefully.
  • Preserve the editor content, cursor position, and selection.

Suggested Implementation

The relevant files are:

  • web/interview.html — Add the button to the editor interface.
  • web/interview.js — Handle the copy action using the Clipboard API.
  • web/styles.css — Style the button consistently with the existing interface.

Testing

  1. Enter code in the editor.
  2. Click "Copy code".
  3. Paste the clipboard contents into another text editor.
  4. Verify that the copied code matches the original, including whitespace and line breaks.
  5. Verify that clicking the button does not modify the editor content.
  6. Verify the behavior when the editor is empty or clipboard access fails.

Motivation

This small usability improvement reduces repetitive manual actions and makes it easier for candidates to review their code outside CodeTrial.

Lingua principale
Rust
Stelle
160
Fork
64
Merge medio
1g 12h
PR unite (30g)
124

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sysprog21/codetrial

Tutte le issue di sysprog21/codetrial

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.