Skip to content

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

fix(tui): align popup picker margins symmetrically

Samir Hossainse86882588e4c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fa6ed2..98e0750 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,17 @@
## [Unreleased]
### Changed
+- **Symmetrical Popup and Picker Margin Alignment**:
+ - Eliminated lopsided right-side dead space across all floating popup pickers (Theme Picker, Streaming Sources, Media Player, Subtitles, Catalog Browse, and Provider Popup), aligning borders to provide equal horizontal padding on both sides (`│ content │`).
+ - Corrected `picker_layout` width calculation to `content_width.saturating_add(2)` (accounting for left and right border glyphs) rather than over-allocating `+ 6`, eliminating 4 phantom trailing empty columns.
+ - Standardized symmetrical 2-space padding across all popup picker lines and hit-testing rectangles in `src/tui/app/mouse.rs`.
+ - Updated `overlay::picker` to automatically apply uniform 2-space left and right margins to dynamic items.
+- **Linux ARM64 Production Portability & Installer Hardening**:
+ - Removed Android Bionic TLS assembly hacks (`__bionic_tls_align_anchor`) and Python `PT_TLS` byte-patching from the generic Linux `aarch64-unknown-linux-musl` target, isolating Android Bionic requirements to the dedicated `build-android` (`aarch64-linux-android`) NDK pipeline.
+ - Configured `-C link-arg=-Wl,-z,max-page-size=65536` on `aarch64-unknown-linux-musl`, aligning ELF `PT_LOAD` segments to 64KB to guarantee execution compatibility across 4KB kernels (Raspberry Pi 4B), 16KB kernels (Raspberry Pi 5 / BCM2712), and 64KB kernels (AWS Graviton, enterprise Linux ARM64).
+ - Added a QEMU (`qemu-user-static`) execution smoke test gate in the release CI pipeline for `aarch64-unknown-linux-musl`, actively booting the compiled AArch64 Linux binary and verifying `--version` before packaging.
+ - Enhanced `install.sh` to proactively detect 32-bit Raspbian userland (`getconf LONG_BIT == 32`) on 64-bit ARM hardware, providing an actionable native `cargo install` path rather than attempting incompatible 64-bit binary execution.
+ - Improved `install.sh` smoke test failure diagnostics to capture and print explicit non-zero exit codes when binary execution fails without output.
- **Modal and Overlay Declutter — Keyhint Footer Removal**:
- Removed redundant boilerplate footer keyhint bars (`render_modal_footer` / `render_footer`) and top divider borders across all modal dialogs and overlay pickers (Settings, Streaming Sources, Themes, Players, Subtitles, TV Config, Addon Manager, Provider popup).
- Removed duplicate and truncated popup title headers on option-selection pickers (Media Player, Themes, Sources) so they cleanly present options without repeating row labels.
diff --git a/docs/addons-mode.md b/docs/addons-mode.md
index fa14022..7a57cbf 100644
--- a/docs/addons-mode.md
+++ b/docs/addons-mode.md
@@ -12,7 +12,7 @@ Stremio Addons are integrated directly into standard Streaming Mode as a first-c
- **Series & Episode Hierarchy**: Series are automatically organized into explicit `Seasons` and `Episodes` selector panes with smooth horizontal navigation (`←`/`→`/`h`/`l`/`Tab`). Selecting any episode drives episode-specific stream requests (`/stream/series/:id:season:episode.json`).
- **Episode Stream Isolation**: Built-in token parsing (`parse_season_episode`) guarantees that only streams matching the selected season and episode are displayed, eliminating cross-episode stream mixing.
- **Direct Playback & Custom Headers**: Video stream headers (`behaviorHints.headers`) such as `Referer` and `User-Agent` are preserved and forwarded directly to external media players (`mpv`, `IINA`, `VLC`) and the multi-segment downloader.
-- **Watch History & Progress Parity**: Full `/history` support in Addon Mode with real-time `mpv` position tracking, scrub lines, and auto-resume.
+- **Watch History & Progress Parity**: Full `/history` support for Addon streams with real-time `mpv` position tracking, scrub lines, and auto-resume.
- **High-Performance Caching**: Curated `/browse` catalogs are cached for `1 hour`, manifests for `24 hours`, and stream aggregations for `2 hours`.
## Accessing Addon Streams
diff --git a/docs/architecture.md b/docs/architecture.md
index 99444cd..1994cc9 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -49,7 +49,7 @@ src/
episode-stream actions
navigation.rs list navigation, submit actions, provider helpers
tv.rs TV mode: playlist manager + playback
- addons.rs Addon mode: addon manager + HTTP addon actions
+ addons.rs Addon manager modal + HTTP addon actions
keyboard.rs raw key-event handling
mouse.rs mouse click handling and hitbox routing
system.rs help, refresh, cache, theme, updates, focus, resize
diff --git a/docs/config.md b/docs/config.md
index 9097f71..9821897 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -30,7 +30,7 @@ All settings in `config.json` can be configured interactively inside the applica
- **General**: Toggle automatic update checks, choose default media player (`mpv`, `VLC`, `IINA`, `Android`), and edit download folder path.
- **Content Modes**: Toggle Streaming Mode, open the Streaming Sources selector (to enable/disable MovieBox, 4KHDHub, CircleFTP, DhakaFlix), and toggle Live TV.
- **Appearance**: Open the visual theme swatch picker to select among 6 built-in color themes.
-- **Maintenance**: Purge disk cache, query GitHub for release updates, open GitHub repository, and trigger a manual local network BDIX re-probe.
+- **Maintenance**: Purge disk cache, clear watch history, query GitHub for release updates, open GitHub repository, and trigger a manual local network BDIX re-probe.
## Other persisted files
- `addons_config.json` — list of installed HTTP addons in the config directory (see [addons-mode.md](addons-mode.md)).
diff --git a/docs/controls.md b/docs/controls.md
index b9c7bf0..8337483 100644
--- a/docs/controls.md
+++ b/docs/controls.md
@@ -103,10 +103,10 @@ Type these commands directly into the search bar:
| Command | Applicable Mode | Action |
| :--- | :--- | :--- |
-| `/settings` | All | Open interactive Settings & Preferences Hub (aliases `/config`, `/pref`, `/preferences`, `/options`) |
-| `/browse` | Streaming / Addon | Browse curated views (Trending, Popular) or Addon catalogs (Top Movies, Top Series) |
-| `/history` | Streaming / Addon | View watch history with latest progress |
-| `/favorites` | Streaming / Addon | View all starred titles |
+| `/settings` | All | Open interactive Settings & Preferences Hub (aliases `/config` [opens Addon Manager in Addons provider or TV playlist manager in TV mode], `/pref`, `/preferences`, `/options`) |
+| `/browse` | Streaming | Browse curated views (Trending, Popular) or Addon catalogs (Top Movies, Top Series) |
+| `/history` | Streaming | View watch history with latest progress |
+| `/favorites` | Streaming | View all starred titles |
| `/clear` | All | Clear search results and return to landing |
| `/help` | All | Open interactive keybinding help menu (alias `/?`) |
| `/list` | TV | View live TV channels |
diff --git a/src/tui/app/mouse.rs b/src/tui/app/mouse.rs
index d9f2b76..130a77c 100644
--- a/src/tui/app/mouse.rs
+++ b/src/tui/app/mouse.rs
@@ -67,7 +67,7 @@ impl App {
.state
.available_players
.iter()
- .map(|k| k.label().to_string())
+ .map(|k| format!(" {} ", k.label()))
.collect::<Vec<_>>();
let confirm_label = "Select";
match click_in_picker(
@@ -93,7 +93,7 @@ impl App {
if self.state.show_sources_popup {
let items = crate::providers::models::ProviderKind::ENABLED
.iter()
- .map(|p| format!(" [✓] {} ", p.label()))
+ .map(|p| format!(" [✓] {} ", p.label()))
.collect::<Vec<_>>();
match click_in_picker(
crate::tui::overlay::picker_layout(area, &items, "Toggle", 20),
@@ -234,7 +234,7 @@ impl App {
} else {
"[DISCOVER] "
};
- format!("{badge_str}{label}")
+ format!(" {badge_str}{label} ")
})
.collect();
match click_in_picker(
@@ -317,7 +317,7 @@ impl App {
.state
.subtitle_list
.iter()
- .map(|(name, _)| crate::tui::text::format_subtitle_label(name))
+ .map(|(name, _)| format!(" {} ", crate::tui::text::format_subtitle_label(name)))
.collect::<Vec<_>>();
let confirm_label = if self.state.is_download_subtitle_popup {
"Download"
diff --git a/src/tui/app/run.rs b/src/tui/app/run.rs
index 1e0ba37..07a3796 100644
--- a/src/tui/app/run.rs
+++ b/src/tui/app/run.rs
@@ -918,9 +918,9 @@ impl App {
.iter()
.map(|name| {
if self.state.basic_terminal {
- format!(" {name:<pad$} * * * ", pad = longest_name)
+ format!(" {name:<pad$} * * * ", pad = longest_name)
} else {
- format!(" {name:<pad$} ■ ■ ■ ", pad = longest_name)
+ format!(" {name:<pad$} ■ ■ ■ ", pad = longest_name)
}
})
.collect();
@@ -931,13 +931,13 @@ impl App {
let mut spans = vec![
Span::raw(" "),
Span::styled(format!("{name:<pad$}", pad = longest_name), self.theme.text),
- Span::raw(" "),
+ Span::raw(" "),
];
spans.extend(crate::tui::theme::Theme::palette_swatch_spans(
name,
self.state.basic_terminal,
));
- spans.push(Span::raw(" "));
+ spans.push(Span::raw(" "));
Line::from(spans)
})
.collect();
@@ -969,7 +969,7 @@ impl App {
let providers = crate::providers::models::ProviderKind::ENABLED;
let raw_items: Vec<String> = providers
.iter()
- .map(|p| format!(" [✓] {} ", p.label()))
+ .map(|p| format!(" [✓] {} ", p.label()))
.collect();
let lines: Vec<ratatui::text::Line<'static>> = providers
.iter()
@@ -1000,10 +1000,10 @@ impl App {
self.theme.text_dim
};
ratatui::text::Line::from(vec![
- ratatui::text::Span::raw(" "),
+ ratatui::text::Span::raw(" "),
ratatui::text::Span::styled(check, check_style),
ratatui::text::Span::styled(p.label(), label_style),
- ratatui::text::Span::raw(" "),
+ ratatui::text::Span::raw(" "),
])
})
.collect();
@@ -1031,7 +1031,7 @@ impl App {
.state
.available_players
.iter()
- .map(|k| format!(" {} ", k.label()))
+ .map(|k| k.label().to_string())
.collect::<Vec<_>>();
crate::tui::overlay::picker(
frame,
diff --git a/src/tui/overlay.rs b/src/tui/overlay.rs
index ef95487..9bc6e84 100644
--- a/src/tui/overlay.rs
+++ b/src/tui/overlay.rs
@@ -35,7 +35,7 @@ pub fn picker_layout(
.map(|item| crate::tui::text::width(item))
.max()
.unwrap_or(0)
- .saturating_add(6);
+ .saturating_add(2);
centered(
area,
content_width as u16,
@@ -137,13 +137,14 @@ pub fn picker(
theme: &Theme,
basic_terminal: bool,
) {
+ let padded_items: Vec<String> = items.iter().map(|item| format!(" {item} ")).collect();
let lines: Vec<Line<'static>> = items
.iter()
.map(|item| {
Line::from(vec![
- Span::raw(" "),
+ Span::raw(" "),
Span::raw(item.clone()),
- Span::raw(" "),
+ Span::raw(" "),
])
})
.collect();
@@ -151,7 +152,7 @@ pub fn picker(
frame,
area,
&lines,
- items,
+ &padded_items,
state,
spec,
theme,
@@ -872,6 +873,18 @@ mod tests {
let layout_two = picker_layout(area, &items_two, "Use", 20);
assert_eq!(layout_two.height, 4);
}
+ #[test]
+ fn test_picker_layout_symmetrical_margins() {
+ let area = Rect::new(0, 0, 80, 24);
+ let items = vec![
+ " [✓] MovieBox ".to_string(),
+ " [✓] CircleFTP (BDIX) ".to_string(),
+ ];
+ let layout = picker_layout(area, &items, "", 10);
+ assert_eq!(layout.width, 26);
+ let inner_width = layout.width.saturating_sub(2);
+ assert_eq!(inner_width, 24);
+ }
#[test]
fn test_notification_style_colors_match_kind() {
diff --git a/src/tui/screens/home.rs b/src/tui/screens/home.rs
index 25dc944..0cf4321 100644
--- a/src/tui/screens/home.rs
+++ b/src/tui/screens/home.rs
@@ -2157,7 +2157,7 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
} else {
"[DISCOVER]"
};
- format!("{badge_str}{spacing}{label}")
+ format!(" {badge_str}{spacing}{label} ")
})
.collect();
@@ -2166,9 +2166,11 @@ pub fn draw(frame: &mut Frame, area: Rect, state: &mut AppState, theme: &Theme)
.map(|label| {
let (badge, spacing) = crate::tui::overlay::browse_category_badge(label, theme);
Line::from(vec![
+ Span::raw(" "),
badge,
Span::raw(spacing),
Span::styled(label.to_string(), theme.text),
+ Span::raw(" "),
])
})
.collect();
@@ -2534,9 +2536,10 @@ fn render_provider_popup(
};
let label_style = theme.text;
ListItem::new(Line::from(vec![
- Span::raw(" "),
+ Span::raw(" "),
Span::styled(active_prefix, active_style),
Span::styled(provider.label(), label_style),
+ Span::raw(" "),
]))
})
.collect();