Repository source: docs/plans/private_messaging_diagrams_checklist.md
Private Messaging Mermaid Diagrams: Checklist
Target doc: docs/architecture/private_messaging.md. No doc in docs/ uses mermaid yet,
so the first diagram also sets the convention.
Before starting
Layout rule: roughly square, must fit one page
An earlier set of mermaid diagrams in this project came out tall, narrow and too big for a page. Aim for a roughly 4:3 to 1:1 aspect ratio, and no more than about one screen tall.
Joining split diagrams
Mermaid cannot link separate diagrams, so use one of these:
One flowchart, two subgraphs, one connector (preferred). Draw each half as a subgraph and join them with a single edge between the subgraphs themselves (
Send -- "label" --> Read). Connect the subgraph ids, not nodes inside them: an edge from an inner node to an outside node makes Mermaid ignore the subgraph'sdirection. Sequence diagrams cannot be nested this way.Two diagrams with a matching boundary. End the first and begin the second on the same label (for example "envelope stored in private SQLite") and add a one-line caption. The join is visual only. Use this when a sequence diagram is truly needed.
Composite states (state diagrams only). Wrap each half in a composite state and draw one transition between them.
High value
1. Sending and reading a message (sequence diagram)
Section: "Sending and reading a message" (lines 32-43).
Done: one flowchart, three stacked subgraphs (send, server, read) joined by two connectors; renders 783x631 (about 1.24:1). Sequence form was dropped in favor of option 1 from "Joining split diagrams".
2. Unread acknowledgment and receipts (sequence diagram)
Section: "Unread conversations" (lines 75-85).
Done: three stacked steps (open, acknowledge, record); renders 609x658 (about 0.93:1). Non-advancing cases kept in the lead sentence, not the diagram.
3. Draft and uncertain delivery (state diagram)
Section: "Drafts and uncertain delivery" (lines 59-65).
Done:
stateDiagram-v2withdirection TB; renders 719x534 (about 1.35:1).direction LRcame out 784x166 (too wide), so TB was used.
Medium value (nice to have)
4. Storage and privacy boundaries (flowchart)
Section: "Privacy and storage boundaries" (lines 95-108).
Done: three stacked groups (browser, private server state, public outputs); renders 784x623 (about 1.26:1). Invisible
~~~links inside rows keep nodes horizontal; without them it rendered 695x966.
5. Identity and key coverage (flowchart)
Section: "Identity and key coverage" (lines 22-30).
Done: two username groups feeding one message chain; renders 784x487 (about 1.6:1, slightly wider than target but fits one page). The optional "new key cannot read old ciphertext" annotation was left in prose to keep the diagram small.
Explicitly skipped
Endpoint table: already clearest as a table.
Architectural choices and current limits: lists of decisions, not flows.
Pagination cursors: complex, low payoff.