Skip to content

feat(hooks,attachment): implement propagation of AttachmentParent#163

Merged
TethysSvensson merged 14 commits into
rootcause-rs:mainfrom
mkatychev:feat/attachment-parent-creation
Jul 4, 2026
Merged

feat(hooks,attachment): implement propagation of AttachmentParent#163
TethysSvensson merged 14 commits into
rootcause-rs:mainfrom
mkatychev:feat/attachment-parent-creation

Conversation

@mkatychev

@mkatychev mkatychev commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

This PR adds handling and creation of AttachmentParent so that AttachmentFormatterHook impls can refer to their parent.

Resolves #160

mkatychev and others added 14 commits April 25, 2026 14:34
…t-creation

# Conflicts:
#	src/report_attachment/ref_.rs
Resolves the cargo fmt --check failure introduced when resolving the
merge conflict in 5d9b372: my conflict resolution wrote the use line
in multi-line form, but the import fits on one line so rustfmt wants
it collapsed.
- CHANGELOG: drop stale `display_preformatted`/`debug_preformatted`
  references and tighten the entry (those methods were removed in rootcause-rs#148).
- `ReportAttachmentRef::format_inner_with_parent`: bring docs up to par
  with `format_inner` / `format_inner_unhooked`, including an example.
- `AttachmentParent.attachment_index`: document the pre-sort, pre-filter
  convention that `DefaultReportFormatter` upholds.
- `tests/attachment_parent.rs`: extend coverage to `Appendix` placement.
- Rename the leftover `style1` binding to `style`.
- Split the CHANGELOG entry: the `Option<AttachmentParent<'_>>`
  parameter on `AttachmentFormatterHook::display`/`debug` predates
  this PR. What's new is (a) `DefaultReportFormatter` now actually
  populates it instead of always passing `None`, and (b) the new
  `ReportAttachmentRef::format_inner_with_parent` method. Reflect
  both, with the behavior change under Changed.
- Fix `form` -> `from` in the new example comment.
… wording

Mirror the AttachmentParent cross-link from AttachmentFormatterHook::display's
arg list onto debug's arg list.

Rephrase AttachmentParent::attachment_index docs to call the index 'stable'
and 'independent of' formatter sorting/filtering, making it clearer that
filtered-out attachments do not shift indices.
The branch predated the 0.13.0 release, so merging main placed them in
the already-released 0.13.0 section.
Define the index by what it is (indexing report.attachments() returns
the attachment being formatted) instead of by what it is independent
of, and drop the inline comment that restated the field docs.
@TethysSvensson TethysSvensson enabled auto-merge July 4, 2026 07:30
@TethysSvensson TethysSvensson added this pull request to the merge queue Jul 4, 2026
Merged via the queue into rootcause-rs:main with commit 4b20243 Jul 4, 2026
16 checks passed
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.

AttachmentParent struct never created

2 participants