render-dom-lake: mark reused lakes to prevent SPA nav conflicts

After reusing an SSR lake element, set data-sx-lake-claimed attribute.
Subsequent dom-query uses :not([data-sx-lake-claimed]) to skip already-
reused elements, preventing SPA navigation from picking up stale lakes
from previous pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 15:30:50 +00:00
parent 547d271571
commit bea8779aea
11 changed files with 45 additions and 20 deletions

View File

@@ -920,7 +920,7 @@
(dict "i" 0 "skip" false)
args)
(let
((existing (when (and (client?) lake-id) (dom-query (str "[data-sx-lake=\"" lake-id "\"]")))))
((existing (when (and (client?) lake-id) (let ((el (dom-query (str "[data-sx-lake=\"" lake-id "\"]:not([data-sx-lake-claimed])")))) (when el (dom-set-attr el "data-sx-lake-claimed" "1")) el))))
(if
existing
existing