Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit fa57c64

Browse files
committed
Make hop count a fixed-width column for alignment
1 parent 7a830ce commit fa57c64

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/ui/components/PacketList.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,10 @@ function PacketRow({ packet, nodeStore, isSelected }: PacketRowProps) {
348348
const color = getPortColor(packet.portnum);
349349

350350
// Hop info (only show for received packets with valid hop data)
351+
// Fixed width column (7 chars) for alignment
351352
const hops = mp.hopStart != null && mp.hopLimit != null && mp.hopStart > 0
352-
? `(${mp.hopStart - mp.hopLimit}/${mp.hopStart})`
353-
: null;
353+
? `(${mp.hopStart - mp.hopLimit}/${mp.hopStart})`.padEnd(7)
354+
: " ";
354355

355356
// For encrypted packets, show channel and length
356357
const encryptedInfo = packet.portnum === undefined && mp.payloadVariant.case === "encrypted"
@@ -374,7 +375,7 @@ function PacketRow({ packet, nodeStore, isSelected }: PacketRowProps) {
374375
<Text color={theme.data.nodeFrom}>{fromName.padEnd(10)}</Text>
375376
<Text color={theme.data.arrow}>{" -> "}</Text>
376377
<Text color={theme.data.nodeTo}>{toName.padEnd(10)}</Text>
377-
{hops && <Text color={theme.fg.muted}>{hops} </Text>}
378+
<Text color={theme.fg.muted}>{hops}</Text>
378379
{encryptedInfo}
379380
{renderPacketSummary(packet, nodeStore)}
380381
</Text>

0 commit comments

Comments
 (0)