commit 0a2935a31064bac26cf9e6da87cea4f4bae41919
parent 473a35cabffeade357cbd09805aecd8464021f81
Author: kernelkind <kernelkind@gmail.com>
Date: Sun, 30 Nov 2025 14:40:49 -0700
feat(messages-app): app wiring
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
9 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -3939,6 +3939,7 @@ dependencies = [
"notedeck_clndash",
"notedeck_columns",
"notedeck_dave",
+ "notedeck_messages",
"notedeck_notebook",
"notedeck_ui",
"profiling",
@@ -4057,6 +4058,14 @@ dependencies = [
]
[[package]]
+name = "notedeck_messages"
+version = "0.7.1"
+dependencies = [
+ "egui",
+ "notedeck",
+]
+
+[[package]]
name = "notedeck_notebook"
version = "0.7.1"
dependencies = [
diff --git a/Cargo.toml b/Cargo.toml
@@ -6,6 +6,7 @@ members = [
"crates/notedeck_chrome",
"crates/notedeck_columns",
"crates/notedeck_dave",
+ "crates/notedeck_messages",
"crates/notedeck_notebook",
"crates/notedeck_ui",
"crates/notedeck_clndash",
@@ -58,6 +59,7 @@ notedeck_chrome = { path = "crates/notedeck_chrome" }
notedeck_clndash = { path = "crates/notedeck_clndash" }
notedeck_columns = { path = "crates/notedeck_columns" }
notedeck_dave = { path = "crates/notedeck_dave" }
+notedeck_messages = { path = "crates/notedeck_messages" }
notedeck_notebook = { path = "crates/notedeck_notebook" }
notedeck_ui = { path = "crates/notedeck_ui" }
tokenator = { path = "crates/tokenator" }
diff --git a/crates/notedeck/src/args.rs b/crates/notedeck/src/args.rs
@@ -128,6 +128,8 @@ impl Args {
res.options.set(NotedeckOptions::FeatureNotebook, true);
} else if arg == "--clndash" {
res.options.set(NotedeckOptions::FeatureClnDash, true);
+ } else if arg == "--messages" {
+ res.options.set(NotedeckOptions::FeatureMessages, true);
} else {
unrecognized_args.insert(arg.clone());
}
diff --git a/crates/notedeck/src/options.rs b/crates/notedeck/src/options.rs
@@ -29,6 +29,9 @@ bitflags! {
/// Is clndash enabled?
const FeatureClnDash = 1 << 33;
+
+ /// Is the Notedeck DMs app enabled?
+ const FeatureMessages = 1 << 34;
}
}
diff --git a/crates/notedeck_chrome/Cargo.toml b/crates/notedeck_chrome/Cargo.toml
@@ -18,6 +18,7 @@ egui = { workspace = true }
notedeck_columns = { workspace = true }
notedeck_ui = { workspace = true }
notedeck_dave = { workspace = true }
+notedeck_messages = { workspace = true }
notedeck_notebook = { workspace = true }
notedeck_clndash = { workspace = true }
notedeck = { workspace = true }
diff --git a/crates/notedeck_chrome/src/app.rs b/crates/notedeck_chrome/src/app.rs
@@ -2,6 +2,7 @@ use notedeck::{AppContext, AppResponse};
use notedeck_clndash::ClnDash;
use notedeck_columns::Damus;
use notedeck_dave::Dave;
+use notedeck_messages::MessagesApp;
use notedeck_notebook::Notebook;
#[allow(clippy::large_enum_variant)]
@@ -10,6 +11,7 @@ pub enum NotedeckApp {
Columns(Box<Damus>),
Notebook(Box<Notebook>),
ClnDash(Box<ClnDash>),
+ Messages(Box<MessagesApp>),
Other(Box<dyn notedeck::App>),
}
@@ -21,6 +23,7 @@ impl notedeck::App for NotedeckApp {
NotedeckApp::Columns(columns) => columns.update(ctx, ui),
NotedeckApp::Notebook(notebook) => notebook.update(ctx, ui),
NotedeckApp::ClnDash(clndash) => clndash.update(ctx, ui),
+ NotedeckApp::Messages(dms) => dms.update(ctx, ui),
NotedeckApp::Other(other) => other.update(ctx, ui),
}
}
diff --git a/crates/notedeck_chrome/src/chrome.rs b/crates/notedeck_chrome/src/chrome.rs
@@ -26,6 +26,7 @@ use notedeck::{
};
use notedeck_columns::{timeline::TimelineKind, Damus};
use notedeck_dave::{Dave, DaveAvatar};
+use notedeck_messages::MessagesApp;
use notedeck_ui::{app_images, expanding_button, galley_centered_pos, ProfilePic};
use std::collections::HashMap;
@@ -154,6 +155,10 @@ impl Chrome {
chrome.add_app(NotedeckApp::Columns(Box::new(columns)));
chrome.add_app(NotedeckApp::Dave(Box::new(dave)));
+ if notedeck.has_option(NotedeckOptions::FeatureMessages) {
+ chrome.add_app(NotedeckApp::Messages(Box::new(MessagesApp::new())));
+ }
+
if notedeck.has_option(NotedeckOptions::FeatureNotebook) {
chrome.add_app(NotedeckApp::Notebook(Box::default()));
}
@@ -771,6 +776,9 @@ fn topdown_sidebar(
let text = match &app {
NotedeckApp::Dave(_) => tr!(loc, "Dave", "Button to go to the Dave app"),
NotedeckApp::Columns(_) => tr!(loc, "Columns", "Button to go to the Columns app"),
+ NotedeckApp::Messages(_) => {
+ tr!(loc, "Messaging", "Button to go to the messaging app")
+ }
NotedeckApp::Notebook(_) => {
tr!(loc, "Notebook", "Button to go to the Notebook app")
}
@@ -802,6 +810,10 @@ fn topdown_sidebar(
);
}
+ NotedeckApp::Messages(_dms) => {
+ ui.add(app_images::new_message_image());
+ }
+
NotedeckApp::ClnDash(_clndash) => {
clndash_button(ui);
}
diff --git a/crates/notedeck_messages/Cargo.toml b/crates/notedeck_messages/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "notedeck_messages"
+version = { workspace = true }
+edition = "2021"
+description = "The direct messages app that ships with Notedeck"
+license = "GPL-3.0-or-later"
+
+[dependencies]
+egui = { workspace = true }
+notedeck = { workspace = true }
diff --git a/crates/notedeck_messages/src/lib.rs b/crates/notedeck_messages/src/lib.rs
@@ -0,0 +1,19 @@
+use notedeck::{App, AppContext, AppResponse};
+
+#[derive(Default)]
+pub struct MessagesApp {}
+
+impl MessagesApp {
+ pub fn new() -> Self {
+ Self {}
+ }
+
+ fn ui(&mut self, _ctx: &mut AppContext<'_>, _ui: &mut egui::Ui) {}
+}
+
+impl App for MessagesApp {
+ fn update(&mut self, ctx: &mut AppContext<'_>, ui: &mut egui::Ui) -> AppResponse {
+ self.ui(ctx, ui);
+ AppResponse::none()
+ }
+}