cosmic_applet_avestruz/views/mod.rs
1// SPDX-License-Identifier: MIT
2
3//! View rendering modules for Avestruz.
4//!
5//! A view is a method on [`AppModel`](crate::state::AppModel) that takes
6//! `&self` and returns widgets. It can't change the model: what it wants
7//! done, it says in the messages its widgets send. It is built again
8//! whenever the model changed, and from nothing whenever the popup opens.
9//!
10//! ```mermaid
11//! flowchart LR
12//! panel["the button in the panel: another process"] -->|"pressed"| popup["popup: an error banner, over the view on show"]
13//! popup --> state{"ViewState"}
14//! state -->|"Login"| login
15//! state -->|"Feed"| feed
16//! state -->|"Page"| page{"The last page opened"}
17//! state -->|"Compose"| compose
18//! state -->|"Zap"| zap
19//! state -->|"Settings"| settings
20//! state -->|"Relays"| relays
21//! state -->|"Media"| media
22//! page --> thread
23//! page --> profile
24//! page --> bookmarks
25//! page --> search
26//! page --> notifications
27//! feed --> rows["components: a VirtualList of note rows"]
28//! thread --> rows
29//! profile --> rows
30//! bookmarks --> rows
31//! search --> rows
32//! notifications --> rows
33//! ```
34//!
35//! | Module | What it draws |
36//! |---|---|
37//! | [`popup`] | The popup: the view on show, under an error banner when something went wrong |
38//! | [`login`] | Signing in |
39//! | [`feed`] | The feed, in a scroller |
40//! | [`bookmarks`] | The notes the account has bookmarked |
41//! | [`notifications`] | What others did that concerns the account |
42//! | [`compose`] | The composer: a note, a reply or a quote being written |
43//! | [`thread`] | A note's thread: the conversation it is part of |
44//! | [`profile`] | Someone's profile: who they are, and their notes |
45//! | [`relays`] | The account's relays, by what they are for |
46//! | [`media`] | The account's media servers, where what it attaches to notes is kept |
47//! | [`search`] | A search: what is typed, and the people and notes found |
48//! | [`settings`] | The settings: the account, signing out, text size, how long notes are kept, logging |
49//! | [`keys`] | What the keys do |
50//! | [`zap`] | Zapping a note: how much, and the invoice to pay |
51//! | [`components`] | What the views share: the virtual list, the note row, the cards under a note |
52//!
53//! Why nothing that matters is kept in a widget is in
54//! [`crate::guide::architecture`], and what keeps a list from moving
55//! under its reader in [`crate::guide::decisions`].
56
57pub mod bookmarks;
58pub mod components;
59pub mod compose;
60pub mod feed;
61pub mod keys;
62pub mod login;
63pub mod media;
64pub mod notifications;
65pub mod popup;
66pub mod profile;
67pub mod relays;
68pub mod search;
69pub mod settings;
70pub mod thread;
71pub mod zap;