Add the Profit pulse home widget #82
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/widget-profit-pulse"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a plain new home widget, Profit pulse (id profitpulse), registered in the core widget catalog beside the other core widgets. It shows the Profit Analysis headline for the last 30 days (the Profit page default span), all characters, read from the stored tables the worker folds: profit_daily for gross in and kept profit, trade_item_window for the top item, trade_item_daily for the waterfall cost rows. Nothing is recomputed at render and there are no outbound calls.
How much shows follows the size stored for the widget, the same size value every widget reads: the smallest sizes show the two headline figures only, the default 2x2 adds the top item for the period, and larger sizes add the waterfall inline, drawn by the Profit page own chart builder (buildWaterfall) from the same span totals. Waterfall labels position with the page pf-x/pf-y percent classes, scoped to this widget in style.css because market.css is not loaded on the home page and the site CSP (style-src self) blocks inline style positioning.
Nothing else changes: no edits to the size system, the picker, layout storage or endpoints, the expander machinery, or any existing widget. One existing test pin updated: the module catalog order string gains profitpulse after pulse.
Tests, run as pgtester against embedded Postgres: the new TestProfitPulseWidgetSizes and TestProfitPulseWidgetEmpty (seeded ledger figures at 1x1, default and 3x3, unattributed income excluded, empty state), plus the existing home suites (overview, layout round trips, customize surface, grid sizes, size defaults, catalog pins, briefing, orders widget) 35 passed, 0 failed; the profit, demo and ledger suites 22 passed, 0 failed. gofmt clean, go build ./... and go vet pass.
Rig screenshots (demo seed, Juno Park account) at the three sizes are saved under ~/workspace/profitpulse-renders/.