Add a Copy button to the Diagnostics dialog

Abierto Apto para principiantes
#2 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
html, javascript, rust, tauri

Línea de trabajo

Empieza con el marcado de diagnostics-dialog en ui/index.html, dentro de .dialog-actions junto a #diagnostics-save, y luego con la sección de diagnósticos de ui/main.js donde está el manejador del clic de guardar. Añade un botón #diagnostics-copy que llame a navigator.clipboard.writeText con el texto de #diagnostics-text y escriba el éxito o el error en #diagnostics-message. Terminado cuando el texto copiado coincida exactamente con el del diálogo, se muestre una confirmación o un error, y cargo build --workspace siga pasando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement good first issue

The Diagnostics dialog shows a report and has a Save to Documents button. When someone is filling in a bug report it is quicker to copy the text straight to the clipboard.

What to do

Add a Copy button next to Save to Documents that puts the report text on the clipboard and confirms it.

  • Markup: ui/index.html, in <dialog id="diagnostics-dialog">, inside .dialog-actions. Add a <button id="diagnostics-copy" type="button">Copy</button> next to #diagnostics-save.
  • Behaviour: ui/main.js, in the "diagnostics" section next to the #diagnostics-save click handler. Use navigator.clipboard.writeText(...) with the text already in #diagnostics-text, and write the outcome into #diagnostics-message (for example "Copied to the clipboard.").
  • If copying fails, show the reason in the same message line instead of failing silently.

No styling should be needed: buttons inside dialogs are already styled.

Done when

  • The button appears in the dialog and copies exactly the text shown.
  • A confirmation appears, and an error is shown if the clipboard is unavailable.
  • cargo build --workspace still passes (the UI is embedded in the app at build time).

How to try it

npm install, then npm run dev. Click Diagnostics at the bottom left of the window, press Copy, and paste somewhere.

Lenguaje dominante
Rust
Estrellas
7
Forks
1
Merge medio
6 h 34 min
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CodingRule/Hidely

Todos los issues de CodingRule/Hidely

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.