feat(reports): leftover-map singular values on grouping comparison graphic (v2.78.0) - #861
Conversation
…aphic (v2.78.0) Caption persisted leftover-map singular values σ_k on the grouping comparison leftover-map graphic from already-named leftover-map axes (ADR 0321). Share and singular value omit independently. Rank-0 unused axes still name σ 0.00. Do not invent σ from leftover-map axis share. Synthetic fixtures only.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Stacked on #860 @ |
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR_SHARE, { | ||
| axis: axisIndex, | ||
| value: singular, | ||
| share: percent, | ||
| }); |
There was a problem hiding this comment.
🟡 Second-axis singular value is clipped
When axis 2 has a singular value, leftoverMapPlotAxisText expands its fixed-position label beyond the 480-pixel SVG. The value is visibly clipped.
Prompt for agents
The comparison variant now renders a substantially longer axis label, but axis 2 remains positioned at layout.originX + 8 with the default start anchor in frontend/src/components/LeftoverMapPlot.tsx. In the fixed 480px SVG, the English singular-value label already extends beyond the right boundary; translations can be longer. Adjust the axis-label rendering so the full singular value and optional share remain visible for both axes and all supported locales. Consider separate visible SVG text and accessible naming, wrapping, repositioning, or a compact visual format, while preserving the ADR 0321 accessible-name contract and the independent omission behavior.
Was this helpful? React with 👍 or 👎 to provide feedback.
| export function leftoverSingularForAxis( | ||
| axes: ReadonlyArray<LeftoverMapPlotAxisSingular> | null | undefined, | ||
| axisIndex: number, | ||
| ): number | null { | ||
| const axis = axes?.find((candidate) => candidate.axis_index === axisIndex); | ||
| if ( | ||
| axis == null || | ||
| axis.leftover_singular_value == null || | ||
| !Number.isFinite(axis.leftover_singular_value) || | ||
| axis.leftover_singular_value < 0 | ||
| ) { | ||
| return null; | ||
| } | ||
| return axis.leftover_singular_value; |
| if (variant === "comparison") { | ||
| if (percent === null) { | ||
| const singular = formatLeftoverMapPlotAxisSingular( | ||
| leftoverSingularForAxis(leftoverMapAxes, axisIndex), | ||
| ); | ||
| if (singular === null && percent === null) { | ||
| return t(axisIndex === 1 ? LEFTOVER_MAP_COMPARE_PLOT_AXIS_1 : LEFTOVER_MAP_COMPARE_PLOT_AXIS_2); | ||
| } | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SHARE, { axis: axisIndex, share: percent }); | ||
| if (singular === null) { | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SHARE, { axis: axisIndex, share: percent }); | ||
| } | ||
| if (percent === null) { | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR, { axis: axisIndex, value: singular }); | ||
| } | ||
| return tf(LEFTOVER_MAP_COMPARE_PLOT_AXIS_SINGULAR_SHARE, { | ||
| axis: axisIndex, | ||
| value: singular, | ||
| share: percent, | ||
| }); | ||
| } | ||
| if (percent === null) { | ||
| return t(axisIndex === 1 ? "leftover-map axis 1" : "leftover-map axis 2"); |
There was a problem hiding this comment.
📝 Info: Report labels remain isolated
The singular-value branch runs only for comparison graphics. Report graphics retain their existing share-only labels.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Scheduled review-feedback autofix for this PR head.
|
Adopt exact reconstructed #860 as the current tree while preserving historical #861 as first parent. Retain the v2.78 singular-value product delta as executable RED: comparison axes must name persisted finite non-negative σ values with distinct comparison copy, preserve σ=0, omit invalid σ independently of share, and never infer σ from axis share. Exact #860 is the second parent. No force update or destructive rebase.
Adopt exact reconstructed #861 as the current tree while preserving historical #862 as first parent. Retain the v2.79 report-axis singular-value delta as executable RED: report badges must expose persisted finite non-negative σ independently of axis share, preserve σ=0, and never borrow comparison-graphic copy or infer σ from share. Exact #861 is the second parent. No force update or destructive rebase.
Current exact authority
a5970cda7a209439c23771d07a63c881f8f11c7d1065081a5d5cb3d617f77cae422a7d9af24cee72Proposedtests/test_grouping_comparison_graphic_singular_contract.py; ordinary non-force convergence onlyInvariant
Comparison axes read persisted
leftover_singular_valueindependently of axis share, preserve finiteσ=0, and omit missing/non-finite/negative σ. Singular-only, share-only, combined, and empty states remain distinct; no value is inferred or clamped from the other.#859 remains executable RED on stale comparison-component distance assertions, so no ancestor validation receipt transfers. Keep Draft until inherited/local REDs are causally GREEN plus fresh repository/security/browser/a11y/performance evidence and independent approval.