commit 685293dc47720b776cd69aa1c42fb85989ff7b5d
parent 8e62f43c4a175bffe1a62b781bc0ad50ec0a13a3
Author: William Casarin <jb55@jb55.com>
Date: Thu, 19 Feb 2026 12:46:56 -0800
dave: use focus queue priority color for hamburger notification dot
Instead of a simple bool, the dot color now reflects the focus
queue's next entry priority: yellow for needs input, red for error,
blue for done.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
4 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/crates/notedeck_dave/src/ui/badge.rs b/crates/notedeck_dave/src/ui/badge.rs
@@ -19,7 +19,7 @@ pub enum BadgeVariant {
impl BadgeVariant {
/// Get background and text colors for this variant
- fn colors(&self, ui: &Ui) -> (Color32, Color32) {
+ pub fn colors(&self, ui: &Ui) -> (Color32, Color32) {
let is_dark = ui.visuals().dark_mode;
match self {
diff --git a/crates/notedeck_dave/src/ui/dave.rs b/crates/notedeck_dave/src/ui/dave.rs
@@ -60,6 +60,9 @@ pub struct DaveUi<'a> {
git_status: Option<&'a mut GitStatusCache>,
/// Session details for header display
details: Option<&'a SessionDetails>,
+ /// Color for the notification dot on the mobile hamburger icon,
+ /// derived from FocusPriority of the next focus queue entry.
+ status_dot_color: Option<egui::Color32>,
}
/// The response the app generates. The response contains an optional
@@ -165,6 +168,7 @@ impl<'a> DaveUi<'a> {
ai_mode,
git_status: None,
details: None,
+ status_dot_color: None,
}
}
@@ -235,6 +239,11 @@ impl<'a> DaveUi<'a> {
self
}
+ pub fn status_dot_color(mut self, color: Option<egui::Color32>) -> Self {
+ self.status_dot_color = color;
+ self
+ }
+
fn chat_margin(&self, ctx: &egui::Context) -> i8 {
if self.flags.contains(DaveUiFlags::Compact) || notedeck::ui::is_narrow(ctx) {
8
@@ -264,8 +273,7 @@ impl<'a> DaveUi<'a> {
let action = if is_compact {
None
} else {
- let has_pending = self.flags.contains(DaveUiFlags::HasPendingPerm);
- let result = top_buttons_ui(app_ctx, ui, has_pending);
+ let result = top_buttons_ui(app_ctx, ui, self.status_dot_color);
// Render session details inline, to the right of the buttons
if let Some(details) = self.details {
diff --git a/crates/notedeck_dave/src/ui/mod.rs b/crates/notedeck_dave/src/ui/mod.rs
@@ -416,12 +416,14 @@ pub fn narrow_ui(
.inner;
(DaveResponse::default(), session_action)
} else if let Some(session) = session_manager.get_active_mut() {
+ let dot_color = focus_queue.current().map(|e| e.priority.color());
let response = build_dave_ui(
session,
model_config,
is_interrupt_pending,
auto_steal_focus,
)
+ .status_dot_color(dot_color)
.ui(app_ctx, ui);
(response, None)
} else {
diff --git a/crates/notedeck_dave/src/ui/top_buttons.rs b/crates/notedeck_dave/src/ui/top_buttons.rs
@@ -16,11 +16,14 @@ pub struct TopButtonsResult {
pub y: f32,
}
-/// Render the top buttons UI (profile pic, settings, session list toggle)
+/// Render the top buttons UI (profile pic, settings, session list toggle).
+/// `status_dot` optionally paints a colored dot on the hamburger icon to
+/// indicate what kind of attention the session needs (blue = working,
+/// yellow = needs input, red = error).
pub fn top_buttons_ui(
app_ctx: &mut AppContext,
ui: &mut egui::Ui,
- has_pending: bool,
+ status_dot: Option<egui::Color32>,
) -> TopButtonsResult {
let mut action: Option<DaveAction> = None;
let mut rect = ui.available_rect_before_wrap();
@@ -36,10 +39,9 @@ pub fn top_buttons_ui(
.on_hover_cursor(egui::CursorIcon::PointingHand);
// Draw notification dot when something needs attention
- if has_pending {
+ if let Some(color) = status_dot {
let dot_center = rect.right_top() + egui::vec2(-2.0, 6.0);
- ui.painter()
- .circle_filled(dot_center, 4.0, ui.visuals().selection.stroke.color);
+ ui.painter().circle_filled(dot_center, 4.0, color);
}
if r.clicked() {