#260: .swapbtn grid for copy feedback (fix attempt 2)
CI / test (pull_request) Successful in 23s
CI / docker (pull_request) Skipped

Label and checkmark stack in one grid cell (inline-grid, grid-area 1/1,
checkmark visibility-hidden until .ok), so the button width is static by
construction across the click. Replaces the min-width pin from fix attempt
1, which enlarged buttons by up to 0.64px (ceil of fractional width) and
leaked the pin after restore.

Applies to paste-view Copy/Link (paste.html + paste.js copyFeedback) and
the /new result-box copy button (new.js). Verified with CDP bounding-box
probes: Copy width/x identical before/during/after at 1400x900 and
375x812 (including the previously failing 52.36px mobile case), Link
button static, checkmark visible during feedback, no minWidth pin set.
This commit is contained in:
fen
2026-09-17 17:18:15 -05:00
parent 2a55f50d87
commit c32566979f
4 changed files with 15 additions and 17 deletions
+8
View File
@@ -580,6 +580,14 @@ a.admin-link:hover { color: var(--fg); text-decoration: underline; }
outline-offset: 1px;
}
/* swapbtn (#260): the label and the checkmark occupy the same grid cell, so
toggling feedback never changes the button's width — no pinning needed */
.swapbtn { display: inline-grid; }
.swapbtn > * { grid-area: 1 / 1; }
.swapbtn .btn-check { visibility: hidden; }
.swapbtn.ok .btn-check { visibility: visible; }
.swapbtn.ok .btn-label { visibility: hidden; }
/* in-place copy success feedback (#53) */
.iconbtn.ok, .btn.ok {
color: var(--ok);