Skip to content

feat(ui): Visualize Demand Planner page + interactive Forecast/Backtest pages (PRP-22)#196

Merged
w7-mgfcode merged 7 commits into
devfrom
feat/ui-visualize-demand-planner
May 18, 2026
Merged

feat(ui): Visualize Demand Planner page + interactive Forecast/Backtest pages (PRP-22)#196
w7-mgfcode merged 7 commits into
devfrom
feat/ui-visualize-demand-planner

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

Implements PRP-22 (PRPs/PRP-22-visualize-demand-planner.md). Closes #195.

Turns the Visualize menu from two read-only job viewers into a business-facing demand surface — the successor to PRP-20/PRP-21 (Explorer interactivity).

What changed

Backend (additive — no migration, no new slice, no app/main.py change)

  • GET /analytics/inventory-status — latest inventory_snapshot_daily row per (store, product) grain via Postgres DISTINCT ON; optional store_id/product_id filters; 200 + empty list on an empty table. New InventoryStatusItem/InventoryStatusResponse schemas + compute_inventory_status service method.

Frontend

  • New page Visualize → Demand Planner (/visualize/demand) — every completed predict job rolled into a multi-SKU table (tomorrow / next-week / next-month demand + inventory requirement), a 7/14/30-day lead-time selector, client-side sort, CSV export, and a single-SKU drill-in (demand curve + reorder breakdown + cross-links).
  • TimeSeriesChart gains an opt-in prediction-interval band (LineChartComposedChart, backward-compatible — new props default off).
  • Forecast / Backtest pages made interactive: in-page job submission, interval-band toggle (forecast), CSV export, run/job cross-links.
  • New pure module demand-utils.ts (rollups + inventory math) with full vitest coverage; new useInventoryStatus hook; 3 new TS types.

Validation

  • ruff / ruff format / mypy --strict / pyright --strict — clean
  • pytest -m "not integration" — 1105 passed; analytics integration tests — 9 passed
  • pnpm tsc --noEmit / pnpm lint / pnpm test --run — clean (44 tests)
  • Dogfooded in a real browser (headless Chromium): Demand Planner table + lead-time recompute + drill-in, in-page forecast run, both upgraded pages — 21/22 checks, 0 console errors. Screenshots captured.

Note: dogfooding caught a real bug — /dimensions/{stores,products} cap page_size at 100, but the PRP blueprint specified 500/200; fixed to 100 before commit.

🤖 Generated with Claude Code

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @w7-mgfcode, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 877ed293-e466-41f8-bf7d-fce61ad580a8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ui-visualize-demand-planner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@w7-mgfcode w7-mgfcode merged commit 4d7592f into dev May 18, 2026
8 checks passed
@w7-mgfcode w7-mgfcode deleted the feat/ui-visualize-demand-planner branch May 20, 2026 03:26
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.

1 participant