fix: prevent interactive stream crash on node removal
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitlawb/openclaude",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"description": "Claude Code opened to any LLM — OpenAI, Gemini, DeepSeek, Ollama, and 200+ models",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@@ -227,19 +227,21 @@ function collectRemovedRects(
|
||||
removed: DOMNode,
|
||||
underAbsolute = false,
|
||||
): void {
|
||||
if (removed.nodeName === '#text') return
|
||||
const elem = removed as DOMElement
|
||||
if (!removed || removed.nodeName === '#text') return
|
||||
const elem = removed as Partial<DOMElement>
|
||||
// If this node or any ancestor in the removed subtree was absolute,
|
||||
// its painted pixels may overlap non-siblings — flag for global blit
|
||||
// disable. Normal-flow removals only affect direct siblings, which
|
||||
// hasRemovedChild already handles.
|
||||
const isAbsolute = underAbsolute || elem.style.position === 'absolute'
|
||||
const cached = nodeCache.get(elem)
|
||||
const isAbsolute = underAbsolute || elem.style?.position === 'absolute'
|
||||
const cached = nodeCache.get(elem as DOMElement)
|
||||
if (cached) {
|
||||
addPendingClear(parent, cached, isAbsolute)
|
||||
nodeCache.delete(elem)
|
||||
nodeCache.delete(elem as DOMElement)
|
||||
}
|
||||
for (const child of elem.childNodes) {
|
||||
const childNodes = Array.isArray(elem.childNodes) ? [...elem.childNodes] : []
|
||||
for (const child of childNodes) {
|
||||
if (!child) continue
|
||||
collectRemovedRects(parent, child, isAbsolute)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user