firstrun.rs

crates/veilvoice-gui/src/firstrun.rs

veilvoice-gui · 871 lines · read the source here · or on GitHub

The first run: the four things worth deciding before anything else.

What this replaced

Two checkboxes about animation. Everything that actually matters -- the app lock, the passphrase recordings are encrypted with, whether the window locks itself -- was left to be discovered on a tab most people never opened.

That is a defensible choice for a preference and a bad one for a protection. A default nobody is shown is not a question, it is an answer, and for a privacy tool the answer it was quietly giving was "none of it".

What it asks, and what it will not do

Four cards, each skippable, each stating what it buys before asking for anything:

  1. Appearance. The two animation choices, kept from the old panel.
  2. The app lock. A passphrase for the window, and -- since 0.1.18 -- the key that names and encrypts VeilVoice's own files. The card says both, and says the sentence that has to be said out loud: forget it and those files are gone.
  3. The recording passphrase. What veiled recordings are encrypted with. Separate from the app lock by default, with the option to use one passphrase for both and a plain statement of what that trades.
  4. Locking itself. On at half an hour, with the delay and the off switch right there.

Nothing here is a gate. Every card has a way past it, and skipping all four leaves VeilVoice exactly as it was before this module existed. A setup flow that will not let somebody reach the program is a setup flow they resent; this one is a set of offers made at the moment they make sense.

The walkthrough in crate::tour runs after it, and carries the rest of the setup: encryption at rest, whether this copy is installed, and what each tab is for. It does not offer the app lock again, because this did, thirty seconds earlier, on a card of its own.

In plain words

The first time you open VeilVoice it offers you a password for the app, a password for your recordings, and a timer that locks the window when you walk away. You can skip any of them and set them later.

WHAT THIS FILE CONTAINS

871 lines defining 14 functions (1 public), 4 types and 1 constant. Everything below is read out of the source, so it cannot disagree with the code.

The types it owns.

  • enum Step line 51 · Which card is showing.
  • struct FirstRun line 113 · What the setup is holding while it runs.
  • enum Outcome line 135 · What the panel wants the application to do after drawing.
  • struct Reading line 596 · What the last card of the tour reads from this computer.

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.

  • FirstRun::panel line 149 · Draw the current card.
    reaches app_lock, appearance, autolock, machine, recording, should_skip, buttons, card, field, still_reading

WHAT CALLS WHAT

Step::next line 75 Step::position line 91 FirstRun::panel line 149 FirstRun::should_skip line 213 FirstRun::appearance line 222 FirstRun::app_lock line 239 FirstRun::recording line 311 FirstRun::machine line 407 FirstRun::autolock line 546 card line 570 read_machine line 614 still_reading line 634 field line 646 buttons line 658 entry: a way in: public, and nothing in this file calls it helper: private to this file dashed: a call that goes back up, or across a wrapped rank 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 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_next["Step::next<br/>line 75"]
    n_position["Step::position<br/>line 91"]
    n_panel(["FirstRun::panel<br/>line 149"])
    n_should_skip["FirstRun::should_skip<br/>line 213"]
    n_appearance["FirstRun::appearance<br/>line 222"]
    n_app_lock["FirstRun::app_lock<br/>line 239"]
    n_recording["FirstRun::recording<br/>line 311"]
    n_machine["FirstRun::machine<br/>line 407"]
    n_autolock["FirstRun::autolock<br/>line 546"]
    n_card["card<br/>line 570"]
    n_read_machine["read_machine<br/>line 614"]
    n_still_reading["still_reading<br/>line 634"]
    n_field["field<br/>line 646"]
    n_buttons["buttons<br/>line 658"]
    n_app_lock --> n_buttons
    n_app_lock --> n_card
    n_app_lock --> n_field
    n_appearance --> n_buttons
    n_appearance --> n_card
    n_autolock --> n_buttons
    n_autolock --> n_card
    n_machine --> n_buttons
    n_machine --> n_card
    n_machine --> n_still_reading
    n_panel --> n_app_lock
    n_panel --> n_appearance
    n_panel --> n_autolock
    n_panel --> n_machine
    n_panel --> n_recording
    n_panel --> n_should_skip
    n_recording --> n_buttons
    n_recording --> n_card
    n_recording --> n_field
    click n_next href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L75" "open the source"
    click n_position href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L91" "open the source"
    click n_panel href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L149" "open the source"
    click n_should_skip href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L213" "open the source"
    click n_appearance href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L222" "open the source"
    click n_app_lock href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L239" "open the source"
    click n_recording href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L311" "open the source"
    click n_machine href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L407" "open the source"
    click n_autolock href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L546" "open the source"
    click n_card href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L570" "open the source"
    click n_read_machine href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L614" "open the source"
    click n_still_reading href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L634" "open the source"
    click n_field href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L646" "open the source"
    click n_buttons href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-gui/src/firstrun.rs#L658" "open the source"
    classDef entry fill:#1f2335,stroke:#7aa2f7,color:#c0caf5
    class n_panel entry
    classDef helper fill:#1f2335,stroke:#bb9af7,color:#c0caf5
    class n_next,n_position,n_should_skip,n_appearance,n_app_lock,n_recording,n_machine,n_autolock,n_card,n_read_machine,n_still_reading,n_field,n_buttons helper
    subgraph chart_key ["Key"]
        direction LR
        key_entry["entry: a way in: public, and nothing in this file calls it"]
        key_helper["helper: private to this file"]
    end
    class key_entry entry
    class key_helper helper

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

ItemLineDocumentation
Step pub enum51Which card is showing.
Step::next fn75The step after this one, or None at the end of the tour.
Step::position fn91One-based position, for the "step 2 of 5" line the card shows.
Step::COUNT const108How many cards the tour has.
FirstRun pub struct113What the setup is holding while it runs.
Outcome pub enum135What the panel wants the application to do after drawing.
FirstRun::panel pub fn149Draw the current card.
FirstRun::should_skip fn213Whether a card has nothing left to ask.
FirstRun::appearance fn222The appearance step: pick a palette and see it applied immediately.
FirstRun::app_lock fn239The app-lock step: set a passphrase for VeilVoice itself, or decline it.
FirstRun::recording fn311The recording step: the at-rest passphrase, and what it is separate from.
FirstRun::machine fn407The machine card: what this computer says, read once rather than per frame.
FirstRun::autolock fn546The auto-lock step: how long idle before the window locks itself.
card fn570A bordered card, so each step reads as one thing rather than a page of text.
Reading struct596What the last card of the tour reads from this computer.
read_machine fn614Ask this computer everything the last card shows, on a worker thread.
still_reading fn634The line a card shows where an answer will go, while it is being got.
field fn646A password field with its label, laid out like the rest of the application.
buttons fn658The row that moves on.