# Northline Workshops repair — handoff

## Deliverables and local run

- `output/site/index.html` — preserved page content with accessible form feedback.
- `output/site/style.css` — responsive dark-blue/orange layout.
- `output/site/app.js` — corrected calculator, validation and signup request.
- `output/site/server.py` — unchanged supplied server.
- `output/evidence/browser-checks.md` — actual desktop/mobile browser checks.
- `output/evidence/browser-submissions.jsonl` — three fake browser-created signup records, archived outside the runnable site.
- `output/evidence/file-checks.txt` — actual file assertions and test-data cleanup.

Run:

```sh
cd output/site
python3 server.py
```

Open `http://127.0.0.1:8765`. `PORT` can override the port. No dependencies or external resources were added. The server creates `submissions.jsonl` in the site directory on successful signup. These startup/storage contracts come from `inputs/brief.md`, **Workshop site acceptance brief**, and `site/server.py`, **Handler.do_POST / __main__**. Test data has been removed from the runnable site; raw inputs were preserved.

## Fixes and decisions

1. **Save through the supplied endpoint.** Changed `/api/lead` to `/api/leads` and send JSON `name,email,seats`. Success is shown only after a successful response with `ok: true`. Pending state disables the button and guards against simultaneous submissions. Server rejection and connection errors have visible status messages. Original defect: `site/app.js`, **signup submit listener**; contract: `site/server.py`, **Handler.do_POST**.
2. **Validate before sending.** Trim name/email, reject empty or whitespace-only names, use the supplied server's plausible-email pattern, and accept only integer seats 1–8. Invalid entries receive inline/live feedback and focus moves to the first invalid control. Bad seats clear the price instead of showing a misleading amount. Decision: surrounding whitespace in names/emails is normalized before validation/storage. No stricter email policy or capacity-tracking system was invented; the supplied contract is per-signup validation, not aggregate inventory (`inputs/brief.md`, **Workshop site acceptance brief**; `site/server.py`, **Handler.do_POST**).
3. **Correct discount and tax.** Formula is `seats × 240 × (seats >= 3 ? 0.90 : 1) × 1.12`, formatted as CAD with two decimals. Original code multiplied by the discount percentage instead of the remaining-price factor (`site/app.js`, **calculateTotal**). Required examples from `inputs/brief.md`, **Workshop site acceptance brief**, all observed in the browser:

   | Seats | Subtotal | After discount | Tax | Browser total |
   |---:|---:|---:|---:|---:|
   | 1 | 240.00 | 240.00 | 28.80 | CAD 268.80 |
   | 2 | 480.00 | 480.00 | 57.60 | CAD 537.60 |
   | 3 | 720.00 | 648.00 | 77.76 | CAD 725.76 |
   | 8 | 1920.00 | 1728.00 | 207.36 | CAD 1935.36 |

4. **Fit mobile without hiding overflow.** Replaced the fixed-width shell with a fluid, capped shell; made grid columns shrinkable; stacked content below 760 px; retained 18 px body/control text, labels, and at least 48 px control heights. Kept original title and copy, blue `#152a45`, orange `#e78136`, white panels and rounded corners (`site/index.html`, **page content**; `site/style.css`, **body / .shell / .layout / aside / button**). Added visible keyboard focus styling, live statuses, autocomplete and a no-JavaScript notice. JavaScript remains necessary for JSON signup and the live calculator.

## Checks actually performed

- **14 supplied browser-tool calls**, with fresh browser contexts, at **390 px and 1280 px**. All returned no horizontal overflow and no reported browser errors. Details and actions: `evidence/browser-checks.md`, B01–B14.
- All four supplied calculator examples displayed exactly as required.
- Valid mobile (3 seats) and desktop (8 seats) forms displayed the saved confirmation; matching JSONL records were inspected.
- Blank, zero, negative, fractional and 9-seat submissions, whitespace-only name, malformed email and empty name/email all displayed errors. Storage remained at two records across these eight invalid cases.
- Correction from 0 to 1 seat followed by signup/reload left one additional persisted recovery record. Intermediate success text was not captured in that reload case.
- Python assertions verified the server copy is byte-identical, every original nonempty HTML text node remains, and the final three persisted records match the fake test users. Archived these records and removed test-only live storage.

## Limitations and suggested final review

Browser observations were text/control/overflow reports, not screenshots. No separate `python3 server.py` process was launched; browser checks used the tool's trusted original server behavior, and the delivered server was verified identical. No direct invalid-HTTP-payload, forced network/server-error, rapid double-click, keyboard-only or screen-reader tests were performed. Accessibility improvements and failure-state code are present but are not a full accessibility or reliability certification. Other widths, zoom levels and browser engines were not tested. The supplied local server was preserved, not production-hardened.

**Estimated human follow-up: 10–15 minutes (estimate, not measured)** to launch the delivered server, visually inspect both widths, and check keyboard navigation plus a disconnected-server error. No known remaining acceptance failure was observed in the checks performed.
