Fix TUI screen wrapping, channel selection/creation, and online members presence
This commit is contained in:
parent
cbc24e7672
commit
25696db42c
12 changed files with 582 additions and 109 deletions
|
|
@ -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}";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue