From 24e3bb54db579fb9aad8df2a591527dc77fe4cb4 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Nov 2026 19:19:49 +0100 Subject: v4.0.7: finish the Phase 1 boundary with a command shell The terminal command line moves to client::shell: a typed line becomes a core Command or an adapter action (connect, login, register, set-credential, host maintenance). ClientCore loses submit_line and the last TUI-shaped effects (Interactive, SetPrompt, ListHosts, ForgetHost, AnimateRoulette); the adapter animates roulette from the Result view. Adds forget-login, which drops the stored credential for the pinned key and keeps trust, distinct from logout (session only) and forget-host (trust too). --- src/client/ui.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/client/ui.rs') diff --git a/src/client/ui.rs b/src/client/ui.rs index bb5b55f..7439e0f 100644 --- a/src/client/ui.rs +++ b/src/client/ui.rs @@ -75,6 +75,11 @@ const COMMANDS: &[CommandHelp] = &[ usage: "forget-host [ip:port]", description: "clear trust for one address (credentials stay while the key is in use)", }, + CommandHelp { + name: "forget-login", + usage: "forget-login [ip:port]", + description: "forget the saved login (trust is kept)", + }, CommandHelp { name: "hosts", usage: "hosts", @@ -272,6 +277,15 @@ pub fn terminal_size_warning(columns: u16, rows: u16) -> Option { )) } +/// List of games for the terminal's `games` command. +pub fn game_lines(games: &[(String, String)]) -> Vec { + let mut lines = vec!["Available games:".to_string()]; + for (game, name) in games { + lines.push(format!(" - {game} ({name})")); + } + lines +} + /// One line per settled play, newest first. pub fn history_lines(records: &[crate::history::PlayRecord]) -> Vec { if records.is_empty() { -- cgit v1.2.3