Success! on button clicks #260
Notifications
Total Time Spent: 3 hours 7 minutes
fen
3 hours 7 minutes
No due date set.
Dependencies
No dependencies set.
Reference: poslop/palette#260
Reference in New Issue
Block a user
when clicked the buttons turn green and show success as they should. the problem is the message success is wider than the normal text which causes elements and buttons to jump around.
to avoid this instead of saying success replace it with a short and small checkmark
QA PASS. Verified live on palette-dev after merging #262 and deploying the CI dev image.
Fix: Success! text replaced with a compact checkmark in new.js (result box copy button) and paste.js (copyFeedback, restores the saved dataset.label).
Evidence: rendered CDP probe at 1400x900 and 375x812. Copy button 76px -> 44px (desktop) / 52px -> 33px (mobile) while showing the checkmark; Link button and row bounds unchanged (0px shift), label restores correctly. Served paste.js/new.js sha256 match origin/dev tip. go build + go test pass.
The button size should be static and shouldnt change on click. the check mark looks good but its still jerky.
QA FAIL (PR #268, fix attempt 1 — merged as
2a55f50dand deployed to palette-dev, served paste.js/new.js sha256 match origin/dev; the deploy itself is fine, the acceptance is not met).Measured rendered bounding boxes of the Copy button (#copy-btn) on https://palette-dev.archfox.org/4uarj5, real .click(), checkmark visible during, clipboard verified written:
Identical result at 375x812 (52.36 → 53.00 → 53.00). Neighbor Link button did not move, but the button itself is NOT pixel-identical across the click, which the acceptance rejects.
Root cause: the fix pins
Math.ceil(width)= 53 while the natural rendered width is 52.36px (fractional px), so the min-width pin itself enlarges the button. It is also not the .swapbtn pattern you asked for: textContent is still swapped rather than stacking label + checkmark in one grid cell, so the pin bookkeeping is load-bearing and leaks (minWidth persists after restore).Fix guidance for attempt 2: implement .swapbtn in new.js + paste.js (inline-grid, label and ✓ in grid-area 1/1, ✓ visibility:hidden until .ok) so no width pinning is needed at all, and verify Copy rect is identical before/during/after at 1400x900 and 375x812.
Superseding PR #272 (fix-260) closed without merging: a competing fix-attempt-2 implementation (#271, fix-260-r2) was already merged to dev. Same .swapbtn one-grid-cell approach; QA continues against dev tip.
QA PASS. Verified live on palette-dev after merging #271 and deploying the CI dev image (
ca0e511).Fix: .swapbtn pattern — label and checkmark stack in one inline-grid cell (grid-area 1/1), button width is always the wider of the two, feedback is a pure .ok class toggle. Replaces attempt 1 min-width pinning and all textContent swaps in new.js and paste.js; markup updated in paste.html.
Evidence: served app.css/new.js/paste.js sha256 match origin/dev tip. CDP probe on /4uarj5, real control path (copyFeedback) at 1400x900 and 375x812: Copy 76.42px before / during / after (desktop), 52.36px all states (mobile); Link 65.63px / 45.86px static likewise; checkmark visibility hidden→visible→hidden; button-row top shift 0.00px. Wrap toggle off (control case). No width change in any state, no element movement.
QA PASS — #260 fix attempt 2 (PR #271)
Verified live on https://palette-dev.archfox.org (deployed image confirmed: served app.css/new.js/paste.js sha256 identical to
git show origin/dev).All three measured rects identical to 0.01px before / during (.ok) / after click; checkmark visible during .ok, label restored after; no neighbor movement; zero CSP violations (only pre-existing password-field DOM recommendations). Real Input.dispatchMouseEvent clicks; clipboard content confirmed via readText.
Paste view — Copy (1400x900): w 76.421875, h 43.296875, x 592.4375, y 109 — constant across all three states
Paste view — Link (1400x900): w 65.625, h 43.296875, x 514.8125, y 109 — constant
New page — result Copy (1400x900): w 78.46875, h 36, x 1094, y 824.765625 — constant
Paste view — Copy (375x812): w 52.359375, h 32.84375, x 25, y 119.84375 — constant (attempt-1's 52.36→53.00 growth is gone)
Paste view — Link (375x812): w 45.859375, h 32.84375, x 274.34375, y 79 — constant
New page — result Copy (375x812): w 78.46875, h 36, x 243.296875, y 744.890625 — constant
Pin code (minWidth/Math.ceil/textContent swap) confirmed absent from fix-260-r2. Issue closed, labels cleared.