mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 21:15:52 +03:00
[PR #215] [MERGED] fix: standardize TextNode remove method to use ID-based lookup to resolve "Child not found in children" error #1154
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1154
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/215
Author: @eli0shin
Created: 10/12/2025
Status: ✅ Merged
Merged: 10/12/2025
Merged by: @kommander
Base:
main← Head:use-id-for-text-remove📝 Commits (3)
b4e3d3crefactor: standardize TextNode remove method to use ID-based lookup6830deeremove redundant children iteration4bae25bMerge branch 'main' into use-id-for-text-remove📊 Changes
4 files changed (+15 additions, -22 deletions)
View changed files
📝
packages/core/src/renderables/Text.ts(+2 -5)📝
packages/core/src/renderables/TextNode.test.ts(+3 -3)📝
packages/core/src/renderables/TextNode.ts(+9 -5)📝
packages/solid/src/reconciler.ts(+1 -9)📄 Description
There is an architectural mismatch in the class hierarchy:
abstract remove(id: string): void- expecting ID-based lookuprenderableMapById.get(id)to look up child by IDSpanRenderableinherits from) implements it incorrectly:remove(child: string | TextNodeRenderable): thisindexOf(child)to find the child - NO ID LOOKUPFor example, this code works:
But this code throws the error because the child of
<text>is conditionalThe solid reconciler passes node reference directly for TextNodeRenderables and passes it to
removebut the react one does not, which raises the question: Why areTextNodeRenderables different than other renderables? Why do they use remove by reference instead of by id?This PR aligns TextNodeRenderable with other renderables and updates the solid reconciler to pass children to remove by id.
Resolves https://github.com/sst/opentui/issues/214
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.