From 7ec5c510a32213fe98ea404d3f4e5fbc955d9a1a Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Thu, 11 Mar 2021 07:16:20 -0600 Subject: [PATCH] Add some docs --- README.md | 17 ++++++++++++++--- docs/src/SUMMARY.md | 1 + docs/src/code.md | 26 ++++++++++++++++++++++++++ src/ui/mod.rs | 1 - 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 docs/src/code.md diff --git a/README.md b/README.md index 21702b4..e981b6d 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,22 @@ Join chat on Matrix at [#panorama:mozilla.org][3] Goals: -- Never have to actually close the application. -- Handles email, calendar, and address books using open standards. -- Hot-reload on-disk config. +- **Never have to actually close the application.** All errors should be + handled gracefully in a way that can be recovered or restarted without + needing to close the entire application. +- **Handles email, calendar, and address books using open standards.** IMAP for + email retrieval, SMTP for email sending, CalDAV for calendars, and CardDAV + for address books. Work should be saved locally prior to uploading to make + sure nothing is ever lost as a result of network failure. +- **Hot-reload on-disk config.** Configuration should be able to be reloaded so + that the user can keep the application open. Errors in config should be + reported to the user while the application is still running off the old + version. +- **Scriptable.** Built-in scripting language should allow for customization of + common functionality, including keybinds and colors. Stretch goals: +- Full-text email/message search - Unified "feed" that any app can submit to. - Submit notifications to gotify-shaped notification servers. - JMAP implementation. diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 415ddc2..1426363 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -2,3 +2,4 @@ - [Intro](./intro.md) - [Config](./config.md) +- [Code Structure](./code.md) diff --git a/docs/src/code.md b/docs/src/code.md new file mode 100644 index 0000000..9482896 --- /dev/null +++ b/docs/src/code.md @@ -0,0 +1,26 @@ +# Code Structure + +The entire application is running on several async threads in a tokio runtime: + +- [Mail](#mail) +- [UI](#ui) +- [VM](#vm) + +Each of these communicates with the others via pairs of unbounded async +channels. + +## Mail + +The mail thread is in charge of communicating with mail servers. It keeps a +single connection alive to each server even if the UI thread has multiple mail +views open. + +## UI + +The UI thread manages everything user-facing. It runs a terminal UI using the +tui crate. There's a tiny windowing system built in that allows for tiling +windows, split horizontally or vertically. + +## VM + +The VM runs the scripting language that can be used inside the application. diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 3bb842a..9f90f76 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -151,7 +151,6 @@ impl UI { let visible = self.window_layout.visible_windows(chunks[0]); for (layout_id, area) in visible.into_iter() { if let Some(window) = self.windows.get(&layout_id) { - debug!("drawing window {:?}", window.name()); window.draw(f, area, self); } }