Add a Copy button to the Diagnostics dialog

Đang mở Phù hợp với người mới
#2 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
html, javascript, rust, tauri
Lĩnh vực
desktop-dev, frontend

Hướng nghiên cứu

Bắt đầu với đoạn markup diagnostics-dialog trong ui/index.html, bên trong .dialog-actions cạnh #diagnostics-save, sau đó đến phần diagnostics của ui/main.js nơi có trình xử lý nhấp nút lưu. Thêm nút #diagnostics-copy gọi navigator.clipboard.writeText với nội dung trong #diagnostics-text và ghi kết quả thành công hoặc lỗi vào #diagnostics-message. Hoàn thành khi nội dung đã sao chép khớp chính xác với hộp thoại, hiển thị xác nhận hoặc lỗi, và cargo build --workspace vẫn thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
7
Fork
1
Merge trung bình
6 giờ 34 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CodingRule/Hidely

Tất cả issue của CodingRule/Hidely

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.