fix(chartgen): grow the canvas for a caption a few lines over budget - #176
Merged
Conversation
Six backends' worth of qualifiers is a real document, not a pathology: the six-backend results document's ordering chart carried 23 caption lines against the base canvas's budget of 21 and was refused, so the SQS results could not be published. #164 and #165 bought lines back by grouping and trimming notes; the next backend or deviation spends them again. Let the frame read the canvas height from the drawing area instead of the constant, and when the caption overruns the base height by at most MAX_CAPTION_GROWTH_LINES (8), have the renderer render again on a canvas grown by exactly the missing lines. The plot body keeps MIN_PLOT_PX, every committed chart still renders at the base height byte-for-byte, and a runaway caption is still refused with the budget it went over. The six-backend document renders every family; only the parallel-vs-sequenced 64 KiB pair grows, by two lines to 672 px.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Sep 8, 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.
Summary
The six-backend results document (in-process, Kafka, NATS, RabbitMQ, Redis, SQS) does not render: the parallel-vs-sequenced family's caption carries 23 lines against the base canvas's budget of 21, and chartgen refuses the chart. #164 and #165 bought caption lines back by grouping and trimming notes; a sixth backend and its deviation notes spend them again, and the next one would too.
Change
framereads the canvas height from the drawing area instead of theHEIGHTconstant.MAX_CAPTION_GROWTH_LINES(8),framereturnsChartError::CaptionOverflow { extra_lines }andrender_validatedrenders again on a canvas grown by exactly those lines. The variant never reaches callers of the public entry points.MIN_PLOT_PX. A runaway caption is still refused with the chart's name and the budget it went over, as before.Effect on the published charts
Every committed chart still renders at the base height byte-for-byte (the byte-compare test passes unchanged). Rendering the six-backend document, all 22 charts succeed and only
parallel-vs-sequenced-64kiband its dark variant grow, by two lines to 672 px.Tests
a_caption_a_few_lines_over_budget_grows_the_canvas_instead_of_refusing: a document a few caption lines over budget renders, the SVG root is taller thanHEIGHT, every text baseline sits inside the grown canvas, and the plot body spans at least its minimum. Failed first with the "leaves no room" refusal. The existing pathological-caption test still asserts the refusal for a 44-line caption; 127 chartgen tests pass.cargo fmt -- --checkand both clippy gates pass.Unblocks #175 (the SQS results), which stays a draft until this merges and its charts are regenerated.