Use ⌥⇧⌃ glyphs for key hints on mac (#3143)

#### Summary
- render the edit queued message shortcut with the ⌥ modifier on macOS
builds
- add a helper for status indicator snapshot suffixes
- record macOS-specific snapshots for the status indicator widget
This commit is contained in:
Jeremy Rose
2025-09-04 10:55:50 -07:00
committed by GitHub
parent aa083b795d
commit 075e385969
14 changed files with 79 additions and 32 deletions

View File

@@ -14,6 +14,7 @@ use ratatui::widgets::WidgetRef;
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
use crate::key_hint;
use crate::shimmer::shimmer_spans;
use crate::tui::FrameRequester;
use textwrap::Options as TwOptions;
@@ -130,7 +131,8 @@ impl WidgetRef for StatusIndicatorWidget {
}
}
if !self.queued_messages.is_empty() {
lines.push(Line::from(vec![" ".into(), "Alt+↑".cyan(), " edit".into()]).dim());
let shortcut = key_hint::alt("");
lines.push(Line::from(vec![" ".into(), shortcut, " edit".into()]).dim());
}
let paragraph = Paragraph::new(lines);
@@ -143,7 +145,6 @@ mod tests {
use super::*;
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
use insta::assert_snapshot;
use ratatui::Terminal;
use ratatui::backend::TestBackend;
use tokio::sync::mpsc::unbounded_channel;
@@ -159,7 +160,7 @@ mod tests {
terminal
.draw(|f| w.render_ref(f.area(), f.buffer_mut()))
.expect("draw");
assert_snapshot!(terminal.backend());
insta::assert_snapshot!(terminal.backend());
}
#[test]
@@ -173,7 +174,7 @@ mod tests {
terminal
.draw(|f| w.render_ref(f.area(), f.buffer_mut()))
.expect("draw");
assert_snapshot!(terminal.backend());
insta::assert_snapshot!(terminal.backend());
}
#[test]
@@ -188,6 +189,6 @@ mod tests {
terminal
.draw(|f| w.render_ref(f.area(), f.buffer_mut()))
.expect("draw");
assert_snapshot!(terminal.backend());
insta::assert_snapshot!(terminal.backend());
}
}