fix: render dsh-ui fences when the host row lacks data-chat-anchor-key (Safari) - #2
Merged
Merged
Conversation
…y (Safari) Safari (and any host render path that drops the routed node's React key) omits `data-chat-anchor-key` from message rows — Chrome renders the same page with it. `rowOf` returned null there and the DOM channel silently abandoned every fence: no UI, no error, no log. - rowOf fallback chain: [data-chat-anchor-key] → [data-chat-flow-key]/ [data-chat-flow-kind] (the same row div's routing attributes; kind is a separate value that survives an undefined key) → the code block itself, with identity degrading to dom:unknown:<ordinal>. - fenceIndexOf: when the chain bottoms out at the block, count settled dsh-ui blocks in document order so sibling fences never collide on one dom:unknown:N identity. - anchorSeqOf: document-order fallback now counts flow rows too, so anchor-less rows keep a monotonic seq estimate. - Diagnostics: every silent return point warns once per block (`[dsh-genui]` prefix, WeakSet-guarded against the 1s sweep) — missing anchor, settled empty body, settled unrepairable body. Closes #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1 — Safari 下
dsh-ui围栏全部静默丢失。根因
宿主把
data-chat-anchor-key渲染为 React key 派生属性(routedNode.key);Safari 的渲染路径里该 key 为 undefined 时 React 直接省略属性 →rowOf落空 → DOM 通道在静默 return 点放弃每个围栏(无 UI、无报错、无日志)。Chrome 同页 14 个代码块全有锚点、Safari 0 个,与 issue 排查一致。修复(
src/client/dom-fence.tsx)[data-chat-anchor-key]→[data-chat-flow-key]/[data-chat-flow-kind](宿主同一行 div 的路由属性,kind 独立于 key、可幸存)→ 代码块自身(身份降级为dom:unknown:<序数>)fenceIndexOf:无行兜底时按全文档已落定 dsh-ui 块序数计数,兄弟围栏不会撞同一个dom:unknown:NanchorSeqOf:文档序兜底改用联合选择器,无锚点行仍得单调 seq 估计console.warn([dsh-genui]前缀,WeakSet 每块一次,1s sweep 不刷屏):无锚点降级 / 落定空体 / 落定不可修复体验证
lib/client.js已重建并提交