Skip to content

feat(api)!: drop DocumentPath - #901

Merged
andiwand merged 1 commit into
mainfrom
feat/drop-document-path
Sep 13, 2026
Merged

feat(api)!: drop DocumentPath#901
andiwand merged 1 commit into
mainfrom
feat/drop-document-path

Conversation

@andiwand

@andiwand andiwand commented Sep 13, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

The third of the three public-API changes before the major. Independent of the other two, rebased onto main after #900 merged.

What goes. DocumentPath, Element::document_path() and Element::navigate_path(), the two adapter hooks behind them, and internal/util/document_util, which only walked paths. With them the python class and methods, the Java DocumentPath class with Element.documentPath() and navigatePath(), and their tests.

Why. A path addressed an element by position, and the edit path left it in #873 for the id an element carries, which an insert or a delete does not shift. Nothing public read a path any more but the two binding mirrors. An element is named by Element::identifier() and found by Document::element_by_id(), which is what the edit envelope uses.

The tests. document_test.cpp addressed elements by strings like /child:41/child:0/child:1 and /child:0/cell:A1/child:0, which is what a reader can check against a file. It now walks those with a helper of its own, navigate, plus path_of for the tests that save and reload and so cannot hold an id across the two decodes. The repeated-cell and csv tests that round-tripped a path round-trip the id instead. csv_document.cpp reached TablePosition through the removed header and includes it itself now.

Verified. The full suite passes, 1818 tests. JUnit 62 (one path test gone) and pytest 83 pass, and python exposes neither the class nor the methods. The touched translation units are clean under Homebrew clang -Wall -Wextra -Werror. Nothing in the Objective-C or wasm bindings named a path.

Changelog entry added, marked breaking.

A path addressed an element by position, and the edit path left it for the
id an element carries, which an insert or a delete does not shift. Nothing
public read a path any more but the python and Java mirrors. `DocumentPath`,
`Element::document_path`, `Element::navigate_path`, the adapter hooks behind
them and the utility that walked them are gone; an element is named by
`Element::identifier` and found by `Document::element_by_id`. The tests that
addressed an element by a path string walk one of their own.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137vd79NGaB8nfLsdPoghM4
@andiwand
andiwand merged commit e2a84d2 into main Sep 13, 2026
23 checks passed
@andiwand
andiwand deleted the feat/drop-document-path branch September 13, 2026 18:03
andiwand added a commit that referenced this pull request Sep 13, 2026
`Element.documentPath()` went in #901, and the instrumented suite was the
one caller the removal missed, since it sits outside the binding
directories. It asserts the id round trip instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137vd79NGaB8nfLsdPoghM4
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