Add a Copy button to the Diagnostics dialog

未关闭 适合新手
#2 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
html, javascript, rust, tauri

调研方向

从 ui/index.html 中 .dialog-actions 内、#diagnostics-save 旁边的 diagnostics-dialog 标记开始,然后查看 ui/main.js 中诊断部分的保存点击处理函数。添加一个 #diagnostics-copy 按钮,调用 navigator.clipboard.writeText 复制 #diagnostics-text 中的文本,并将成功或失败信息写入 #diagnostics-message。完成标准:复制的文本与对话框内容完全一致,能显示确认或错误信息,并且 cargo build --workspace 仍然通过。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Rust
星标
7
派生
1
平均合并
6 小时 34 分钟
30 天内合并 PR
2

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CodingRule/Hidely 的其他 Issue

查看 CodingRule/Hidely 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。