Add an opt-in detailed text diff

This commit is contained in:
Jan Petykiewicz 2026-11-18 23:20:00 -08:00
commit f3275fc161
2 changed files with 266 additions and 45 deletions

View file

@ -122,6 +122,7 @@ Pheon lists the choices. A valid numeric pair always selects that pair directly.
```sh
pheon diff before.gds after.gds --show-cell RESONATOR --show-layer WG
pheon diff before.gds after.gds --show-cell RESONATOR --details --max-changes 20
pheon diff before.gds after.gds --hierarchy mermaid --depth 4
```
@ -136,6 +137,12 @@ changes hidden by filters or the limit. JSON has no default object limit and rep
omissions from both display filters and any explicit limit in `report_selection`.
See the [JSON reference](diff-reports.md) for the selection counters.
`--details` shows individual object evidence inside modified cells in text
reports. Replacement rows include a nested `-` row for the old object and a
`+` row for the new object, with cell-local coordinates in database units,
retained fields, and properties. Both sides count toward `--max-changes`.
For added and removed cells, the report lists the cell name.
The diff hierarchy shows directly changed cells, affected ancestors, and targets
of modified references. It includes references from both revisions so removed
branches remain visible. Counts represent direct placements, with symbolic

View file

@ -34,7 +34,9 @@ graph and ancestors when a hierarchy is requested.
`TextComparison::between` captures the data needed for text and hierarchy
reports. Both comparison types provide `render_text_with_ascii_hierarchy`
to render a combined report with redundant terminal edges omitted.
to render a combined report with redundant terminal edges omitted. Pass
`TextReportOptions { details: true, ..Default::default() }` to
`render_text_with_options` to show individual object evidence.
Use `RevisionPair::parse(&old_bytes, &new_bytes)` for an unscoped comparison
that can reuse matching cells. Its `compare` and `compare_text` methods return