Allow selecting which report sections to keep on export#1922
Conversation
Add a Section.include_in_export flag and route to_notebook/to_html through _export_views/_export_view so a report can be exported with a subset of its sections. Defaults keep every section included, so existing exports are unchanged.
Render each report accordion card header as a checkbox bound to the section include_in_export flag next to its title, so users can pick which sections to keep before exporting. The checkbox appears once the report has outputs and leaves the rendered report unchanged.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1922 +/- ##
==========================================
+ Coverage 71.22% 71.39% +0.17%
==========================================
Files 198 198
Lines 34163 34403 +240
==========================================
+ Hits 24332 24562 +230
- Misses 9831 9841 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Apply the HoloViz cleanup review: replace the list-building loop in Report._export_views with a comprehension. No behavior change.
|
Thanks! A few thoughts:
|
|
Thanks for the review Andrew,
|
| @property | ||
| def _export_views(self): | ||
| """ | ||
| The flat list of views to include when exporting. Overridden by | ||
| subclasses that support selecting which parts to export. | ||
| """ | ||
| return self.views | ||
|
|
||
| def _export_view(self): | ||
| """ | ||
| The renderable view to save when exporting to HTML. Overridden by | ||
| subclasses that support selecting which parts to export. | ||
| """ | ||
| return self._view | ||
|
|
There was a problem hiding this comment.
Are these necessary? Seems like unnecessary wrappers?
|
Yes, using the JSON editor, we can remove the nodes. While making the video, I also considered this, and for the ease of the UI/UX, we should have checkboxes imo. |
Only Report is ever exported, so the base TaskGroup _export_views / _export_view wrappers (which just returned self.views / self._view) were dead code. Drop them and move to_notebook / to_html onto Report next to its _export_views / _export_view overrides.
Nested sections rendered without a checkbox because only the report drew section headers, and the export read each top level section's aggregated views, so a nested section's selection was ignored. Render a heading and checkbox for nested sections, and walk the tasks when collecting the views so a discarded section is left out of the notebook and the HTML at any depth.
Selection only reached whole sections, so two charts made in one session could not be kept or dropped separately. Move include_in_export onto Task and give every task its own checkbox, and walk the tasks when collecting the views so discarding one chart leaves the rest of its section intact. The report explains the checkboxes at the top rather than on a per-checkbox info icon.
|
@ahuang11, you can review it.. |



Adds a checkbox to each report section card so users can pick which sections to keep, and the Notebook/HTML export includes only the checked ones. Default keeps every section, so existing exports are unchanged, and selection affects the export only, not the live report. Closes #1911.
Untitled.-.09.July.2026.at.15.36.06.1.mp4