Skip to content

In-App Report Issue (CAS-1030)

Finn the Weaver — Frontend Engineer

By the end of this chapter you’ll understand:

  • How the floating button is gated to the regent and hidden from all other profiles
  • What the Rust log ring buffer captures and how it is drained into the issue body
  • Why a 30-second submit timeout was added and what it protects against

In-App Report Issue (CAS-1030)

Delivered in PRs #302–#307 (April 2026).

Overview

Regent-only feature that lets the regent file a GitHub bug report directly from within the running app, attaching a recent log snapshot and an optional screenshot.

How it works

  1. Floating button (FloatingReportButton.tsx) — visible only when the active profile matches the regent’s user ID. Hidden on mobile (iOS/Android) via a platform check.
  2. Report sheet (ReportSheet.tsx) — a bottom-sheet modal that the regent fills in: title + description. On submit it:
    • Calls the report_issue Tauri command, which drains the in-memory log ring buffer (last ~200 log lines) and attaches it as a code block in the issue body.
    • Optionally captures a screenshot via Tauri’s window screenshot API.
    • Opens a GitHub issue in abernerus/casaconomy-app with the log + screenshot attached.
  3. Log ring buffer — a VecDeque<String> capped at 200 entries, populated by the Rust log macros throughout the backend. Drained (not cleared) on each report so subsequent reports capture fresh logs.
  4. Submit timeout (CAS-1045) — a 30-second escape hatch: if the GitHub API call hangs, the sheet shows an error and unlocks the UI rather than spinning indefinitely.

Key files

LayerFile
Frontend buttonsrc/components/FloatingReportButton.tsx
Frontend sheetsrc/components/ReportSheet.tsx
Frontend storesrc/store/useReportIssueStore.ts
Frontend IPCsrc/tauri/reportClient.ts
TS bindingssrc/types/bindings/ReportIssueParams.ts
Rust commandsrc-tauri/src/commands/report_issue.rs

Access control

The floating button is gated on useSettingsStore — specifically the isRegent flag derived from the active profile. Non-regent profiles never see the button or the sheet. The Tauri command performs a second check server-side (regent flag in the settings table) to prevent spoofed invocations.

Limitations / known gaps

  • Screenshot capture is best-effort: if the webview is off-screen or throttled (WKWebView), the screenshot may be blank. The report still files without it.
  • Log ring buffer is in-process only — Rust panics that kill the process before the buffer is drained are not captured.
  • GitHub API call is unauthenticated at the app level; it relies on a PAT stored in the settings table (regent sets this up once in preferences).

Recap

  • A floating button gated behind the isRegent flag opens a report sheet that collects title, description, logs, and an optional screenshot.
  • The Rust backend holds a 200-line ring buffer drained on each report; panics before the drain are not captured.
  • A 30-second timeout prevents the GitHub API call from hanging the UI indefinitely.

What changed {#what-changed}

This feature shipped in CAS-1030. See: CHANGELOG → 2026-05-18