# Features — bitool_frontend

Evidence date: 2026-10-19. Revision: `master` `937e09cb` (2026-09-22, "Merged in hotfix/random-logouts-cluver (pull request #13)").

No feature catalogue existed under `silicon_ark/bitool_frontend/`. `DEVELOPER_DOCUMENTATION.md` lists features. The table below follows the code on `master`. `CHANGELOG.md` "Unreleased" describes behaviour already in this revision (401-only logout, npm audit cleanup). It is a change log, not a list of unbuilt work.

`origin/qa` at `584d8b7` (2026-10-16) is 148 commits ahead of `master`. Features that exist only there are in the last section.

## Current features (`master`)

| Feature | What it does | Evidence | Status |
|---|---|---|---|
| Home | Banner, three report cards, SAWIS vision, promise, and values | `src/pages/Home.js` | Implemented |
| Navbar | Home, Exports, Grape Production, Vineyard Status. Active route is highlighted. Login or sign-out modal. Contact mailto `bi@sawis.co.za` | `src/components/Navbar.js` | Implemented |
| Session resume | `jwtToken` + `biUser` cookies, plus a legacy `:::` cookie parser | `src/store/authStore.js` | Implemented |
| Sign in | Email, password, reCAPTCHA gate, disclaimer, `POST /loginAuth` with `typeOfLogin` | `src/components/forms/LoginForm.jsx` | Implemented. reCAPTCHA token is not sent |
| Sign out | Confirms, clears cookies and `disclaimerAccepted` | `src/components/forms/LogoutForm.jsx` | Implemented |
| Disclaimer | Login step and footer modal. Same SAWIS wording | `LoginForm.jsx`, `src/components/Layout.js` | Documented in the UI and implemented |
| Export overview | Litre tiles (total, packaged, bulk) and five ECharts | `src/components/tabs/Overview.jsx`, `src/components/Charts/BIChart.jsx` | Implemented |
| Export filters | Producer, year, ending month, 1–12 month period, product type, country, package type, cultivar. Apply commits. Clear resets. Select-all countries applies immediately | `src/components/Sidebar.js`, `src/store/filterStore.js` | Implemented |
| Volume tables | Five pivots. Producer-specific components when the producer selection is non-empty and excludes `Industry` (the first table also requires a signed-in user). Excel download | `src/components/tabs/Tables.jsx`, `src/components/pivotTable/` | Implemented |
| Guest value prompt | Value tab and a banner on volume tables ask the visitor to log in for currencies | `LogoutValue.jsx`, `Tables.jsx` | Implemented |
| Price range | Signed-in only. Up to five tables, saved per email, years from 2014, Excel download | `PricesRanges.jsx`, `src/store/priceRangeStore.js`, `PriceRange.jsx` | Implemented |
| RSA exports report | Signed-in Reports tab. Country or country-group filter, year compare, Excel | `GeneratedReports.jsx`, `GeneratedReportPivotTable.jsx` | Implemented |
| Grape production | Filter sidebar, API report list, pivot per report, sultana toggle, Excel | `src/pages/GrapeProduction.js`, `GenericPivotTable.jsx` | Implemented. Report names come from the API |
| Vineyard status | Same client as grape production, different endpoints | `src/pages/VineyardStatus.js` | Implemented. Report names come from the API |
| Filter fallback | Hard-coded year, region, cultivar, age, and colour lists when the grape or vineyard filter call fails | `src/lib/constants.js` `filtersFallback` | Implemented safety net |
| 401-only logout | Reporting and price-range HTTP 401 clears the session once and alerts. 403 and other failures do not | `src/utils/authSession.js`, `authSession.test.js`, `CHANGELOG.md` | Implemented and documented |
| Request cancellation | Leaving Exports aborts in-flight reporting, filter, and price-range fetches | `Reports.js`, `filterStore.js`, `priceRangeStore.js` | Implemented |
| Excel export | On-screen tables download as `.xlsx` | `src/lib/helpers.js`, table-to-excel call sites | Implemented |
| Analytics | GA4 `G-1RFV9ZJG9K` after 3 seconds | `src/index.js` | Implemented |
| Footer attribution | Department of Agriculture — Wine Online, Silicon Overdrive logo | `Layout.js` | Implemented |
| SonarQube on master | Bitbucket Pipelines runs the Sonar scan pipe | `bitbucket-pipelines.yml` | Implemented as CI config. Scan results were not read |
| Deploy trigger script | PHP file calls Label and BIQA deploy URLs when given a query token | `master_deploy.php` | Implemented. Tokens not repeated here. BI case calls the BIQA host |

## Changed on `master` since the 2025-10-24 snapshot

The onboarding scan recorded tip `c6259e3` (2025-10-24, "Update SidebarFilters.jsx"). Later commits on `master`:

| Commit | Date | Change |
|---|---|---|
| `8df1cad` | 2026-08-25 | Subject: "fixed all issues and errors". Diff was not line-reviewed |
| `29cf45b` | 2026-09-16 | Navigation and non-401 errors no longer clear the session |
| `17d160e` | 2026-09-22 | ECharts bumped to `^6.1.0` and npm audit overrides added |
| `937e09cb` | 2026-09-22 | Merge of pull request #13 |

Sidebar clear on grape and vineyard sets Year to the previous calendar year (`SidebarFilters.jsx`). Commit `c7e010c` (2025-10-23) said "revert to 2024 on clear". The current code uses `getFullYear() - 1`, so a fixed year 2024 is no longer the rule.

## Documented features that are not on `master`

| Claim | Where it is written | What `master` contains |
|---|---|---|
| OpenID Connect via `oidc-client` | `DEVELOPER_DOCUMENTATION.md` | Package is absent. Login is `POST /loginAuth` |
| Playwright specs: homepage, navigation, authentication, reports, grape, vineyard, accessibility, performance | `DEVELOPER_DOCUMENTATION.md` | `playwright.config.js` points at `./tests`. That directory is gitignored and not in the tree. `playwright-test.config.js` is the same shape |
| Authenticated routes and automatic redirects | `DEVELOPER_DOCUMENTATION.md` | Four public routes. Gating is inside Exports tabs |
| Dev server at port 3000 | `DEVELOPER_DOCUMENTATION.md`, CRA section of `README.md` | `.env.development` sets `PORT=44487` |
| Tailwind as the utility CSS in use | `DEVELOPER_DOCUMENTATION.md` | `tailwind.config.js` has `content: []`, so it scans no files. UI styles are Bootstrap and inline styles |
| Service worker / PWA | CRA `README.md` | `serviceWorkerRegistration.unregister()` |
| `sonarqube_scan.bat` | Task-creation file list | File is not in `master` |

## Removed or retired on `master`

| Item | Evidence |
|---|---|
| E2E test tree | Commit `68e2b76` subject "Remove tests and clean up code". `.gitignore` ignores `/tests`, `/temp_test`, `src/setupTests.js`, `src/test-support/`, and `docs/testsprite_run.md` |
| ASP.NET weather page | `src/setupProxy.js` still proxies `/weatherforecast`. No route renders it |

`docs/testsprite_run.md` is tracked (`git ls-files`) and is also named in `.gitignore`, so the ignore rule does not drop the copy already in git. It records a 2026-09-16 note that TestSprite plan generation failed and that `authSession.test.js` passed 5/5. The test file it names is `src/utils/authSession.test.js`.

## On `qa`, not on `master`

Read from `origin/qa` route files and commit subjects. The rest of that tree was not specified here. Full Phase 6 behaviour as of `phase_6` `82d7ef04` is in `silicon_ark/bi_tool_frontend_phase6/`.

| Feature | Evidence on `qa` | Status |
|---|---|---|
| Domestic sales reports `/domestic/reports` | `src/pages/domestic/DomesticRoutes.jsx` | Implemented on `qa` |
| Domestic capture `/domestic/capture` behind `AuthRouteGuard` | same file | Implemented on `qa` |
| Admin `/admin` and `/admin/*` behind `AdminRouteGuard` | `src/AppRoutes.js` on `qa` | Implemented on `qa` |
| Vite instead of Create React App | commit `ff8dd70` "replace CRA with Vite and remove unused Tailwind" | On `qa`. `master` is still `react-scripts` |
| Client-feedback and domestic filter work through pull request #23 | `qa` tip `584d8b7` (2026-10-16) | On `qa` |

`login_encyryption` (`98ca210`, 2026-02-13, "Encrypt login payloads") is not merged to `master`. Its diff was not read.

## Planned

No in-repo roadmap on `master` names a feature that is absent from the code. Future work on other branches is listed above as existing code, not as a plan.
