Fix TUI screen wrapping, channel selection/creation, and online members presence

This commit is contained in:
tyuXX 2026-10-11 17:21:54 +00:00
parent cbc24e7672
commit 25696db42c
12 changed files with 582 additions and 109 deletions

View file

@ -31,9 +31,11 @@ public class ChatScreen : IScreen
string topic = ch != null && !string.IsNullOrEmpty(ch.Topic) ? $" - {ch.Topic}" : "";
// Header line
string header = $" {Ansi.Bold}{Ansi.Cyan}{chName}{Ansi.Reset}{Ansi.Gray}{topic}{Ansi.Reset}";
int onlineCount = _state.Users.Count(u => u.IsOnline);
string onlineTag = $" {Ansi.Gray}({Ansi.BrightGreen}● {onlineCount} online{Ansi.Gray}){Ansi.Reset}";
string header = $" {Ansi.Bold}{Ansi.Cyan}{chName}{Ansi.Reset}{Ansi.Gray}{topic}{Ansi.Reset}{onlineTag}";
sb.AppendLine(PadOrTruncate(header, width));
sb.AppendLine(new string('─', Math.Max(0, width)));
sb.AppendLine(new string('─', Math.Max(0, width - 1)));
// Messages area: height minus (Header: 2, Footer/Input: 3, Tab bar & status: 3) = height - 8
int msgAreaHeight = Math.Max(3, height - 8);
@ -85,7 +87,7 @@ public class ChatScreen : IScreen
}
// Divider
sb.AppendLine(new string('─', Math.Max(0, width)));
sb.AppendLine(new string('─', Math.Max(0, width - 1)));
// Input Line
string prompt = $" {Ansi.Cyan}[{chName}] > {Ansi.Reset}";