Repository navigation
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) |
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 re-lays out only the report pies, 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:
_SafetyPieRowemits a two-line chart title (<component/feature> <subject>/<chart> (<safety class>)). A continuation line of the directive argument keeps its newline.score_sphinx_needs_templateswrapssave_matplotlib_figureof theneedpiemodule. Figures whose title ends in one of the report chart lines (Status,Test Coverage,Reference Coverage+ safety class) are re-laid out as a 5x4 inch chart showing only the title and the slice numbers: 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 and wraps at the figure border. This also works where a project patchesAxes.legendaway (reference_integration does). Trade-off: slices below 5% carry no number (Sphinx-Needs hides it to avoid overlaps), and without the legend their count is no longer shown.needpieand allneedbarcharts stay untouched. This addresses why the earlier global legend patch was reverted in feat: split module report pies into ASIL and QM #946.Preview: eclipse-score/reference_integration#396
🚨 Impact Analysis
✅ Checklist