From 7ddf5c80f983e4db099932d2480172dce021f772 Mon Sep 17 00:00:00 2001 From: Seth Date: Thu, 12 Mar 2026 04:26:09 +0000 Subject: [PATCH] Refactor box rendering for better alignment - Simplified color code placement in box headers - Improved padding logic for side-by-side display - Better handling of content padding within boxes - Deployed and verified on Pi --- piNail2/tty_status_display.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/piNail2/tty_status_display.py b/piNail2/tty_status_display.py index f8128f6..66209cb 100644 --- a/piNail2/tty_status_display.py +++ b/piNail2/tty_status_display.py @@ -269,7 +269,7 @@ class StatusDisplay: # Draw separate boxes for each nail side-by-side lines.append("{}┌──────────────────────────┐ ┌──────────────────────────┐{}".format( Colors.CYAN, Colors.RESET)) - lines.append("{}│ {}NAIL 1{} │ │ {}NAIL 2{} │{}".format( + lines.append("{}│ {}NAIL 1{:<17}│ │ {}NAIL 2{:<17}│{}".format( Colors.CYAN, Colors.BRIGHT_RED + Colors.BOLD, Colors.CYAN, @@ -282,9 +282,14 @@ class StatusDisplay: for n1_line, n2_line in zip(nail1_lines, nail2_lines): # Pad lines to 24 chars for each box - left = "│ {:<22} │".format(n1_line[:22]) - right = "│ {:<22} │".format(n2_line[:22]) - lines.append("{}{} {}{}".format(left, Colors.CYAN, right, Colors.RESET)) + n1_padded = "{:<24}".format(n1_line[:24]) + n2_padded = "{:<24}".format(n2_line[:24]) + lines.append("{}│ {} │ │ {} │{}".format( + Colors.CYAN, + n1_padded, + n2_padded, + Colors.RESET + )) # Footer lines.append("{}└──────────────────────────┘ └──────────────────────────┘{}".format(