This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages/templates: visibility based line-quote-button

It was still using HTMX based comment toggle which has been removed from
`64c94491`.

Signed-off-by: Seongmin Lee <git@boltless.me>

author
Seongmin Lee
date (Jul 25, 2026, 1:30 AM +0900) commit c2584c9f parent d9aa6232 change-id unrkzvnm
+8 -19
+8 -19
appview/pages/templates/fragments/line-quote-button.html
··· 18 18 const btnEnd = document.getElementById('line-quote-btn-end'); 19 19 20 20 const textarea = () => 21 - document.querySelector('form[hx-post="/comment"] textarea'); 21 + Array.from(document.querySelectorAll('form[hx-post="/comment"] textarea')) 22 + .find(ta => ta.offsetParent !== null) || null; 22 23 23 24 const lineOf = (el) => 24 25 el?.closest?.('span[id*="-O"]') ··· 108 109 let dragCurrent = null; 109 110 let hoverTarget = null; 110 111 111 - const commentBtn = () => 112 - document.querySelector('[hx-get$="/comment"]:not(form *)'); 112 + const commentToggle = () => 113 + document.querySelector('label[for^="comment-toggle-"]'); 113 114 114 115 const openCommentForm = () => { 115 116 const ta = textarea(); 116 117 if (ta) return Promise.resolve(ta); 117 - const trigger = commentBtn(); 118 + const trigger = commentToggle(); 118 119 if (!trigger) return Promise.resolve(null); 119 120 trigger.click(); 120 - return new Promise(resolve => { 121 - const handler = () => { 122 - const ta = textarea(); 123 - if (!ta) return; 124 - document.body.removeEventListener('htmx:afterSettle', handler); 125 - clearTimeout(timer); 126 - resolve(ta); 127 - }; 128 - const timer = setTimeout(() => { 129 - document.body.removeEventListener('htmx:afterSettle', handler); 130 - resolve(null); 131 - }, 5000); 132 - document.body.addEventListener('htmx:afterSettle', handler); 133 - }); 121 + return new Promise(resolve => 122 + requestAnimationFrame(() => resolve(textarea()))); 134 123 }; 135 124 136 125 const showBtn = (lineEl) => { 137 - if ((!textarea() && !commentBtn()) || !anchorOf(lineEl)) return; 126 + if ((!textarea() && !commentToggle()) || !anchorOf(lineEl)) return; 138 127 const rect = lineEl.getBoundingClientRect(); 139 128 Object.assign(btn.style, { 140 129 top: `${rect.top + rect.height / 2 - btn.offsetHeight / 2}px`,