Skip to content

Preserve BoxList comments during dotted deletion and sorting - #349

Merged
cdgriffith merged 1 commit into
cdgriffith:developfrom
HocVoNgThai:fix/boxlist-comments
Nov 6, 2026
Merged

cdgriffith merged 1 commit into
cdgriffith:developfrom
HocVoNgThai:fix/boxlist-comments

Conversation

@HocVoNgThai

Copy link
Copy Markdown

Deleting a BoxList item through a dotted index bypasses comment reindexing, so surviving YAML items inherit the wrong comments. Sorting a list with comments also evaluates the key function twice, which can break stateful keys and misplace comments for false-valued callable keys.

For example, deleting values["[0]"] from:

- first  # first comment
- second  # second comment

currently writes - second # first comment. With this fix, it writes - second # second comment.

Route dotted deletion through the normal deletion path and reuse the computed sort order, evaluating each key once. Add regressions for dotted deletion and single evaluation of sort keys.

@cdgriffith
cdgriffith merged commit f142725 into cdgriffith:develop Nov 6, 2026
@cdgriffith cdgriffith mentioned this pull request Nov 6, 2026
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.

2 participants