Skip to content

fix(tree): update rendered node values in SetValue - #1052

Open
jakezwang wants to merge 1 commit into
charmbracelet:mainfrom
jakezwang:fix/tree-node-set-value
Open

jakezwang wants to merge 1 commit into
charmbracelet:mainfrom
jakezwang:fix/tree-node-set-value

Conversation

@jakezwang

Copy link
Copy Markdown

tree.Node.SetValue updates GivenValue, but leaves the underlying rendered tree value unchanged. Value and String still show the old label, and a child node keeps the old label even after the model reloads its nodes.

Update the underlying tree value in the setter as well. Tests cover string, numeric and fmt.Stringer values, preserving child content, and rendering a changed child through the public tree model.

Validation: the focused regression and complete test suite pass with -race on Go 1.27.1; the full suite also passes on Go 1.26.6. go build ./... and the CI-pinned golangci-lint 2.13.1 pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant