commit 0ddc1b1769aca96a7ef61c53eaeb97e302ea5e2f
parent e79bbd92ef7f51c858de6618c73bbbbdbda121c4
Author: William Casarin <jb55@jb55.com>
Date: Sat, 24 Jan 2026 17:05:08 -0800
dave: replace new chat button with icon in sidebar
Use new_message_image icon in session list header instead of plain "+"
text button. Remove duplicate new chat button from top bar.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat:
2 files changed, 8 insertions(+), 35 deletions(-)
diff --git a/crates/notedeck_dave/src/ui/dave.rs b/crates/notedeck_dave/src/ui/dave.rs
@@ -7,7 +7,7 @@ use nostrdb::{Ndb, Transaction};
use notedeck::{
tr, Accounts, AppContext, Images, Localization, MediaJobSender, NoteAction, NoteContext,
};
-use notedeck_ui::{app_images, icons::search_icon, NoteOptions, ProfilePic};
+use notedeck_ui::{icons::search_icon, NoteOptions, ProfilePic};
/// DaveUi holds all of the data it needs to render itself
pub struct DaveUi<'a> {
@@ -369,31 +369,6 @@ impl<'a> DaveUi<'a> {
}
}
-fn new_chat_button() -> impl egui::Widget {
- move |ui: &mut egui::Ui| {
- let img_size = 24.0;
- let max_size = 32.0;
-
- let img = app_images::new_message_image().max_width(img_size);
-
- let helper = notedeck_ui::anim::AnimationHelper::new(
- ui,
- "new-chat-button",
- egui::vec2(max_size, max_size),
- );
-
- let cur_img_size = helper.scale_1d_pos(img_size);
- img.paint_at(
- ui,
- helper
- .get_animation_rect()
- .shrink((max_size - cur_img_size) / 2.0),
- );
-
- helper.take_animation_response()
- }
-}
-
fn query_call_ui(
cache: &mut notedeck::Images,
ndb: &Ndb,
@@ -519,13 +494,6 @@ fn top_buttons_ui(app_ctx: &mut AppContext, ui: &mut egui::Ui) -> Option<DaveAct
action = Some(DaveAction::ToggleChrome);
}
- rect = rect.translate(egui::vec2(30.0, 0.0));
- let r = ui.put(rect, new_chat_button());
-
- if r.clicked() {
- action = Some(DaveAction::NewChat);
- }
-
action
}
diff --git a/crates/notedeck_dave/src/ui/session_list.rs b/crates/notedeck_dave/src/ui/session_list.rs
@@ -1,4 +1,5 @@
use egui::{Align, Layout, Sense};
+use notedeck_ui::app_images;
use crate::session::{SessionId, SessionManager};
@@ -50,9 +51,13 @@ impl<'a> SessionListUi<'a> {
ui.label(egui::RichText::new("Chats").size(18.0).strong());
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
- ui.add_space(4.0);
+ let icon = app_images::new_message_image()
+ .max_height(20.0)
+ .sense(Sense::click());
+
if ui
- .button(egui::RichText::new("+").size(18.0))
+ .add(icon)
+ .on_hover_cursor(egui::CursorIcon::PointingHand)
.on_hover_text("New Chat")
.clicked()
{