# Features — bi_tool_frontend_phase6

Evidence date: 2026-10-19. Revision: `phase_6` `82d7ef04` (2026-08-21, "Domestic reports and Firefox bugfixes").

No feature catalogue existed under `silicon_ark/bi_tool_frontend_phase6/`. The source `CHANGELOG.md` `[Unreleased]` section lists behaviour that is already in this revision. It is treated as a change log, not as a list of unbuilt work.

Planned features with a future phase name: **none found** in the branch.

## Current features (`phase_6`)

| Feature | What it does | Evidence | Status |
|---|---|---|---|
| Home | Banner, vision copy, cards for the areas the user may open | `src/pages/Home.js` | Implemented |
| Responsive navbar | Home, Exports, Grape Production, Vineyard Status. Domestic Sales only when logged in. Hamburger below the `lg` breakpoint. Menu closes on route change | `src/components/Navbar.js`, `NavMenu.css` | Implemented |
| Login modal | Email, password, reCAPTCHA, then disclaimer | `src/components/forms/LoginForm.jsx` | Implemented |
| Session restore | `sawisAuth` cookie, `localStorage` backup, legacy cookie parse | `src/store/authStore.js` | Implemented |
| Logout wipe | Cookies, `localStorage`, `sessionStorage` | `clearClientSession` | Implemented |
| Contact | `mailto:bi@sawis.co.za` | `Navbar.js` | Implemented |
| Terms of use | Footer disclaimer modal | `src/components/Layout.js` | Implemented |
| Export overview | Charts for product type, time, cultivar, top 25, year comparison, litres, exports | `filterStore.js` chart URLs, `src/components/tabs/Overview` | Implemented |
| Export volume / value tables | Five table endpoints; `/auth` prefix when logged in | `filterStore.js` | Implemented |
| Logged-out value prompt | Extra Value tab only when `user` is null | `Reports.js` | Implemented |
| Price range tables | Create and store filter history. UI copy caps at five | `priceRangeStore.js`, `PricesRanges.jsx` | Implemented |
| Generated RSA export report | Authenticated report plus country groups, Excel path via pivot components | `GeneratedReportPivotTable.jsx` | Implemented |
| Grape production pivots | Report list, filters, POST generate | `GrapeProduction.js`, `GenericPivotTable.jsx` | Implemented |
| Vineyard status pivots | Report list, filters, GET generate | `VineyardStatus.js`, `GenericPivotTable.jsx` | Implemented |
| Domestic sales entry | Login wall, default child route `reports` | `AppRoutes.js`, `DomesticRoutes.jsx` | Implemented |
| Domestic report card | In-card filters, `getDomesticReportFilters` / `getDomesticReport`. No Generate/Clear toolbar (Apply refreshes) | `DomesticReportsPage.jsx`, changelog | Implemented |
| Capture tab | Shown only when the user can capture | `DomesticSalesTabs.jsx` | Implemented |
| SAWIS 7 capture shell | Producer code, period, territory, status pill, coloured left border | `ProducerCapturePanel.jsx`, `DomesticShared.jsx` | Implemented |
| Wine-type strip | Headings from `cultivars_by_heading`. Fortified and wine-component headings are lumps | `domesticCaptureModel.js` | Implemented |
| Step 1 volumes | One accordion per package type. Litres ≥ 0, two decimals on blur | changelog, panel handlers | Implemented |
| Saved totals v2 | PUT hierarchy `wine_classes`, `wine_class_totals`, `grand_total` | `volumesToSavedTotalsPayload` | Implemented |
| Lump back-row sync | Synthetic TH/HOUGRO and a matching TOTAAL so reconciliation is not 300 vs 0 | `syncLumpBackData` | Implemented |
| Step 2 cultivar grid | Row create, update, delete | `domesticCapture.js` | Implemented |
| Save draft | Always attempts PUT when the API will take it. Warnings are advisory | `handleSaveDraft` | Implemented |
| Local capture draft | Debounced `localStorage` per email and submission id | `captureDraftStorage.js` | Implemented |
| Submit for verification | Reconciliation GET then POST submit, no status PUT | `submitSubmission` | Implemented |
| Past submissions | Period, status, producer code, territory, actions. View opens a locked-context modal | changelog, panel | Implemented |
| Help / contact super user | GET and POST `/auth/domestic/help` | `domesticLookups.js` | Implemented. 404 uses a fixture |
| Onboarding banner | Once per browser via `localStorage` | `OnboardingHelpBanner.jsx` | Implemented |
| Admin tools | Mapper history, upload wizard, process actions, four lookup tables | `AdminToolsPage.jsx`, `MapperLookups.jsx` | Implemented |
| Producer list verify / sync | Admin endpoints; panel text limits this to roles 2 and 4 | `domesticCapture.js`, `ProducerListSyncPanel.jsx` | Implemented |
| User management | List, assignment, promote to role 3, demote to role 0 | `UsersListPage.jsx` | Implemented |
| SAWIS 7 submission queue | Filterable list, review, approve, unlock, cancel, reopen | `SubmissionsListPage.jsx`, `SubmissionReviewPage.jsx` | Implemented |
| Plain-language errors | Shared strings, no internal rule codes in fallbacks | `src/utils/userFacingMessages.js` | Implemented |
| Lazy routes | Domestic area and admin pages are `React.lazy` | `AppRoutes.js`, `Admin.js`, `DomesticRoutes.jsx` | Implemented |
| Google Analytics | GA4 initialised after 3 seconds | `src/index.js` | Implemented |
| npm audit overrides | webpack, webpack-dev-server, postcss, svgo, xlsx pin, serialize-javascript patch for Node 18 | `package.json`, `patches/` | Implemented. Remaining router RSC advisory is documented as not applicable |
| Playwright config | Browsers and mobile projects, base URL port 44487 | `playwright.config.js` | Config present. `testDir` is `./tests`, and that directory is **absent** on `phase_6` |
| TestSprite assets | Phase 6 plan under `testsprite_tests/` | README | Present as files. Execution result is **Unknown** |
| CRA unit test script | `npm test` → `react-scripts test` | `package.json`, `src/App.test.js` | Script exists. This onboarding did not run it |

## Completed relative to earlier phases (still in the tree)

These are older surfaces that Phase 6 did not remove.

| Feature | Evidence | Status |
|---|---|---|
| Export BI (overview, tables, price range, generated report) | `src/pages/Reports.js` | Still routed |
| Mapper import prepper and lookups | `AdminToolsPage.jsx` | Still routed for roles that may open Tools |
| ASP.NET weather proxy | `setupProxy.js` `/weatherforecast` | Proxy only. No route uses it |

`DEVELOPER_DOCUMENTATION.md` "Key Features" lists exports, grape, vineyard, dashboards, auth, filtering, and Excel. It does not list Domestic Sales or SAWIS 7. That file is behind `phase_6`.

## In development

**Unknown / Requires Confirmation.** `phase_6` is a long-lived branch (remote also has `phase6_pr`, `qa`, `master`). The changelog heading is Unreleased. Nothing in the branch marks a feature as half-built with a TODO that defines the unfinished product. Client comments still call `GET auth/domestic/me` a backend gap, and lookup/help 404s substitute fixtures. Those are compatibility paths, not a named in-progress feature.

## Recently changed (July–August 2026, from `git log` and `CHANGELOG.md`)

- Phase 6.1 linking and 6.2 capture (`a6c2b8b`, 2026-07-14).
- Auth guards so Domestic Sales and Admin cannot be opened anonymously (`6f99a72`).
- Capture local draft, advisory-only draft save, plain-language messages (`b6e8451`).
- Wine-type totals strip and lump TOTAAL sync (changelog; code in `domesticCaptureModel.js`).
- Firefox: month input is a dropdown; submissions table no longer crushes columns (`82d7ef04` subject "Domestic reports and Firefox bugfixes").
- Domestic report filters moved into the card; Generate Report and Clear hidden on that card.
- Session no longer cleared on 403 or on export 404s.
- Admin: DAFF tools-only, Super User submissions landing, cancel and reopen.
- Dependency overrides after npm audit (2026-03-05, 2026-05, 2026-08-05 entries).

## Deprecated or removed

| Item | Evidence | Status |
|---|---|---|
| Legacy auth cookie shape `jwtToken:::…` | Still parsed, then rewritten as `sawisAuth` | Compatibility, not the writer |
| `POST` bulk replace of back-page data | Comment in `domesticCapture.js`: back page is row CRUD, not bulk PUT | Old contract not called |
| Legacy `/contact-super-user` | Comment: gone; help POST replaced it | Not called |
| Service worker | `serviceWorkerRegistration.unregister()` | Not registered |
| `oidc-client` | Named in developer docs, absent from `package.json` | Documentation only |
| Status name New | UI displays Open for `new`, `draft`, and empty | `displaySubmissionStatus` |

## Not features

- `env/` and `.env.development.local` are local configuration. Contents of the `.local` file were not copied.
- `audit-current.json` and `audit-raw.json` are audit artefacts, not product behaviour.
- `src/data/domestic/*` fixtures are fallbacks when an endpoint 404s without a message.
