fix(admin): eliminate card-header overlap on narrow widths and fix long key wrapping #57
Reference in New Issue
Block a user
Delete Branch "fix/admin-profiles-page-polish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
PR #56 merged a profiles page redesign, but two real regressions surfaced live:
Card-header overlap at ~340px card width. The header had two rows both using
justify-content-between, forcing badges and action buttons to compete for horizontal space. At narrow card width (the grid'sminmax(340px)minimum), the admit badge (44 admitted · 40 interactiveon 'batch' / 'bigboybritches') crowded into the title on row 1, and on row 2 the 'builtin' badge + lock icon + 'read-only' text overlapped into the copy-duplicate button on 'onlycheaps'.Long snake_case keys in
formatDefinition()wrapped mid-word. Keys likemax_cost_per_1m_completion_tokenssplit arbitrarily mid-word on the narrow onlycheaps card.Fix — visual-engineering
Header restructure (Bug A)
justify-content-between): icon + title (left) vs action buttons ONLY (right). Badge elements removed from row 1 entirely, eliminating the title-vs-badge competition.d-flex align-items-center flex-wrap gap-2): a single unified flex-wrap group containing ALL badges —admitBadge,zeroBadge,sourceBadge,readonlyHint. When they don't fit on one line they wrap cleanly onto a second line with no element sharing that line, so wrapping is impossible to collide with..profile-zero-alert{margin-left:auto}CSS hack (now unnecessary since we have a unified flex-wrap group).Label wrapping (Bug B)
\u200b) after every underscore in definition keys via.replace(/_/g, '_\u200b'). Browsers break at these ZWSP boundaries, somax_cost_per_1m_completion_tokenswraps at_(e.g.max_cost_per_1m_/completion_tokens), not mid-word.title=""with full key to each<div class="profile-field-label">andoverflow-wrap:break-wordto.profile-field-labelfor robust fallback.Verification
Automated: 56 targeted tests pass (
test_admin_frontend.py,test_admin_profiles.py). Full suite: 1512 passed, 9 pre-existing failures in classifier_backoff/gaming_mode (unrelated, confirmed pre-existing).Visual (Playwright/chromium @ 340px card width):
max_cost_per_1m_completionrenders wrapped at_boundaries (confirmed via captured labels show ZWSP at break points, h=36px = 2 lines).PR #56's design intent is preserved but rendered correctly at the narrowest realistic widths.
Pull request closed