Remove click buffer, add CSS cursor:pointer for island controls

The click buffer (capture + stopPropagation + replay) caused more
harm than good: synchronous XHR blocks the main thread during kernel
load, so there's no window where clicks can be captured. The buffer
was eating clicks after hydration due to property name mismatches.

Replace with pure CSS: buttons/links/[role=button] inside islands
get cursor:pointer from SSR. No JS needed, works immediately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 15:50:12 +00:00
parent 27059c0581
commit 31ed8b20f4
3 changed files with 4 additions and 45 deletions

View File

@@ -492,27 +492,7 @@
(process-elements nil)
;; Wire up popstate for back/forward navigation
(dom-listen (dom-window) "popstate"
(fn (e) (handle-popstate 0)))
;; Replay buffered clicks from hydration gap
(let ((queued (host-get (dom-window) "_sxQ")))
(when queued
(let ((arr (host-call (host-global "Array") "from" queued)))
(let ((n (host-get arr "length")))
(when (> n 0)
(log-info (str "replaying " n " buffered click(s)"))
(let loop ((i 0))
(when (< i n)
(let ((entry (host-call arr "at" i)))
(when entry
(let ((target (host-get entry "t")))
(when (and target (host-get target "isConnected"))
(dom-remove-class target "sx-pending")
(host-call target "click")))))
(loop (+ i 1)))))))
(host-set! (dom-window) "_sxQ" nil)
;; Clear any remaining pending indicators
(for-each (fn (el) (dom-remove-class el "sx-pending"))
(dom-query-all (dom-body) ".sx-pending")))))))
(fn (e) (handle-popstate 0))))))