mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 04:33:17 +00:00
Wrap long identity chips inside phone drawers (#2731)
Below the lg breakpoint, the inline drawer's Identity section rendered alias and IP chips as hand-rolled nowrap spans inside a fixed-layout table cell. Generated aliases such as `proxmox-lxc-docker:Production West:pve1:113` or `k8s-production-1:deployment:redis-ffcd-b17c78f012` are wider than that value cell on a phone, so the cell's hidden overflow and the drawer's clipping content shell cut them off with no ellipsis. The part that distinguishes two aliases is at the end, and a phone has no hover to show the title. - `MetadataBadge` (the contract owner of read-only chip whitespace handling) gains an opt-in `wrap` mode: the chip is capped at its container and breaks inside a token only where no space or hyphen fits. Default stays nowrap; existing consumers get byte-identical classes. - The drawer's IP, alias and alias-count chips in `ResourceDetailSummary.tsx` compose `MetadataBadge`; identity values wrap in full. Desktop drawers are unchanged (one line per alias). - The shared template registry requires the consumer and forbids the old hand-rolled chip classes there; the guardrail and unit tests cover the wrap classes. - `04-mobile.spec.ts` opens a Docker container drawer at phone width and fails if any Identity-section element or text crosses the detail cell, table wrapper or drawer shell (values that end in their own ellipsis excepted). Measured on a private mock estate at 390px: 53 cut chips across 92 Docker/Kubernetes/Proxmox/Machines drawers before, 0 identity chips past the shell across 140 drawers at 390 and 768px after. Rebased on main after #2703 (wider phone drawers): the new spec passes on the Pixel 5 and iPhone 12 projects and fails with the two runtime files reverted (`proxmox-lxc-docker:...:113` still 71px past the cell). Correlation-summary and redaction-label chips were checked and left alone: redaction labels are a fixed five-word vocabulary, and the correlation chips sit outside the nowrap table and break at spaces and hyphens.
This commit is contained in:
@@ -2355,6 +2355,20 @@ not a replacement status card, CTA band, or page-local nested card.
|
||||
Proxmox backup source/state chips follow the same boundary: storage/recovery
|
||||
owns backup-source labels and state semantics, while the visible chip shell
|
||||
and tone vocabulary route through `MetadataBadge`.
|
||||
Resource drawer identity chips (the IP address and alias chips and the
|
||||
alias overflow count in `ResourceDetailSummary.tsx`) compose `MetadataBadge`
|
||||
too. Badges stay on one line by default; an identity value that can outgrow
|
||||
a narrow drawer cell opts into the badge's `wrap` mode, which caps the chip
|
||||
at its container and breaks inside a token only where no space or hyphen
|
||||
fits. These values differ at their ends (`...:pve1:113`, a container hash)
|
||||
and a phone has no hover to show a title, so they wrap rather than
|
||||
truncate. A one-line alias used to overflow its fixed-width value cell at
|
||||
phone widths, where the cell's hidden overflow and the inline drawer's
|
||||
clipping content shell cut it off without an ellipsis.
|
||||
`tests/integration/tests/04-mobile.spec.ts` opens a Docker container drawer
|
||||
at phone width and checks that no element or text in its Identity section
|
||||
crosses either edge of those clipping boxes, apart from values that end in
|
||||
their own ellipsis.
|
||||
Workload backup freshness follows a separate shared presentation boundary:
|
||||
`frontend-modern/src/utils/workloadGuestPresentation.ts` owns the canonical
|
||||
tone and icon mapping consumed by workload rows and drawers. A recorded
|
||||
|
||||
Reference in New Issue
Block a user