Repository navigation
feat: larger verification report pies - #979
Merged
Merged
Conversation
Split each report pie title into two lines and crop the now blank left 13% of the needpie image, so the charts grow by 15% while a row keeps three pies.
antonkri
requested review from
AlexanderLanin,
MaximilianSoerenPollak,
a-zw,
dcalavrezo-qorix and
nradakovic
as code owners
October 16, 2026 09:33
Contributor
|
Documentation preview for this pull request is available at: |
Sphinx-Needs draws every needpie at 8x4 inches with the legend beside it, so the circle covers only ~35% of the image width. Re-lay out only the pies written by safety_pie_row (recognised by their two-line title) as a 5x6 inch portrait chart with the legend underneath and without the duplicate slice labels. The circle now fills ~80% of its column. The CSS crop of the previous commit is dropped; other needpie charts stay untouched.
Shrink the report pie circle from ~80% to ~60% of its column and set the percentages and counts inside the slices to 17pt bold, the legend to 12pt and the title to 13pt, so the numbers read well three charts per row.
reference_integration patches matplotlib's Axes.legend to a no-op, so report pies arrive without a legend and were left with 8pt numbers. Recognise the slice values by their Sphinx-Needs format and enlarge them regardless; slice labels stay visible when there is no legend to repeat them.
Both verification reports explain the slice colours once at the top of the page, so the per-chart legend and the slice labels only cost space. Report pies now show the two-line title and the enlarged slice numbers in a 5x4 inch figure, also where a project patches Axes.legend away.
There was a problem hiding this comment.
🟡 Changes recommended
Removing category labels makes chart interpretation depend solely on colour, introducing an accessibility regression.
1 open finding
What changed in this PR
Enlarges verification-report pie charts while targeting the layout changes to report-specific titles.
Changes:
- Adds two-line titles and compact charts with larger slice numbers.
- Removes chart legends and slice labels; adjusts empty placeholders.
- Adds tests for report-chart detection and layout behavior.
| File | Description |
|---|---|
| src/needs_templates/platform_verification_report.need | Changes placeholder aspect ratio to 4:3. |
| src/needs_templates/module_verification_report.need | Changes placeholder aspect ratio to 4:3. |
| src/extensions/score_sphinx_needs_templates/tests/test_needs_templates.py | Tests titles, layout, and unrelated-chart preservation. |
| src/extensions/score_sphinx_needs_templates/__init__.py | Generates multiline titles and applies report-specific chart layouts. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+508
to
+509
| else: | ||
| text.set_visible(False) |
Replace the global patch of needpie's save_matplotlib_figure, which picked the report pies by their title, with an explicit directive used only by safety_pie_row. It counts one Sphinx-Needs filter per content line like needpie and draws the compact report chart itself; every other needpie stays untouched.
A safety class without any Need rendered three full-height dashed placeholders. It now gets a single one-line bar under its heading, so empty rows take little space.
Slices between 2% and 5% now carry their percentage and count at half the font size; only slices below 2% stay unnumbered.
Resolve the conflict with #949 in _SafetyPieRow: the module report keeps counting through the score_metrics filter functions, now via score-report-pie, which gains :filter-func: support with needpie's calling convention. The needpie-only :legend: option is dropped.
nradakovic
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📌 Description
The pie charts in the module and platform verification reports render very small, especially three per row on high-resolution screens. Sphinx-Needs draws every
needpieat a fixedfigsize=(8, 4)with the legend to the right, so the circle covers only ~35% of the image width; the rest is blank space that looks like a gap between the charts.This PR draws the report pies with a dedicated
score-report-piedirective, so the circle fills ~60% of its column (about 1.7x larger) and the slice numbers become much larger while a row keeps three pies:_SafetyPieRowwrites.. score-report-pie::instead of.. needpie::, with a two-line chart title (<component/feature> <subject>/<chart> (<safety class>)).score-report-pie(new modulescore_sphinx_needs_templates/report_pie.py) counts its slices exactly likeneedpie: one Sphinx-Needs filter per content line (evaluated withfilter_needs_parts) or a:filter-func:called with needpie's convention (used by the module report for thescore_metricsfilter functions from Feat/centralize verification metrics #949), atdoctree-resolved, after Sphinx-Needs has resolved all Needs. It then draws a 5x4 inch chart with the title and the slice numbers only: no legend and no slice labels, because both reports explain the slice colours once at the top of the page ("Legend — status values and chart colours"). Percentages and counts are 14pt bold, the title 13pt. The matplotlib settings are pinned while drawing and saving, so global styles (e.g.savefig.bbox = tightfromscore_sphinx_bundle, or reference_integration patchingAxes.legendaway) do not change the result. The image alt text lists every slice with its count. Slices between 2% and 5% carry their number at half size (7pt); only slices below 2% stay unnumbered.needpieitself is not touched. Every otherneedpieand allneedbarcharts keep Sphinx-Needs' own layout. There is no global patch and no detection by title (this addresses why the earlier global legend patch was reverted in feat: split module report pies into ASIL and QM #946).img.score-report-pie.Preview: eclipse-score/reference_integration#396
🚨 Impact Analysis
✅ Checklist