crates/veilvoice-gui/src/crashreport.rs
veilvoice-gui · 289 lines · read the source here · or on GitHub
Offering the report from the last crash, on the run after it.
What was wrong with where this used to be
A report has been written to disk since v0.1.10, and the interface mentioned it: one line on the About tab saying the previous run ended unexpectedly and where the file is.
About is the last tab somebody who has just had a crash will open. It is where you go to read version numbers. The person this notice is for restarted the application to get back to what they were doing, landed on the tab they were using, and saw nothing. So the report existed, was accurate, was written for a person to read, and was never read by one.
It is now shown above whichever tab you land on, once, on the first run after a crash. That is the panel the application already uses for anything it needs somebody to see whatever they are looking at.
Why it is offered rather than sent
Nothing is transmitted, and nothing here could transmit it: this project contains no network client and CI fails the build if one enters the dependency graph. A crash reporter that uploads is the ordinary shape of this feature and it is the wrong shape for this program, because a report from a tool people use to protect themselves is a report about a person who was being careful.
So the report is shown, in full, in the window. The whole text, not a summary of it, because "would you like to send this" is only a real question if you can read what "this" is. Then two buttons: copy it, and open the issue tracker in a browser. What happens after that is the person's decision and their clipboard.
And it says what is in it, without overpromising
The report carries the version, the operating system and processor, when it happened, the panic message and the source location. VeilVoice puts in no file names, no settings, no passphrase and nothing about the audio.
The panel used to say flatly that the report contains no file names. That is a promise about the panic message, and the panic message is the one part nobody writes in advance. No panic in VeilVoice's own code formats a path -- there is a test for that, in crashlog, and it reads the source rather than trusting the claim -- but a decoder or a toolkit it depends on could put one there, and this program cannot promise on their behalf.
So the panel says what VeilVoice puts in, names the error message as the part that is not written in advance, and offers the whole text to read. A promise that cannot be kept is worse than an accurate description with a button next to it.
WHAT THIS FILE CONTAINS
289 lines defining 3 functions (3 public), 1 type and 3 constants. Everything below is read out of the source, so it cannot disagree with the code.
The types it owns.
struct Offerline 70 · What the panel is showing, kept across frames.
What happens when it runs. These are the ways in: public, and nothing else in this file calls them, so they are what an outside caller reaches first.
Offer::lookline 84 · Read the previous report, if there is one.Offer::waitingline 94 · Whether there is anything to show.Offer::panelline 105 · Draw the offer.
WHAT CALLS WHAT
The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one.
The same graph as Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#1a1b26","primaryColor":"#1f2335","primaryTextColor":"#c0caf5","primaryBorderColor":"#7aa2f7","secondaryColor":"#16161e","tertiaryColor":"#16161e","lineColor":"#737aa2","textColor":"#c0caf5","mainBkg":"#1f2335","nodeBorder":"#7aa2f7","clusterBkg":"#16161e","clusterBorder":"#2f3549","fontFamily":"ui-monospace, SFMono-Regular, Consolas, monospace","fontSize":"14px"}}}%%
flowchart TD
n_look(["Offer::look<br/>line 84"])
n_waiting(["Offer::waiting<br/>line 94"])
n_panel(["Offer::panel<br/>line 105"])
click n_look href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/crashreport.rs#L84" "open the source"
click n_waiting href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/crashreport.rs#L94" "open the source"
click n_panel href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/crashreport.rs#L105" "open the source"
classDef entry fill:#1f2335,stroke:#7aa2f7,color:#c0caf5
class n_look,n_waiting,n_panel entry
This site loads no third-party script, so it cannot run Mermaid; the diagram above is the same nodes and edges drawn by the generator instead. GitHub renders the source below directly.
ITEMS
| Item | Line | Documentation |
|---|---|---|
NEW_ISSUE pub const | 60 | Where a report goes, if the person wants to file one. |
ISSUES pub const | 63 | The issue tracker itself, linked from About whether or not anything crashed. |
COPIED_FOR const | 66 | How long the copy button says it copied, in seconds. |
Offer pub struct | 70 | What the panel is showing, kept across frames. |
Offer::look pub fn | 84 | Read the previous report, if there is one. |
Offer::waiting pub fn | 94 | Whether there is anything to show. |
Offer::panel pub fn | 105 | Draw the offer. |