Massive AI Overhaul

This commit is contained in:
John OReilly
2026-03-15 18:24:36 -04:00
parent bce93507cb
commit 42b7b06dda
9637 changed files with 403289 additions and 4217 deletions

View File

@@ -0,0 +1,167 @@
# SVS MSP CALC — STAGE 9 SESSION PROMPT
# Next Session
# Generated: 2026-03-15
---
## WHERE WE ARE
**Beta build: COMPLETE.** Sections IIII are production-quality.
**Phases 111 + Stage 8: COMPLETE.** Bug fixes, visual polish, UX hardening, docs/QA, a11y/perf, code quality I & II, test expansion, print enhancements, visual QA, elastic responsive, feature work.
**Stage 8 Feature Fixes: COMPLETE.**
- Fullscreen live quote view: Print button in sidebar header (Reset/Import/Export JSON hidden)
- Toggle switches: distinct off/on colors per theme (`--surface-switch-off`/`--surface-switch-on`)
- Pricing: migrated from CSV to JSON (`package-prices.json`)
- JSON export/import: already captures all form data including quote notes (schema v1.1)
**Tests:** 254/254 passing.
**Sections IVVI:** Intentionally deferred as placeholders — do not activate.
### Completed Stages
- **Stage 1** — Discovery audit (codebase mapping, doc generation)
- **Stage 2** — Beta build (Phases 14: bug fixes, visual polish, UX hardening, docs/QA)
- **Phase 5** — Accessibility/performance audit + Font Awesome icon fix
- **Stage 3 / Phase 6** — Code quality pass I (tokens, CSS dedup, dead code)
- **Stage 4 / Phase 7** — Test expansion (88 → 254 tests)
- **Stage 4 / Phase 8** — Enhanced Print/PDF (rep name, notes, validity date, page breaks, CYA section)
- **Stage 5 / Phase 9** — Visual QA (3 breakpoints × 4 themes) + Retro theme overhaul
- **Stage 6 / Phase 10** — Elastic responsive foundation (5 → 3 breakpoints, fluid clamp() tokens, max-width up to 2400px)
- **Stage 7 / Phase 11** — Feature work: keyboard shortcuts (Ctrl+P/E/R) + 4 new contextual nudges
- **Stage 8 / Phase 12** — Code quality pass II: transition tokens, CSS specificity audit, print CSS hardening
- **Stage 8 Feature Fixes** — Fullscreen print button fix, toggle switch 2-state themed colors, pricing CSV → JSON migration
---
## START EVERY SESSION BY READING
1. `svsmspcalc/docs/CHECKPOINT.md` — current status, all completed work
2. `svsmspcalc/docs/MASTER-SESSION-PROMPT.md` — full architecture, constraints, priorities
3. `svsmspcalc/docs/QUICK-REF.md` — compact file map, DOM IDs, pricing, danger zones
4. This file — session goals and context
---
## PROJECT SNAPSHOT
**App:** SVS MSP CALC — live quote/pricing calculator for SVS Managed Services
**Type:** Static HTML + Vanilla JS + Modular CSS (no frameworks, no build tools, no npm)
**Used by:** SVS sales team, live on screen during prospect calls
### Architecture
```
svsmspcalc/
├── SVS-MSP-Calculator.html # Stable HTML shell (65KB)
├── SVS-MSP-Calculator.js # Orchestration + keyboard shortcuts (375 lines)
├── quote-engine.js # Pure quote math (197 lines)
├── quote-pricing.js # Pricing defaults + JSON override (134 lines)
├── quote-render.js # DOM rendering + nudges (760 lines)
├── quote-persistence.js # localStorage save/restore (237 lines)
├── quote-export.js # Print/PDF + JSON export (320 lines)
├── quote-import.js # JSON quote import (166 lines)
├── theme-manager.js # 4-theme switching (121 lines)
├── mobile-sync.js # Mobile panel sync (275 lines)
├── SVS-MSP-Calculator.css # Manifest (@imports all CSS)
├── SVS-MSP-Calculator-tokens.css # Design tokens + CSS vars (fluid clamp() layout)
├── SVS-MSP-Calculator-base.css # Global chrome
├── SVS-MSP-Calculator-layout.css # Grid, header, main/sidebar
├── SVS-MSP-Calculator-components.css # Section cards, controls, sidebar (67KB)
├── SVS-MSP-Calculator-responsive.css # 3 structural breakpoints (1100/600/780L)
├── SVS-MSP-Calculator-print.css # Print-specific rules
├── SVS-MSP-Calculator-light.css # Light theme overrides
├── SVS-MSP-Calculator-glass.css # Glass theme (glassmorphism)
├── SVS-MSP-Calculator-70retro.css # Retro Cyberpunk theme (paper + hot rose/teal)
├── package-prices-data.js # Pricing data (edit this to change prices — loaded via <script>)
├── package-prices.json # Pricing reference (JSON format, not loaded at runtime)
├── package-prices.csv # Legacy pricing reference (not loaded at runtime)
├── tests/
│ └── test-quote-engine.js # 254 tests (Node.js, zero deps)
└── docs/
├── CHECKPOINT.md # Build status checkpoint
├── MASTER-SESSION-PROMPT.md # Full architecture brief
├── QUICK-REF.md # Compact reference
├── README.md
├── code-verification.md # Known-good baseline
├── phase-roadmap.md # Phase status
├── quote-rules.md # Business logic rules
├── regression-checklist.md # Test procedures
├── STAGE8-SESSION-PROMPT.md # Previous stage
└── STAGE9-SESSION-PROMPT.md # This file
```
### Pricing Configuration
Pricing is loaded from `package-prices-data.js` via `<script>` tag (works on `file://` — no web server needed). The loader also has a `fetch()` fallback for web server environments, then falls back to built-in defaults.
**To update pricing:** Edit `package-prices-data.js` — change the `value` field for any key:
```js
window.SVS_PRICING_DATA = {
"user_packages": {
"RATE_M365": { "value": 130, "description": "..." },
...
},
...
};
```
Categories: `user_packages`, `user_addons`, `endpoints`, `endpoint_addons`, `zero_trust_network`, `voip`, `site_admin`, `contract_discounts`, `tax`, `vs_comparison`.
---
## HARD CONSTRAINTS (NON-NEGOTIABLE)
1. DOM IDs are a contract — renaming breaks mobile sync (100+ pairs)
2. 254 tests must pass: `node svsmspcalc/tests/test-quote-engine.js`
3. localStorage keys unchanged: `svs-msp-quote-v1`, `svs-msp-quote-ref`
4. All 4 themes must work after every change
5. Mobile parity maintained
6. Print/PDF tested after CSS changes
7. No frameworks, no npm — vanilla only
8. Surgical changes only — read before editing
9. Sections IVVI are placeholders — do not activate or build out
---
## STAGE 9 GOALS
_To be determined by the user in the next session._
Potential areas for continued work:
- **Spacing token consolidation** — 150+ magic-number spacings in components.css (deferred from Stage 8)
- **Visual QA pass** — Retro theme at all viewport widths + landscape (noted as incomplete in Stage 5)
- **Additional feature work** — user-driven
- **Test coverage** — additional edge cases or integration-level tests
- **Documentation updates** — README, MASTER-SESSION-PROMPT alignment
---
## PRICING REFERENCE
```
Users: M365 $140 (m2m) / $130 (annual) | BYOL $110
ExtHrs +$25 | 1PWM +$9 | INKY +$8 | ZT +$55
Endpoints: $35/ea | USB +$4 | BMB +$25
Servers: $120/ea
ZT Net: $25/seat | $100/router
Admin: Floor $150 | Threshold $650 | ZT supplement +$250 | 1PWM 10%
VoIP: Basic $28 | Standard $35 | Premium $45 | Phone +$15 | Fax +$10
Discounts: m2m 0% | 12mo 3% + 50% off onboarding | 24mo 5% + complimentary
HST: 13% (Ontario)
```
---
## VERIFICATION COMMAND
```
node svsmspcalc/tests/test-quote-engine.js
```
254 tests, zero dependencies. Run after any pricing/engine/render changes.
---
## CONTEXT MANAGEMENT
After completing work:
- Update `docs/CHECKPOINT.md` with results
- If context is heavy, create `docs/STAGE10-SESSION-PROMPT.md` for the next chat
- Keep this document chain as the canonical handoff mechanism