State Machines
Formal definitions of the SG/Send UI state machines, derived from the QA test code and verified against the live application. These are the single source of truth โ both the tests and this documentation are generated from the same Python classes.
Source:
sg_send_qa/state_machines/ยท Exported viapython -m sg_send_qa.state_machines.export_schemas
Upload Wizard
The upload wizard walks through 6 UI steps. Two branching paths exit file-ready:
single files and text skip the delivery-method step and go straight to share-mode selection.
9 states ยท 9 transitions
Security Annotations
| Transition | Security tag |
|---|---|
confirming โ encrypting (click_encrypt_upload) |
plaintext_in_memory |
encrypting โ uploading (auto_advance) |
ciphertext_only |
completing โ complete (auto_advance) |
key_in_url |
Download Flow
The download flow branches on whether the URL contains a hash fragment, and again on content type when auto-routing to browse/gallery/viewer.
9 states ยท 12 transitions
Security Annotations
| Transition | Security tag |
|---|---|
ready โ decrypting (click_decrypt) |
key_in_memory |
decrypting โ complete (decrypt_succeeded) |
plaintext_in_dom |
How This Works
Python classes JSON export QA site
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
State_Transition โ schemas/upload.json โ This page
State_Machine__* โ _data/state_machines/ (Jekyll reads _data/)
State_Machine__Utils mermaid text embedded Mermaid.js renders
The mermaid field in each JSON file is pre-rendered by State_Machine__Utils.to_mermaid().
The QA site reads it at build time โ no runtime generation needed.
Test Coverage
When the QA API is used to run workflows, each response includes transitions_observed โ
the list of (from_state, to_state) pairs actually traversed. Aggregate these across a
test run to compute coverage:
{
"status": "pass",
"transitions_observed": [
{"from_state": "idle", "to_state": "file-ready"},
{"from_state": "file-ready", "to_state": "choosing-share"},
{"from_state": "confirming", "to_state": "encrypting"}
]
}
Compare against the defined transitions to find untested paths.