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
This commit is contained in:
2026-03-12 04:26:09 +00:00
parent b22702bc9d
commit 7ddf5c80f9
+9 -4
View File
@@ -269,7 +269,7 @@ class StatusDisplay:
# Draw separate boxes for each nail side-by-side # Draw separate boxes for each nail side-by-side
lines.append("{}┌──────────────────────────┐ ┌──────────────────────────┐{}".format( lines.append("{}┌──────────────────────────┐ ┌──────────────────────────┐{}".format(
Colors.CYAN, Colors.RESET)) Colors.CYAN, Colors.RESET))
lines.append("{} {}NAIL 1{} │ │ {}NAIL 2{} {}".format( lines.append("{}{}NAIL 1{:<17}│ │ {}NAIL 2{:<17}{}".format(
Colors.CYAN, Colors.CYAN,
Colors.BRIGHT_RED + Colors.BOLD, Colors.BRIGHT_RED + Colors.BOLD,
Colors.CYAN, Colors.CYAN,
@@ -282,9 +282,14 @@ class StatusDisplay:
for n1_line, n2_line in zip(nail1_lines, nail2_lines): for n1_line, n2_line in zip(nail1_lines, nail2_lines):
# Pad lines to 24 chars for each box # Pad lines to 24 chars for each box
left = "{:<22}".format(n1_line[:22]) n1_padded = "{:<24}".format(n1_line[:24])
right = "{:<22}".format(n2_line[:22]) n2_padded = "{:<24}".format(n2_line[:24])
lines.append("{}{} {}{}".format(left, Colors.CYAN, right, Colors.RESET)) lines.append("{}{} │ │ {}{}".format(
Colors.CYAN,
n1_padded,
n2_padded,
Colors.RESET
))
# Footer # Footer
lines.append("{}└──────────────────────────┘ └──────────────────────────┘{}".format( lines.append("{}└──────────────────────────┘ └──────────────────────────┘{}".format(