Skip to content

feat(gui): add a Copy Diagnostics button to the About window#206

Draft
davidbudnick wants to merge 1 commit into
AprilNEA:masterfrom
davidbudnick:feat/diagnostics-report
Draft

feat(gui): add a Copy Diagnostics button to the About window#206
davidbudnick wants to merge 1 commit into
AprilNEA:masterfrom
davidbudnick:feat/diagnostics-report

Conversation

@davidbudnick

@davidbudnick davidbudnick commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Copy Diagnostics button to the About window that copies a privacy-filtered, Markdown diagnostics report to the clipboard for pasting into a bug report. It gives enough detail to reproduce environment-specific issues — device connection, capabilities, missing render images, agent/GUI version skew, asset-cache state — without exposing anything that uniquely identifies the user's hardware.

What it collects

  • App — GUI + agent versions (with a mismatch flag), IPC protocol versions, OS + version + arch, locale, accessibility / input-hook / launch-at-login / menu-bar state, build profile, config schema + configured-device count.
  • Assets — source (app bundle vs user cache), index size, redacted cache path, bundle presence — the signals behind "preview image not loading".
  • Devices (per device) — name, kind, firmware codename, connection type, online, battery, capabilities (buttons/pointer/lighting), DPI, model/config key + wpid + model-ids + ext-model, transports, render state (resolved depot vs silhouette), slot.
  • Receivers — model name + VID/PID.

Privacy

Model-level only. Serial numbers, unit IDs, and the Bolt receiver UID are excluded by construction — the report structs have no field to hold them, so a future edit can't leak one by forgetting to redact. The home directory is redacted to ~ in the cache path.

Design

  • The data shape and Markdown rendering live in openlogi-core (diagnostics.rs) — platform-free and unit-tested.
  • A thin GUI adapter (openlogi-gui/src/diagnostics.rs) maps live AppState (device list, agent status, asset resolver) onto it, refining connection type from the device's announced transports.
  • The GUI now retains the full AgentStatus and the raw inventory snapshot (previously discarded after each poll) so the report can include agent version, hook state, and transports.
  • Clipboard write uses cx.write_to_clipboard(ClipboardItem::new_string(...)); the button confirms with a "Copied!" label for ~2s.

Testing

  • 8 unit tests in openlogi-core cover section rendering, version/protocol mismatch flags, empty/offline devices, the no-serial-or-unit-id guarantee, and direct-connection slot rendering.
  • Verified end-to-end on real hardware (built and ran the GUI), confirming the report renders correctly against a live device:
### OpenLogi Diagnostics

**App**
- OpenLogi (GUI): v0.6.6 (release)
- Agent: v0.6.6 (connected)
- IPC protocol: GUI 1 / agent 1
- OS: macOS 26.4.1 (arm64)
- Locale: en-CA (UI: follow system)
- Accessibility: granted · Input hook: installed
- Launch at login: no · Menu bar: yes · Update check: on
- Running from: source build (dev)
- Config: schema 2 · 0 configured device(s) · thumbwheel 14

**Assets**
- Source: user cache · Index: loaded (210 models) · User cache: present
- Cache path: ~/.local/share/openlogi/assets · Bundle assets: absent

**Devices (2)**
- Receiver: Logi Bolt Receiver (VID 046d / PID c548)
- MX Master 3S — mouse (codename: MX Master 3S)
  - Connection: Logi Bolt receiver · Online: yes · Battery: 35% (discharging, good)
  - Capabilities: buttons=yes, pointer=yes, lighting=no
  - Model: 0b034 (model-ids: b034/0000/0000, ext-model: 00)
  - Transports: BTLE
  - Render: mx_master_3s · Slot 2
- G513 — keyboard (codename: G513 RGB MECHANICAL GAMING KEYBOARD)
  - Connection: Wired (USB) · Online: yes · Battery: n/a
  - Capabilities: buttons=yes, pointer=no, lighting=yes
  - Model: 5c33c (model-ids: c33c/0000/0000, ext-model: 05)
  - Transports: USB
  - Render: g513 · direct

Screenshots

Screenshot 2026-06-10 at 4 26 29 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant