Skip to content

Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.

fix(tui): redesign update dialogs and isolate backdrop bleed

Samir Hossainsef013a7e2b29
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0adf236..c17a3cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## [Unreleased]
+
+### Added
+- **Minimal Update Available Modal & Indented Release Notes**:
+ - Formatted release notes into a clean, scannable indented hierarchy under `Release Notes:` with category badges (`[Added]`, `[Fixed]`) and bullet points, displaying concise feature titles without decorative tree glyphs, block prefixes (`▌`), or multi-line duplicate text walls.
+ - Stripped decorative star icons and redundant prompt sentences, keeping the header focused on a clean, high-contrast version diff (`Installed: vX.Y.Z → Latest: vX.Y.Z`).
+ - Separated dialog sections with subtle horizontal card divider lines (`─`) and dedicated action button pills (`[u] Update Now`, `[o] Open Release Page`, `[Esc] Dismiss`).
+- **Calm, Minimal Self-Updating Progress Dialog**:
+ - Redesigned `draw_updating_modal` into a calm, focused card with top and bottom border clearances, eliminating visual crowding against the title and frame.
+ - Streamlined the in-flight display into a unified active status line with spinner (`⠋ Downloading MovieBox-Tui v...` / `⠋ Installing MovieBox-Tui v...`) and a cross-platform safety warning (`⚠ Please wait • do not close terminal` / `[!] Please wait - do not close terminal`).
+### Fixed
+- **Landing Screen ASCII Banner Bleed-Through**:
+- **Modal Frame Backdrop Isolation**:
+ - Applied opaque theme background styling (`theme.base`) to `ModalFrame`, preventing terminal background transparency or buffer bleed through dialog borders.
+- **Update Modal Geometry & Border Clearances**:
+ - Widened the modal from 72 to 76 columns to align with standard dialog geometry and provide a generous 3-column safety margin, preventing text lines and bullet points from crowding the outer borders.
+
## [0.1.17] - 2026-09-06
### Added
diff --git a/docs/controls.md b/docs/controls.md
index 59bc946..d72fc7a 100644
--- a/docs/controls.md
+++ b/docs/controls.md
@@ -122,16 +122,17 @@ Type these commands directly into the search bar:
- `↑`/`↓`, `PageUp`/`PageDown`, and the mouse wheel scroll long content.
- Other keys are ignored while help is open.
-## Update Notification Modal
+## Update Notification & Self-Update Modals
-When a new release is detected:
+When a new release is detected, a centered modal card displays the version comparison, environment instructions, release highlights, and quick actions:
- `u` / `U`: Download and install update immediately (direct binary replacement platforms).
-- `b` / `B`: View Homebrew upgrade command (`brew upgrade moviebox-tui`) on Homebrew-managed installations.
+- `b` / `B`: Copy Homebrew upgrade command (`brew upgrade moviebox-tui`) to clipboard with status toast on Homebrew-managed installations.
- `o` / `O`: Open GitHub release notes in the system browser.
- `Esc`: Dismiss modal and return to previous screen.
-- Modal presentation is deferred while actively typing in the search bar (`InputMode::Editing`) to prevent input hijacking. During update installation, keyboard and mouse inputs are locked while an in-flight Braille progress modal displays download, verification, and replacement status.
-
+- The notification modal formats release notes into clean, indented category sections (`[Added]`, `[Fixed]`) with bold feature titles and bullet items, stripping decorative prefixes and duplicate paragraph text.
+- During self-update (`u`), a focused progress modal displays an active spinner with a unified action status (`⠋ Downloading MovieBox-Tui v...` / `⠋ Installing MovieBox-Tui v...`) and a cross-platform warning notice (`⚠ Please wait • do not close terminal` on modern terminals, `[!] Please wait - do not close terminal` on basic terminals) with generous border clearances.
+- Modal presentation is deferred while actively typing in the search bar (`InputMode::Editing`) to prevent input hijacking. During update installation, keyboard and mouse inputs are locked while the progress modal is displayed.
## Wide-Terminal Grid
On terminals at least 110 columns wide, search results render in two
diff --git a/src/tui/app/run.rs b/src/tui/app/run.rs
index b846dcc..315259c 100644
--- a/src/tui/app/run.rs
+++ b/src/tui/app/run.rs
@@ -1024,25 +1024,27 @@ impl App {
self.state.basic_terminal,
)
.render(frame, popup_area, area);
+ let divider_char = if self.state.basic_terminal {
+ "-"
+ } else {
+ "─"
+ };
+ let divider_str = divider_char.repeat(inner_area.width as usize);
let mut text = vec![
- Line::from(vec![Span::styled(
- "A new version of MovieBox-Tui is available",
- self.theme
- .header
- .add_modifier(ratatui::style::Modifier::BOLD),
- )])
- .alignment(Alignment::Center),
Line::from(vec![
Span::styled("Installed: ", self.theme.text_dim),
- Span::styled(format!("v{}", env!("CARGO_PKG_VERSION")), self.theme.text),
+ Span::styled(
+ format!("v{}", env!("CARGO_PKG_VERSION")),
+ self.theme
+ .subtext1
+ .add_modifier(ratatui::style::Modifier::BOLD),
+ ),
Span::styled(" → ", self.theme.accent),
Span::styled("Latest: ", self.theme.text_dim),
Span::styled(
format!("v{version}"),
- self.theme
- .accent
- .add_modifier(ratatui::style::Modifier::BOLD),
+ self.theme.teal.add_modifier(ratatui::style::Modifier::BOLD),
),
])
.alignment(Alignment::Center),
@@ -1056,7 +1058,7 @@ impl App {
Span::styled(
"brew upgrade moviebox-tui",
self.theme
- .accent
+ .shortcut
.add_modifier(ratatui::style::Modifier::BOLD),
),
])
@@ -1075,7 +1077,7 @@ impl App {
crate::updater::apply::InstallationEnvironment::ReadOnly => {
text.push(
Line::from(vec![Span::styled(
- "Binary is not user-writable • Update via your package manager",
+ "Binary is read-only • Update via your package manager",
self.theme.accent,
)])
.alignment(Alignment::Center),
@@ -1085,81 +1087,154 @@ impl App {
| crate::updater::apply::InstallationEnvironment::WindowsHelper => {}
}
- text.push(Line::from(""));
- text.push(Line::from(vec![Span::styled(
- "Release Notes:",
- self.theme
- .subtext1
- .add_modifier(ratatui::style::Modifier::BOLD),
- )]));
+ text.push(Line::from(Span::styled(
+ divider_str.clone(),
+ self.theme.surface1,
+ )));
+ text.push(Line::from(vec![
+ Span::raw(" "),
+ Span::styled(
+ "Release Notes:",
+ self.theme
+ .highlight
+ .add_modifier(ratatui::style::Modifier::BOLD),
+ ),
+ ]));
+ let line_width = (inner_area.width as usize).saturating_sub(6);
+ let basic = self.state.basic_terminal;
- let line_width = popup_area.width.saturating_sub(6) as usize;
for line in note_lines.iter().take(display_count) {
let trimmed = line.trim();
- let mut spans = vec![Span::raw(" ")];
+ let mut spans = Vec::new();
if trimmed.starts_with("### ")
|| trimmed.starts_with("## ")
|| trimmed.starts_with("# ")
{
- let text_start = trimmed.find(' ').unwrap_or(0);
- spans.push(Span::styled(
- if self.state.basic_terminal {
- "> "
- } else {
- "▌ "
- },
- self.theme.accent,
- ));
- spans.push(Span::styled(
- crate::tui::text::truncate_width(
- &trimmed[text_start..],
- line_width.saturating_sub(4),
- ),
- self.theme.highlight,
- ));
+ let title = trimmed.trim_start_matches('#').trim();
+ spans.push(Span::raw(" "));
+ if title.eq_ignore_ascii_case("Added") {
+ spans.push(Span::styled(
+ "[Added]",
+ self.theme.teal.add_modifier(ratatui::style::Modifier::BOLD),
+ ));
+ } else if title.eq_ignore_ascii_case("Fixed") {
+ spans.push(Span::styled(
+ "[Fixed]",
+ self.theme
+ .rating
+ .add_modifier(ratatui::style::Modifier::BOLD),
+ ));
+ } else if title.eq_ignore_ascii_case("Changed") {
+ spans.push(Span::styled(
+ "[Changed]",
+ self.theme
+ .sapphire
+ .add_modifier(ratatui::style::Modifier::BOLD),
+ ));
+ } else if title.eq_ignore_ascii_case("Performance")
+ || title.eq_ignore_ascii_case("Perf")
+ {
+ spans.push(Span::styled(
+ "[Performance]",
+ self.theme
+ .accent
+ .add_modifier(ratatui::style::Modifier::BOLD),
+ ));
+ } else if title.eq_ignore_ascii_case("Security") {
+ spans.push(Span::styled(
+ "[Security]",
+ self.theme
+ .error
+ .add_modifier(ratatui::style::Modifier::BOLD),
+ ));
+ } else {
+ spans.push(Span::styled(
+ title,
+ self.theme
+ .highlight
+ .add_modifier(ratatui::style::Modifier::BOLD),
+ ));
+ }
} else if trimmed.starts_with("- ") || trimmed.starts_with("* ") {
- let text_start = trimmed.find(' ').unwrap_or(0) + 1;
+ let bullet = trimmed[2..].trim();
+ spans.push(Span::raw(" "));
spans.push(Span::styled(
- if self.state.basic_terminal {
- "- "
- } else {
- "• "
- },
+ if basic { "- " } else { "• " },
self.theme.accent,
));
- spans.push(Span::raw(crate::tui::text::truncate_width(
- trimmed[text_start..].trim_start(),
- line_width.saturating_sub(4),
- )));
+ if let Some(rest) = bullet.strip_prefix("**") {
+ if let Some(end) = rest.find("**") {
+ let title = &rest[..end];
+ let after = &rest[end + 2..];
+ let (colon, rest) = if let Some(stripped) = after.strip_prefix(':') {
+ (": ", stripped.trim())
+ } else {
+ ("", after.trim())
+ };
+ let clean_rest = rest.replace('`', "");
+ spans.push(Span::styled(
+ title,
+ self.theme.text.add_modifier(ratatui::style::Modifier::BOLD),
+ ));
+ if !colon.is_empty() {
+ spans.push(Span::styled(colon, self.theme.subtext1));
+ }
+ if !clean_rest.is_empty() {
+ let budget = line_width
+ .saturating_sub(8)
+ .saturating_sub(crate::tui::text::width(title))
+ .saturating_sub(colon.len());
+ if budget > 0 {
+ spans.push(Span::styled(
+ crate::tui::text::truncate_width(&clean_rest, budget),
+ self.theme.text_dim,
+ ));
+ }
+ }
+ } else {
+ let clean = bullet.replace('`', "");
+ spans.push(Span::styled(
+ crate::tui::text::truncate_width(
+ &clean,
+ line_width.saturating_sub(8),
+ ),
+ self.theme.text,
+ ));
+ }
+ } else {
+ let clean = bullet.replace('`', "");
+ spans.push(Span::styled(
+ crate::tui::text::truncate_width(&clean, line_width.saturating_sub(8)),
+ self.theme.text,
+ ));
+ }
} else {
- spans.push(Span::raw(crate::tui::text::truncate_width(
- trimmed,
- line_width.saturating_sub(2),
- )));
+ let clean = trimmed.replace('`', "");
+ spans.push(Span::raw(" "));
+ spans.push(Span::styled(
+ crate::tui::text::truncate_width(&clean, line_width.saturating_sub(6)),
+ self.theme.text_dim,
+ ));
}
text.push(Line::from(spans));
}
- if has_more {
- text.push(
- Line::from(Span::styled(
- "... (read more on GitHub release page)",
- self.theme.text_dim,
- ))
- .alignment(Alignment::Center),
- );
- }
-
- text.push(Line::from(""));
+ let more_msg = if has_more {
+ " Press [o] to read full changelog on GitHub"
+ } else {
+ " Press [o] to view release on GitHub"
+ };
+ text.push(Line::from(Span::styled(more_msg, self.theme.text_dim)));
+ text.push(Line::from(Span::styled(divider_str, self.theme.surface1)));
- let is_compact_modal = inner_area.width < 56;
+ let is_compact_modal = inner_area.width < 58;
let buttons = match env {
crate::updater::apply::InstallationEnvironment::Homebrew => {
if is_compact_modal {
vec![
Span::styled("[b]", self.theme.shortcut),
- Span::styled(" Copy 'brew upgrade' ", self.theme.text),
+ Span::styled(" Copy ", self.theme.text),
Span::styled("[o]", self.theme.shortcut),
Span::styled(" Web ", self.theme.text),
Span::styled("[Esc]", self.theme.shortcut),
@@ -1168,7 +1243,10 @@ impl App {
} else {
vec![
Span::styled("[b]", self.theme.shortcut),
- Span::styled(" Copy 'brew upgrade' ", self.theme.text),
+ Span::styled(
+ " Copy Command ",
+ self.theme.text.add_modifier(ratatui::style::Modifier::BOLD),
+ ),
Span::styled("[o]", self.theme.shortcut),
Span::styled(" Open Release Page ", self.theme.text),
Span::styled("[Esc]", self.theme.shortcut),
@@ -1188,7 +1266,10 @@ impl App {
} else {
vec![
Span::styled("[o]", self.theme.shortcut),
- Span::styled(" Open Release Page ", self.theme.text),
+ Span::styled(
+ " Open Release Page ",
+ self.theme.text.add_modifier(ratatui::style::Modifier::BOLD),
+ ),
Span::styled("[Esc]", self.theme.shortcut),
Span::styled(" Dismiss", self.theme.text),
]
@@ -1208,7 +1289,10 @@ impl App {
} else {
vec![
Span::styled("[u]", self.theme.shortcut),
- Span::styled(" Update Now ", self.theme.text),
+ Span::styled(
+ " Update Now ",
+ self.theme.text.add_modifier(ratatui::style::Modifier::BOLD),
+ ),
Span::styled("[o]", self.theme.shortcut),
Span::styled(" Open Release Page ", self.theme.text),
Span::styled("[Esc]", self.theme.shortcut),
@@ -1235,7 +1319,7 @@ impl App {
use ratatui::widgets::Paragraph;
let width = 56.min(area.width.saturating_sub(4)).max(36);
- let height = 8.min(area.height.saturating_sub(2)).max(6);
+ let height = 9.min(area.height.saturating_sub(2)).max(7);
let popup_area = crate::tui::overlay::centered(area, width, height, 36, 56);
let inner_area = crate::tui::widgets::ModalFrame::new(
@@ -1261,22 +1345,23 @@ impl App {
.as_deref()
.unwrap_or("Applying update...");
- let is_compact_header = inner_area.width < 42;
- let header_spans = if is_compact_header {
- vec![
- Span::styled(
- format!("{spinner} "),
- self.theme
- .accent
- .add_modifier(ratatui::style::Modifier::BOLD),
- ),
- Span::styled(
- format!("v{} → v{}", env!("CARGO_PKG_VERSION"), target_version),
- self.theme.highlight,
- ),
- ]
+ let action_text = if progress_msg.contains("SHA256") || progress_msg.contains("checksum") {
+ "Verifying release checksum...".to_string()
+ } else if progress_msg.contains("Extracting") || progress_msg.contains("Applying") {
+ format!("Installing MovieBox-Tui v{target_version}...")
+ } else {
+ format!("Downloading MovieBox-Tui v{target_version}...")
+ };
+
+ let (warn_icon, warn_style) = if self.state.basic_terminal {
+ ("[!] ", self.theme.shortcut)
} else {
- vec![
+ ("⚠ ", self.theme.rating)
+ };
+
+ let text = vec![
+ Line::from(""),
+ Line::from(vec![
Span::styled(
format!("{spinner} "),
self.theme
@@ -1284,34 +1369,25 @@ impl App {
.add_modifier(ratatui::style::Modifier::BOLD),
),
Span::styled(
- "Upgrading MovieBox-Tui ",
+ action_text,
self.theme
.header
.add_modifier(ratatui::style::Modifier::BOLD),
),
- Span::styled(
- format!("v{} → v{}", env!("CARGO_PKG_VERSION"), target_version),
- self.theme.highlight,
- ),
- ]
- };
-
- let text = vec![
- Line::from(header_spans).alignment(Alignment::Center),
- Line::from(""),
- Line::from(vec![Span::styled(
- crate::tui::text::truncate_width(
- progress_msg,
- inner_area.width.saturating_sub(2) as usize,
- ),
- self.theme.text,
- )])
+ ])
.alignment(Alignment::Center),
Line::from(""),
- Line::from(vec![Span::styled(
- "Please wait, do not close the terminal...",
- self.theme.text_dim,
- )])
+ Line::from(vec![
+ Span::styled(warn_icon, warn_style),
+ Span::styled(
+ if self.state.basic_terminal {
+ "Please wait - do not close terminal"
+ } else {
+ "Please wait • do not close terminal"
+ },
+ self.theme.text_dim,
+ ),
+ ])
.alignment(Alignment::Center),
];
@@ -1319,7 +1395,6 @@ impl App {
frame.render_widget(popup, inner_area);
}
}
-
#[cfg(test)]
mod tests {
use super::*;
@@ -1400,4 +1475,117 @@ mod tests {
});
assert!(res.is_ok());
}
+
+ #[test]
+ fn test_update_modal_rendering_and_markdown_formatting() {
+ let backend = TestBackend::new(100, 30);
+ let mut terminal = Terminal::new(backend).unwrap();
+ let mut app = App::new();
+ let notes = "### Added\n- **Anchored Provider Selection Menu**: Replaced immediate mouse cycling\n- Added dedicated keyboard navigation\n### Fixed\n- **Stream Table Alignment**: Corrected column budget\n";
+ app.state.update_available = Some(("0.1.18".to_string(), notes.to_string()));
+
+ terminal
+ .draw(|f| {
+ app.draw(f);
+ })
+ .unwrap();
+
+ let mut rendered = String::new();
+ for y in 0..30 {
+ for x in 0..100 {
+ let cell = terminal.backend().buffer().cell((x, y)).unwrap();
+ rendered.push_str(cell.symbol());
+ }
+ rendered.push('\n');
+ }
+ assert!(rendered.contains("Update Available"));
+ assert!(rendered.contains("Installed:"));
+ assert!(rendered.contains("Latest:"));
+ assert!(rendered.contains("v0.1.18"));
+ assert!(rendered.contains("Release Notes:"));
+ assert!(!rendered.contains("▌"));
+ assert!(rendered.contains("[Added]"));
+ assert!(rendered.contains("[Fixed]"));
+ assert!(rendered.contains("Anchored Provider Selection Menu:"));
+ assert!(rendered.contains("Stream Table Alignment:"));
+ assert!(!rendered.contains("**Anchored"));
+ assert!(!rendered.contains("**Stream"));
+ assert!(rendered.contains("[u]"));
+ assert!(rendered.contains("[o]"));
+ assert!(rendered.contains("[Esc]"));
+ }
+
+ #[test]
+ fn test_updating_modal_pipeline_rendering_and_geometry() {
+ let backend = TestBackend::new(100, 30);
+ let mut terminal = Terminal::new(backend).unwrap();
+ let mut app = App::new();
+ app.state.is_updating = true;
+ app.state.update_progress_msg =
+ Some("Downloading MovieBox_macOS_Universal.tar.gz...".to_string());
+ app.state.basic_terminal = false;
+
+ terminal
+ .draw(|f| {
+ app.draw(f);
+ })
+ .unwrap();
+
+ let mut rendered = String::new();
+ for y in 0..30 {
+ for x in 0..100 {
+ let cell = terminal.backend().buffer().cell((x, y)).unwrap();
+ rendered.push_str(cell.symbol());
+ }
+ rendered.push('\n');
+ }
+
+ assert!(rendered.contains("Self-Update in Progress"));
+ assert!(rendered.contains("Downloading MovieBox-Tui v"));
+ assert!(rendered.contains("⚠"));
+ assert!(rendered.contains("Please wait • do not close terminal"));
+
+ app.state.basic_terminal = true;
+ app.state.update_progress_msg = Some("Applying update...".to_string());
+ terminal
+ .draw(|f| {
+ app.draw(f);
+ })
+ .unwrap();
+
+ let mut basic_rendered = String::new();
+ for y in 0..30 {
+ for x in 0..100 {
+ let cell = terminal.backend().buffer().cell((x, y)).unwrap();
+ basic_rendered.push_str(cell.symbol());
+ }
+ basic_rendered.push('\n');
+ }
+ assert!(basic_rendered.contains("Self-Update in Progress"));
+ assert!(basic_rendered.contains("Installing MovieBox-Tui v"));
+ assert!(basic_rendered.contains("[!]"));
+ assert!(basic_rendered.contains("Please wait - do not close terminal"));
+
+ let min_backend = TestBackend::new(50, 14);
+ let mut min_terminal = Terminal::new(min_backend).unwrap();
+ app.state.basic_terminal = false;
+ app.state.update_progress_msg =
+ Some("Downloading MovieBox_macOS_Universal.tar.gz...".to_string());
+ min_terminal
+ .draw(|f| {
+ app.draw(f);
+ })
+ .unwrap();
+ let mut min_rendered = String::new();
+ for y in 0..14 {
+ for x in 0..50 {
+ let cell = min_terminal.backend().buffer().cell((x, y)).unwrap();
+ min_rendered.push_str(cell.symbol());
+ }
+ min_rendered.push('\n');
+ }
+ assert!(min_rendered.contains("Self-Update in Progress"));
+ assert!(min_rendered.contains("Downloading MovieBox-Tui v"));
+ assert!(min_rendered.contains("Please wait • do not close terminal"));
+ }
}
diff --git a/src/tui/overlay.rs b/src/tui/overlay.rs
index 7141a02..85daafb 100644
--- a/src/tui/overlay.rs
+++ b/src/tui/overlay.rs
@@ -589,30 +589,28 @@ pub fn update_modal_layout(area: Rect, notes: &str) -> UpdateModalLayout {
.filter(|l| !l.is_empty())
.count();
- let min_w: u16 = 58;
- let max_w: u16 = 72;
- let desired_w = max_w
- .min(area.width.saturating_sub(4))
- .max(min_w.min(area.width));
-
- let header_rows: u16 = 5;
- let footer_rows: u16 = 3;
+ let min_w: u16 = 46;
+ let max_w: u16 = 76;
+ let available_w = area.width.saturating_sub(4);
+ let desired_w = max_w.min(available_w).max(min_w.min(available_w));
+
+ let header_rows: u16 = 6;
+ let footer_rows: u16 = 4;
let available_height = area.height.saturating_sub(4);
let available_note_rows =
- (available_height.saturating_sub(header_rows + footer_rows) as usize).clamp(2, 10);
+ (available_height.saturating_sub(header_rows + footer_rows) as usize).clamp(3, 12);
let display_count = note_lines_count.min(available_note_rows);
let has_more = note_lines_count > display_count;
- let total_rows =
- header_rows + (display_count as u16) + (if has_more { 1 } else { 0 }) + footer_rows;
- let desired_h = total_rows.clamp(10, available_height.max(10));
+ let total_rows = header_rows + (display_count as u16) + footer_rows;
+ let desired_h = total_rows.clamp(12, available_height.max(12));
const UPDATE_SEGMENT: u16 = 18;
const OPEN_SEGMENT: u16 = 26;
- const DISMISS_SEGMENT: u16 = 12;
+ const DISMISS_SEGMENT: u16 = 14;
- let popup_area = centered(area, desired_w, desired_h, min_w.min(area.width), max_w);
- let (update_seg, open_seg, dismiss_seg) = if popup_area.width < 58 {
+ let popup_area = centered(area, desired_w, desired_h, min_w.min(available_w), max_w);
+ let (update_seg, open_seg, dismiss_seg) = if popup_area.width < 60 {
(12, 10, 10)
} else {
(UPDATE_SEGMENT, OPEN_SEGMENT, DISMISS_SEGMENT)
@@ -646,14 +644,14 @@ mod tests {
let notes = "Line 1\nLine 2\nLine 3\nLine 4";
let layout = update_modal_layout(area, notes);
- assert_eq!(layout.popup_area.width, 72);
+ assert_eq!(layout.popup_area.width, 76);
assert_eq!(layout.display_count, 4);
assert!(!layout.has_more);
- assert_eq!(layout.popup_area.height, 12);
- assert_eq!(layout.popup_area.x, (80 - 72) / 2);
- assert_eq!(layout.popup_area.y, (24 - 12) / 2);
- assert_eq!(layout.button_row_y, layout.popup_area.y + 10);
- let footer_start = layout.popup_area.x + 1 + (70 - 56) / 2;
+ assert_eq!(layout.popup_area.height, 14);
+ assert_eq!(layout.popup_area.x, (80 - 76) / 2);
+ assert_eq!(layout.popup_area.y, (24 - 14) / 2);
+ assert_eq!(layout.button_row_y, layout.popup_area.y + 12);
+ let footer_start = layout.popup_area.x + 1 + (74 - 58) / 2;
assert_eq!(layout.update_btn_end_x, footer_start + 18);
assert_eq!(layout.open_btn_end_x, layout.update_btn_end_x + 26);
assert_eq!(layout.open_button_midpoint_x, layout.update_btn_end_x + 13);
@@ -734,9 +732,9 @@ mod tests {
assert!(compact.has_more);
let large = update_modal_layout(Rect::new(0, 0, 160, 50), notes);
- assert_eq!(large.popup_area.width, 72);
- assert_eq!(large.display_count, 10);
- assert!(large.has_more);
+ assert_eq!(large.popup_area.width, 76);
+ assert_eq!(large.display_count, 11);
+ assert!(!large.has_more);
}
#[test]
diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rs
index 96701e0..f9ef449 100644
--- a/src/tui/screens/home.rs
+++ b/src/tui/screens/home.rs
@@ -1501,25 +1501,30 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
.split(vertical_chunks[rows.version]);
let modal_active = state.has_active_modal() || state.show_settings_popup;
- let logo_style = if modal_active {
- theme.overlay0
- } else {
- theme.title
- };
- let title_art = Paragraph::new(logo_text)
- .alignment(Alignment::Left)
- .style(logo_style);
- frame.render_widget(title_art, horizontal_chunks[1]);
+ let update_active = (state.update_available.is_some()
+ && state.input_mode != InputMode::Editing)
+ || state.is_updating;
+ if !update_active {
+ let logo_style = if modal_active {
+ theme.overlay0
+ } else {
+ theme.title
+ };
+ let title_art = Paragraph::new(logo_text)
+ .alignment(Alignment::Left)
+ .style(logo_style);
+ frame.render_widget(title_art, horizontal_chunks[1]);
- let version_style = if modal_active {
- theme.muted
- } else {
- theme.text_dim
- };
- let version = Paragraph::new(format!("v{}", env!("CARGO_PKG_VERSION")))
- .alignment(Alignment::Right)
- .style(version_style);
- frame.render_widget(version, version_chunks[1]);
+ let version_style = if modal_active {
+ theme.muted
+ } else {
+ theme.text_dim
+ };
+ let version = Paragraph::new(format!("v{}", env!("CARGO_PKG_VERSION")))
+ .alignment(Alignment::Right)
+ .style(version_style);
+ frame.render_widget(version, version_chunks[1]);
+ }
let card_width = search_deck_width(area, state, true);
let card_x = area.x + area.width.saturating_sub(card_width) / 2;
@@ -1530,7 +1535,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
height: vertical_chunks[rows.search].height,
};
- if !state.tv_config_popup {
+ if !state.tv_config_popup && !update_active {
render_search_bar(
frame,
search_card_area,
@@ -1545,11 +1550,12 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
let suggestions_open =
state.input_mode == InputMode::Editing && !state.search_suggestions.is_empty();
- if state.landing_deck_visible() && !state.tv_config_popup {
+ if state.landing_deck_visible() && !state.tv_config_popup && !update_active {
render_landing_deck(frame, vertical_chunks[rows.favorites], state, theme);
} else if !state.is_tv_mode
&& !state.tv_config_popup
&& !suggestions_open
+ && !update_active
&& area.height >= 26
{
render_discover_landing(frame, vertical_chunks[rows.favorites], state, theme);
@@ -3907,7 +3913,57 @@ mod tests {
.iter()
.map(|cell| cell.symbol())
.collect::<String>();
-
assert!(!content.contains("●"));
}
+
+ #[test]
+ fn test_home_banner_suppressed_when_update_modal_active() {
+ let backend = TestBackend::new(100, 30);
+ let mut terminal = Terminal::new(backend).unwrap();
+ let mut state = AppState {
+ update_available: Some(("0.1.18".to_string(), "Release Notes".to_string())),
+ ..Default::default()
+ };
+ let theme = Theme::mocha();
+
+ terminal
+ .draw(|frame| {
+ let area = Rect::new(0, 0, 100, 30);
+ draw(frame, area, &mut state, &theme);
+ })
+ .unwrap();
+
+ let buffer = terminal.backend().buffer();
+ let content = buffer
+ .content()
+ .iter()
+ .map(|cell| cell.symbol())
+ .collect::<String>();
+
+ assert!(!content.contains(&format!("v{}", env!("CARGO_PKG_VERSION"))));
+ }
+
+ #[test]
+ fn test_home_banner_rendered_when_no_update_modal() {
+ let backend = TestBackend::new(100, 30);
+ let mut terminal = Terminal::new(backend).unwrap();
+ let mut state = AppState::default();
+ let theme = Theme::mocha();
+
+ terminal
+ .draw(|frame| {
+ let area = Rect::new(0, 0, 100, 30);
+ draw(frame, area, &mut state, &theme);
+ })
+ .unwrap();
+
+ let buffer = terminal.backend().buffer();
+ let content = buffer
+ .content()
+ .iter()
+ .map(|cell| cell.symbol())
+ .collect::<String>();
+
+ assert!(content.contains(&format!("v{}", env!("CARGO_PKG_VERSION"))));
+ }
}
diff --git a/src/tui/widgets/modal.rs b/src/tui/widgets/modal.rs
index 1ef7790..a1bdab1 100644
--- a/src/tui/widgets/modal.rs
+++ b/src/tui/widgets/modal.rs
@@ -39,7 +39,8 @@ impl<'a> ModalFrame<'a> {
.title_style(self.theme.title)
.borders(Borders::ALL)
.border_type(overlay::border_type(self.basic_terminal))
- .border_style(self.border_style.unwrap_or(self.theme.lavender));
+ .border_style(self.border_style.unwrap_or(self.theme.lavender))
+ .style(Style::default().bg(self.theme.base));
let inner = block.inner(area);
frame.render_widget(block, area);
inner