Add a Copy button to the Diagnostics dialog

Aberta Para iniciantes
#2 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
88/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
html, javascript, rust, tauri
Domínio
desktop-dev, frontend

Direção de pesquisa

Comece pela marcação diagnostics-dialog em ui/index.html, dentro de .dialog-actions ao lado de #diagnostics-save, depois na seção de diagnósticos de ui/main.js, onde está o manipulador de clique de salvar. Adicione um botão #diagnostics-copy que chame navigator.clipboard.writeText com o texto de #diagnostics-text e escreva o sucesso ou a falha em #diagnostics-message. Concluído quando o texto copiado corresponder exatamente ao diálogo, uma confirmação ou erro for exibido e cargo build --workspace continuar passando.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Rust
Estrelas
7
Forks
1
Merge médio
6h 34min
PRs com merge (30d)
2

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de CodingRule/Hidely

Todas as issues de CodingRule/Hidely

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.