docs(plan3): correct phantom App.jsx route-bug (Windows grep artifact); routes verified correct

This commit is contained in:
Satyam Rastogi
2026-05-29 16:22:58 +05:30
parent e28d9c0266
commit 33b99c57d9
2 changed files with 8 additions and 13 deletions
+1 -1
View File
@@ -503,7 +503,7 @@ Each plan = one phase, produces working/verifiable software on its own, and is e
### Plan 3 — Kanban/pipeline depth + analytics
- **What:** realistic pre-sale lead details (customers, $ values, notes, real dates — kill the sequential fake phones); the **10 concrete demo-case scenarios** (Appendix B) authored as coherent threads; a working pipeline $ total + conversion funnel; storm attribution on leads; and `src/data/selectors.js` deriving dashboard analytics (pipeline value/funnel/win-rate, revenue/gross/net profit, commission by rep, subcontractor performance, storm attribution) wired into the owner/admin dashboards.
- **Why:** the pipeline must read like a busy real company (investor breadth) and let a salesperson demo any scenario (sales depth); computed selectors guarantee dashboards never contradict the records a prospect drills into.
- **How:** data-authoring subagent tasks on `mockStore.jsx` (sequential) for lead/scenario data; then a **new `selectors.js`** (its own file → parallelizable) of pure functions over the store arrays; then wire dashboards (`OwnerSnapshot`, admin dashboard) to the selectors (per-dashboard files → parallel). Also repairs a pre-existing `App.jsx` bug — the lead-detail routes are written with backslashes/missing slash (`path="\owner\leads:leadId"`, lines ~129/211/341) so React Router never matches them and pre-sale leads 404; Plan 3 fixes these to `/…/leads/:leadId` since clickable pre-sale leads are exactly what this plan's pipeline depth needs. Verify: a reviewer confirms each dashboard KPI equals the sum of the underlying records; pipeline total equals Σ lead values; clicking a pre-sale lead opens its page. **Scope boundary:** inspection/estimate-version/on-hold *mechanics* in scenarios #2/#5/#10 are Phase 4 — Plan 3 authors only their present-tense data.
- **How:** data-authoring subagent tasks on `mockStore.jsx` (sequential) for lead/scenario data; then a **new `selectors.js`** (its own file → parallelizable) of pure functions over the store arrays; then wire dashboards (`OwnerSnapshot`, admin dashboard) to the selectors (per-dashboard files → parallel). Verify: a reviewer confirms each dashboard KPI equals the sum of the underlying records; pipeline total equals Σ lead values; clicking a pre-sale lead opens its page. (Note: an earlier-suspected `App.jsx` backslash-route bug turned out to be a Windows grep display artifact — the committed routes are already correct `/…/leads/:leadId`; no fix needed.) **Scope boundary:** inspection/estimate-version/on-hold *mechanics* in scenarios #2/#5/#10 are Phase 4 — Plan 3 authors only their present-tense data.
- **Plan file:** `docs/superpowers/plans/2026-05-29-plan3-pipeline-depth-analytics.md`.
### Plan 4 — Project lifecycle + inspections + estimates
@@ -20,7 +20,7 @@
- **`OwnerSnapshot.jsx`** already reduces over `projects` for `totalBudget`/`totalSpent`/`avgHealth`/status counts, but computes **no** pipeline value, funnel, win-rate, revenue/profit, commission-by-rep, sub performance, or storm attribution; it reads `owner.portfolioSize`/`owner.riskScore` as static fields. It does **not** look at `kanbanLeads`.
- **`Dashboard.jsx`** (admin/field) and **`LeaderboardPage.jsx`** exist; no shared analytics module.
- **`src/data/selectors.js` does not exist.**
- **`App.jsx` route bug:** the pre-sale lead-detail routes are written with backslashes and a missing slash — `path="\emp\fa\leads:leadId"` (line ~129), `path="\owner\leads:leadId"` (~211), `path="\admin\leads:leadId"` (~341). React Router never matches these, so clicking a pre-sale lead 404s. Correct form: `/emp/fa/leads/:leadId`, `/owner/leads/:leadId`, `/admin/leads/:leadId`.
- **`App.jsx` lead routes — verified correct (no fix needed).** An earlier review flagged these as backslash paths (`path="\owner\leads:leadId"`), but that was a **Windows grep/terminal display artifact**; the committed file already has correct forward-slash routes (`/emp/fa/leads/:leadId`, `/owner/leads/:leadId`, `/admin/leads/:leadId`), confirmed in both the working tree and HEAD. T4 below is therefore a no-op verification, not a code change.
## Scope boundary with Phase 4 (read before authoring)
@@ -35,7 +35,7 @@ Appendix B's table is **illustrative**. Some scenario beats require models that
| T1 Pre-sale lead realism | `src/data/mockStore.jsx` | A (sequential) |
| T2 Scenario curation + lost lead | `src/data/mockStore.jsx` | A (sequential, after T1) |
| T3 `selectors.js` (new) | `src/data/selectors.js` | B (after A committed) |
| T4 Route-path fix | `src/App.jsx` | B (parallel, independent) |
| T4 Lead-route verify (no-op) | `src/App.jsx` (read-only) | B (parallel, independent) |
| T5 Wire owner dashboard | `src/pages/owner/OwnerSnapshot.jsx` | B (parallel, after T3) |
| T6 Wire admin dashboard | `src/pages/Dashboard.jsx` | B (parallel, after T3) |
| T7 Verify | (read-only) | C |
@@ -188,19 +188,14 @@ export function stormAttribution(kanbanLeads = [], projects = []) {
- [ ] **Step 3 (reconcile against real data):** confirm the module imports cleanly (no syntax error): `npm run build``✓ built` (note: until a dashboard imports it, the bundler tree-shakes it; that's fine — also do `node -e "import('./src/data/selectors.js').then(m=>console.log(Object.keys(m)))"` to prove it loads and exports all 7 names).
- [ ] **Step 4:** commit `git commit -am "feat(analytics): add pure selectors for pipeline, revenue, commission, sub performance, storm"`.
## Task 4: Fix broken pre-sale lead route paths
## Task 4: Verify pre-sale lead routes (no-op)
**Files:** `src/App.jsx` only. **Independent — may run any time in Phase B.**
**Files:** `src/App.jsx` (read-only). **Independent.**
The three pre-sale lead-detail routes use backslashes and a missing slash, so React Router never matches them and clicking a pre-sale lead 404s.
The previously-suspected backslash route bug was a Windows grep display artifact; the routes are already correct. This task just confirms it — **no code change, no commit.**
- [ ] **Step 1:** Replace the three malformed `path` strings:
- `path="\emp\fa\leads:leadId"``path="/emp/fa/leads/:leadId"`
- `path="\owner\leads:leadId"``path="/owner/leads/:leadId"`
- `path="\admin\leads:leadId"``path="/admin/leads/:leadId"`
(Edit only the `path` attribute strings; leave the `<ProtectedRoute>`/element unchanged.)
- [ ] **Step 2 (verify):** `npm run build``✓ built`. `git grep -nE "path=\"\\\\" -- src/App.jsx` → no backslash route paths remain.
- [ ] **Step 3:** commit `git commit -am "fix(routes): repair backslash lead-detail route paths so pre-sale leads open"`.
- [ ] **Step 1 (verify):** `git grep -nE 'path="\\\\' -- src/App.jsx` → no matches. `git grep -nE 'path="[^"]*leads/:leadId"' -- src/App.jsx` → shows `/emp/fa/leads/:leadId`, `/owner/leads/:leadId`, `/admin/leads/:leadId`.
- [ ] **Step 2 (dev-run, folded into T7):** clicking a pre-sale lead opens `LeadProjectPage`.
## Task 5: Wire the owner dashboard to selectors