fix(peer): serve full browse listings + harden the listener; TUI transfer/UX work

Peer layer:
- Stream peer messages with a partial-write queue instead of write_all, so a
  large SharedFileListResponse over the non-blocking socket is no longer
  truncated (third-party clients like SoulseekQt can now browse our shares).
- Bound the peer-init handshake with a read timeout and handle each accepted
  connection on its own thread, so one stalled peer can't wedge the listener.
- e2e: third-party direct/brokered/large-share browse + stalled-peer coverage.

TUI:
- Uploads share the downloads table columns (real Speed) and the info pane now
  renders details for a selected upload.
- Download progress bar counts only in-progress transfers and hides when idle.
- Always-visible unread badge (private messages + rooms) in the shortcuts bar,
  self-drawn blink so it works under tmux.
- Persist the unread private-message count across restarts.
This commit is contained in:
Michel de Graaf
2026-07-24 21:18:20 +02:00
parent 105c798855
commit be5dc6c064
24 changed files with 1503 additions and 159 deletions
+15 -1
View File
@@ -8,7 +8,7 @@ mod settings;
use crate::models::AppState;
use crate::persist::{
snapshot::{Snapshot, restore_searches},
snapshot::{Snapshot, restore_messages, restore_searches},
state::StateStore,
};
use color_eyre::Result;
@@ -61,6 +61,10 @@ impl MainTui {
let Some(store) = &self.store else { return };
restore_searches(&mut self.state, &store.load_search_queries());
restore_messages(&mut self.state, &store.load_messages());
// Restore the unread badge so messages left unread carry over. Set
// before the baseline snapshot below so it isn't seen as a change.
self.state.unread_messages = store.load_unread();
for room in store.load_rooms() {
if self.state.rooms.focus_or_open(&room)
@@ -139,6 +143,16 @@ impl MainTui {
{
soulseek_rs::warn!("Could not save room state: {e}");
}
if snapshot.messages != self.saved_snapshot.messages
&& let Err(e) = store.save_messages(&snapshot.messages)
{
soulseek_rs::warn!("Could not save message history: {e}");
}
if snapshot.unread_messages != self.saved_snapshot.unread_messages
&& let Err(e) = store.save_unread(snapshot.unread_messages)
{
soulseek_rs::warn!("Could not save unread count: {e}");
}
self.saved_snapshot = snapshot;
}