3 Commits
Author SHA1 Message Date
fen 2a55f50d87 Merge pull request '#260: static button width during copy feedback (fix attempt 1)' (#268) from fix-260 into dev
CI / test (push) Successful in 23s
CI / docker (push) Successful in 32s
2026-09-17 22:07:44 +00:00
fen b2fd5d548d Merge origin/dev into fix-260 for QA
CI / test (pull_request) Successful in 23s
CI / docker (pull_request) Skipped
2026-09-17 17:06:38 -05:00
fen 11cf7428eb #260: pin button width during copy feedback so neighbors never jump
CI / test (pull_request) Successful in 22s
CI / docker (pull_request) Skipped
2026-09-17 14:47:34 -05:00
2 changed files with 10 additions and 1 deletions
+4 -1
View File
@@ -199,8 +199,11 @@ function finishCreate(data) {
try { try {
navigator.clipboard.writeText(url); navigator.clipboard.writeText(url);
copyBtn.classList.add('ok'); // in-place success feedback (#53) copyBtn.classList.add('ok'); // in-place success feedback (#53)
// #260: pin the pre-swap width so the wider/narrower glyph never
// shifts neighbouring elements; release it when the label restores.
copyBtn.style.minWidth = Math.ceil(copyBtn.getBoundingClientRect().width) + 'px';
copyBtn.textContent = '✓'; copyBtn.textContent = '✓';
setTimeout(() => { copyBtn.classList.remove('ok'); copyBtn.textContent = '⧉'; }, 2000); setTimeout(() => { copyBtn.classList.remove('ok'); copyBtn.textContent = '⧉'; copyBtn.style.minWidth = ''; }, 2000);
} catch(e) { toast('Copy failed', 'error'); } } catch(e) { toast('Copy failed', 'error'); }
}); });
// token carried via sessionStorage, never in the URL (#143) // token carried via sessionStorage, never in the URL (#143)
+6
View File
@@ -19,6 +19,12 @@ function toggleStats() {
function copyFeedback(btn) { function copyFeedback(btn) {
if (!btn) return; if (!btn) return;
if (!btn.dataset.label) btn.dataset.label = btn.textContent; // remember the original label (Copy/Link) if (!btn.dataset.label) btn.dataset.label = btn.textContent; // remember the original label (Copy/Link)
// #260: keep the button width static during the feedback so surrounding
// elements never jump. Pin the pre-swap width, release it on restore.
if (!btn.dataset.pinned) {
btn.style.minWidth = Math.ceil(btn.getBoundingClientRect().width) + 'px';
btn.dataset.pinned = '1';
}
btn.classList.add('ok'); btn.classList.add('ok');
btn.textContent = '✓'; btn.textContent = '✓';
clearTimeout(btn._okh); clearTimeout(btn._okh);