[verified] feat(tui): fail-closed /file transfer (1 MiB)
All checks were successful
ci / test (pull_request) Successful in 3m9s

Typed fil frames chunk a local file to the selected friend over the
existing one-shot pipe. Receive-side 1 MiB cap, basename-only names,
hash check before rename, never overwrite. Chat shows [file] name only.
This commit is contained in:
Sirius DevOps 2026-09-10 23:32:06 -04:00
commit 0ea6fd68c4
No known key found for this signature in database
10 changed files with 641 additions and 8 deletions

View file

@ -2,8 +2,8 @@
use onionwire::qr;
use onionwire::tui::{
banner_for_width, compact_banner, draw_share, help_overlay_text, main_footer_hints,
onion_glyph, status_footer, wordmark_banner, Pane,
Pane, banner_for_width, compact_banner, draw_share, help_overlay_text, main_footer_hints,
onion_glyph, status_footer, wordmark_banner,
};
#[test]
@ -40,8 +40,20 @@ fn help_overlay_lists_core_bindings() {
let help = help_overlay_text();
assert!(!help.is_empty());
for needle in [
"Tab", "F2", "F3", "F4", "F5", "send chat", "/profile", "/pay", "/tip", "/backup",
"/restore", "Ctrl-Q", "?",
"Tab",
"F2",
"F3",
"F4",
"F5",
"send chat",
"/profile",
"/pay",
"/tip",
"/file",
"/backup",
"/restore",
"Ctrl-Q",
"?",
] {
assert!(help.contains(needle), "help overlay missing {needle:?}");
}
@ -65,10 +77,10 @@ fn banner_for_width_collapses_when_narrow() {
#[test]
fn chrome_renders_at_80x24_and_120x40() {
use ratatui::Terminal;
use ratatui::backend::TestBackend;
use ratatui::layout::{Constraint, Layout};
use ratatui::widgets::Paragraph;
use ratatui::Terminal;
let fp = "abcdef0123456789";
let onion = "abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion";
@ -166,8 +178,8 @@ fn restore_terminal_is_callable_without_panic() {
#[test]
fn share_screen_shows_invite_not_qr_at_80x24() {
use ratatui::backend::TestBackend;
use ratatui::Terminal;
use ratatui::backend::TestBackend;
let sk = [7u8; 32];
let onion = "abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrstuvwx.onion";