diff --git a/package.json b/package.json index fe735fe7..15f9f348 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/ink/dom.ts b/src/ink/dom.ts index 993dadd3..f5b672ba 100644 --- a/src/ink/dom.ts +++ b/src/ink/dom.ts @@ -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 // 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) } }