Skip to content

01a042cc - Keep portfolio chart visible when holdings are zero - #951

Merged
TaprootFreak merged 12 commits into
RealUnitCH:stagingfrom
TaprootFreakAI:01a042cc-portfolio-chart-zero
Aug 27, 2026
Merged

01a042cc - Keep portfolio chart visible when holdings are zero#951
TaprootFreak merged 12 commits into
RealUnitCH:stagingfrom
TaprootFreakAI:01a042cc-portfolio-chart-zero

Conversation

@TaprootFreakAI

@TaprootFreakAI TaprootFreakAI commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

EN:
The portfolio development chart disappeared for time windows where every holding is zero.
The cubit now keeps a Y-range from 0 so the line stays drawn, and holds the last value before the window so the stroke spans the selected period.
A dashboard golden records the all-zero MAX view; the customer-report 1W–1J goldens show that full-width zero line on a 0…10 axis.
Unit tests cover an all-zero series, a one-week window of zeros, and carrying a pre-window sample to minX.

DE:
Die Bestandsentwicklung verschwand in Zeitfenstern, in denen jeder Punkt 0 ist.
Der Cubit hält jetzt eine Y-Spanne ab 0, damit die Linie gezeichnet bleibt, und übernimmt den letzten Wert vor dem Fenster, damit der Strich die gewählte Periode ausfüllt.
Ein Dashboard-Golden dokumentiert die Null-MAX-Ansicht; die Kunden-Goldens 1W–1J zeigen diese volle Null-Linie auf einer Achse 0…10.
Unit-Tests decken eine Null-Serie, ein 1W-Null-Fenster und das Nachziehen eines Werts vor minX ab.

Details

When every visible point is 0, average * 0.05 was 0, so minY == maxY == 0 and LineChart drew no curve. The cubit now falls back to a 5.0 currency-unit floor so the chart has a Y-range. Holdings cannot go negative: the bottom line is always clamped to 0 (scale 0…10 for an all-zero series), not centered through negative labels.

A clipped period (1W/1M/3M/1J) previously started the stroke at the first interior sample. If that sample sat months into the window, the line began mid-chart. The last sample before minX is now held at the window edge so the stroke spans the selected period. An empty window (every sample older than the period) stays empty.

dashboard_portfolio_chart_zero.png is the all-zero MAX view. After #953, the mixed-history 1W/1M/3M/1J goldens pin the full-width zero line on the 0-axis.

@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 14:27
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 14:51
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 15:00
@TaprootFreakAI

Copy link
Copy Markdown
Collaborator Author

EN:
Ready after 2 review passes.
The portfolio chart stays visible when every holding in the selected window is zero.

DE:
Bereit nach 2 Review-Durchläufen.
Die Bestandskurve bleibt sichtbar, wenn im gewählten Fenster jeder Bestand 0 ist.

Details

Review pass 1 (98eed05): 0 findings on quality and logic. Coverage Floor Gate failed at 99.9% vs a 100% line floor because the old deviation <= 0 collapse path was no longer reached.

Review pass 2 (e1aee89): that dead branch was removed; 0 findings on quality and logic.

Open comments: none (issue comments, reviews, inline comments, and review threads all empty).

Mergeability: mergeable=MERGEABLE at head e1aee89. mergeStateStatus=BLOCKED is the human-approval requirement, not a conflict.

CI at e1aee89: Analyze & Test success, Visual Regression success, Coverage Floor Gate success, BitBox quirks audit success. Maestro handbook flows skipped (opt-in label not set; not a required check).

@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 15:58
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 16:02
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 16:03
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 16:03
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 16:05
@TaprootFreakAI

Copy link
Copy Markdown
Collaborator Author

EN:
The all-zero portfolio chart baseline is now in the PR.

DE:
Die Baseline für den Chart ohne Bestand ist jetzt im PR.

@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 16:32
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 18:50
An all-zero window used to set minY=maxY=0, so fl_chart drew no curve.
Floor the Y-range at 5 currency units and allow a negative minY in that
case so the zero line sits in the chart instead of on the clipped axis.
The 5.0 floor always feeds a positive deviation into the line
calculator, so the old collapse path was dead and left line
coverage at 99.9% against a 100% floor.
The existing portfolio-history snapshot only covers a non-zero curve.
This variant pins the visible Y-range when every holding is zero.
A missing baseline does not write a failures/ diff. Re-render on the
same self-hosted runner and attach the PNGs so they can be committed.
Rendered on the self-hosted visual-regression runner. Reverts the
temporary artifact-upload workflow change used to capture the PNG.
@TaprootFreakAI
TaprootFreakAI force-pushed the 01a042cc-portfolio-chart-zero branch from 0524d83 to 562ff0a Compare August 27, 2026 18:53
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 18:53
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 18:55
Those mixed-history windows used to collapse to an empty plot. After
the cubit floor they render a visible zero line; take the self-hosted
runner captures as the new baselines. MAX was unchanged.
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 18:56
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 19:00
Period windows in the cubit start at local midnight. Fixtures that kept
the current clock time shifted the zero-line by a few pixels between
CI runs, so 1W/1M/3M goldens could not settle.
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 19:00
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 19:02
Rendered on the self-hosted visual-regression runner against the
midnight-aligned customer-report fixtures.
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 19:02
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 19:26
A 1Y view whose next interior sample is months later used to draw a
stub from mid-chart. Carry the last value before minX to the window
edge so the stroke spans the selected period.
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 19:29
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 19:36
Rendered on the self-hosted visual-regression runner after holding
the last pre-window value at minX.
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 19:36
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 20:04
Holdings cannot go negative. The all-zero floor used to center the
range on 0 and label -6…4; clamp the bottom line so the scale is
0…10 and the zero stroke sits on the axis.
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 20:05
@TaprootFreakAI
TaprootFreakAI marked this pull request as draft August 27, 2026 20:07
Rendered on the self-hosted visual-regression runner after clamping
the holdings scale to non-negative values.
@TaprootFreakAI
TaprootFreakAI marked this pull request as ready for review August 27, 2026 20:07
@TaprootFreak
TaprootFreak merged commit 6f75fe5 into RealUnitCH:staging Aug 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants