Skip to content

fix(ui): detail card status pill spacing + VM name overrun#13

Merged
DaxxSec merged 1 commit into
mainfrom
fix/detail-card-pill-width-and-name-overrun
May 13, 2026
Merged

fix(ui): detail card status pill spacing + VM name overrun#13
DaxxSec merged 1 commit into
mainfrom
fix/detail-card-pill-width-and-name-overrun

Conversation

@DaxxSec
Copy link
Copy Markdown
Owner

@DaxxSec DaxxSec commented May 13, 2026

Bugs

Two visual issues reported on the merged redesign (PR #10):

1. Status pill has dead space around the label

`pillW = 96` to fit "◆ TEMPLATE" (the longest content) with breathing room. But "○ STOPPED" / "● RUNNING" are only ~63pt at the caption font — leaving ~16pt empty on each side of the centered text. Reads as a padding bug, not a tactical capsule.

Before: ![dead-space pill]
After: pill is 80pt — still fits "◆ TEMPLATE" cleanly, shorter statuses look tight + intentional.

2. VM name overruns past the metric grid at default window width

At 1200pt window, the card is ~950pt wide. The metric grid + action-buttons cluster was 955pt — meaning the right-anchored container started at `x = -5`, BEFORE the card's left edge, and overlapped the name label area. A long VM name (`Kali-Router-2024-1` etc.) rendered past the visible card and collided with the OS / Uptime cells once the window was widened.

Fix is two parts:

a) Trim metric widths to claw back ~65pt:

  • `osW` 120 → 100
  • `uptimeW` 80 → 70
  • `cpuW` 110 → 95
  • `netModeW` 100 → 80
  • Kept: `diskW` 110, `rateW` 150, `packetsW` 90 (these can legitimately hit their values)

b) Dynamic name-label width. New `resizeDetailNameLabelToFit()` clamps the label's right edge to `metricsContainer.frame.minX - 8`. Called from initial card-build + every `windowDidResize`. Name now truncates with `.byTruncatingTail` instead of overflowing.

New ivar `detailMetricsContainer` lets the resize logic read the metric grid's actual position rather than re-deriving widths.

Test plan

  • `xcodebuild build` succeeds
  • Launch app at default 1200pt window, select a VM with a long name — name truncates with ellipsis at the metric-grid edge, no overrun
  • Manually narrow the window toward `minWindowWidth` — name keeps truncating as space shrinks, never collides
  • Manually widen — name grows back to its full content, metric grid stays right-anchored
  • Each VM status reads cleanly in the pill: `○ STOPPED`, `● RUNNING`, `◐ STARTING`, `◆ TEMPLATE`, `● SESSION`

Out of scope

A snapshot test for the detail card at three window widths would catch this whole class of bug. Filing as a follow-up — the existing `TacticalUITests` cover row / header / hover components but the identity-area layout has no test today.

🤖 Generated with Claude Code

Two bugs reported visually after PR #10 merged.

1. Status pill has dead space
   The pill was sized at 96pt to fit "◆ TEMPLATE" with breathing room,
   but most statuses ("○ STOPPED", "● RUNNING") are 9 chars at the
   monospaced caption font (~63pt). Center-aligned text inside a 96pt
   pill left a ~16pt empty band on each side that read as "padding
   bug" rather than "tactical pill".

   Pill is now 80pt — still fits "◆ TEMPLATE" (~70pt content) without
   clipping, but the shorter statuses look tight and intentional.

2. VM name overruns past the metric grid at default window width
   At the 1200pt default window width, the card is ~950pt wide. The
   metric grid + actions cluster on the right was 955pt (with the
   prior widths), so the right-anchored container's left edge sat at
   x = -5 — meaning the metrics container started BEFORE the card's
   own left edge and overlapped the name label.

   A long VM name on the left side rendered past the visible card
   area (it wasn't clipped by the card because NSView doesn't clip
   by default), then visually collided with the OS/Uptime cells once
   the user widened the window.

   Two-part fix:
   a) Trim metric widths to claw back ~65pt (osW 120→100, uptimeW
      80→70, cpuW 110→95, netModeW 100→80). diskW / rateW / packetsW
      kept at prior values because their content can legitimately
      hit those widths.
   b) Name label width is now dynamic. New
      `resizeDetailNameLabelToFit()` clamps the label's right edge to
      `metricsContainer.frame.minX - 8` so the name truncates with
      `.byTruncatingTail` instead of overflowing. Called from the
      initial card-build path and again on every windowDidResize, so
      the layout is honest at every size.

   New ivar: `detailMetricsContainer` tracks the right-anchored
   metric grid view so the resize logic can read its actual minX
   rather than recomputing widths.

No test changes — these are visual bugs in code with no test surface
(the existing TacticalUITests cover row/header/hover components; the
detail-card identity layout has no test today). A snapshot test for
the card at three window widths would be the right follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@DaxxSec DaxxSec merged commit c690e81 into main May 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant