July 1, 2026 — RefCalc, settings & app shell
Path: _pwa-build/ · Pushed to production July 4, 2026 (site v1.0.21) · SW cache v23
July 4 push summary
- Full PWA shell: acquire flow, license gate, RefCalc (multi-refrigerant), settings, device limits (5 per key).
- Root homepage PHVAC PWA App CTA with smart entry when license cached.
- RefCalc step 11. Save Log — Save PDF, Save Log, My Logs in bottom bar.
- Coil Airflow compact toggles; Cond TD + ODB on one row; footer shows site version tag.
- Supabase:
006_license_devices.sql + Edge Functions (deploy separately before device limits work online).
Local dev workflow
- Run
.\dev.ps1 from pwacalc repo root (not inside _pwa-build).
- App home:
/_pwa-build/app/
- Edit files → save → refresh browser. No install or git push required for preview.
Licensing & acquisition
- Free claim — fixed 500 error via
005_fix_free_claim.sql (grants service_role access to license RPCs).
- Buy button — wired to Stripe Payment Link (
STRIPE_PAYMENT_LINK in js/config.js); prefills email on checkout.
- Thank-you page — retrieves license via
session_id after Stripe payment (webhook + retrieve-checkout-license).
- Edge Functions live:
get-acquisition-stats, claim-free-license, validate-license, etc.
Settings page
- Gear icon in app header →
app/settings.htm.
- Appearance — Light / Dark / System (
phvac-theme in localStorage).
- Working refrigerant — default for RefCalc; home card badge shows selected label (e.g. R-410A).
- Pressure display — PSIG / PSIA (
phvac-pressure-unit); RefCalc reads setting and updates live.
- License — status line; Remove Key at bottom with consequence warning.
- Nav:
← Home on settings and log pages.
JSON data loading fix
pt-loader.js used ../data/ which resolved to /_pwa-build/app/data/ from tool pages (404).
- Fixed to use
/data/{refrigerant}.json on HTTP servers — works from both members/ and _pwa-build/app/tools/.
Unified RefCalc (July 1, continued)
- RefCalc.htm — single app page for all refrigerants, based on
r410a.htm template (includes duct steps).
- ref-calc.js — loads
/data/{code}.json dynamically; thermodynamic constants from JSON constants block (Cp, derates, gauge placeholders).
- App home: one Refrigerant Calc card;
r410a.htm / r454b.htm redirect to RefCalc.htm?ref=.
- Settings: working refrigerant at top;
← Home nav; Remove Key at bottom with consequence warning.
RefCalc fixes & polish
- JSON loading — built-in
fetchRefrigerantJson() in ref-calc.js (ES module could not use pt-loader.js globals). PHVAC_DATA_BASE set in RefCalc head.
_pwa-build/ copied into main consultation.web.site repo so .\dev.ps1 serves the app locally.
- Removed obsolete
loadQuickScenario (was crashing module init).
- Stepper: removed empty section dropdown; ← Prev / Next → only.
- Removed in-page PSIG/PSIA toggle and helper text (moved to Settings).
- PT chart pressure columns follow Settings unit (PSIG or PSIA).
- Service worker cache: v10.
App home & navigation
- Single Refrigerant Calc card — separate R-410A / R-454B / Refrigerants hub cards removed.
refrigerants.htm redirects to RefCalc.htm; hub removed from adapt-tools.mjs.
app-shell.js — default refrigerant highlight on RefCalc card only.
- Legacy
r410a.htm / r454b.htm in app tools redirect to RefCalc.htm?ref=.
JSON constants
data/r410a.json, r454b.json, r134a.json, r404a.json — added constants block (Cp, derates, gauge placeholders, etc.).
PWA scope vs. site chrome
- RefCalc strips site header/nav — app top bar only. Other copied tools may still show site chrome.
- Links to
bugs/, my-logs.htm, and public site do leave the app scope.
Files added / key paths
_pwa-build/js/app-settings.js — theme, refrigerant, pressure unit prefs
_pwa-build/js/ref-calc.js — unified refrigerant diagnostic module
_pwa-build/js/app-shell.js — gear link, default highlights
_pwa-build/app/tools/RefCalc.htm
_pwa-build/scripts/adapt-refcalc.mjs — regenerate RefCalc from r410a template
_pwa-build/app/settings.htm
_pwa-build/app/logs/ — this app-specific dev log
_pwa-build/scripts/adapt-tools.mjs — re-run after editing members/*.htm
Notes & References modal
- Stepper trimmed to 10 steps — removed Important Notes and References as calc sections.
- Footer Notes & References button opens a modal; content loaded per refrigerant from JSON
importantNotes and references arrays.
- JSON updated for
r410a, r454b, r134a, r404a.
ref-calc.js — renderRefInfoContent(), modal open/close handlers, click-outside dismiss.
pwa-acquire.css — modal and footer link styles.
adapt-refcalc.mjs — strips in-page notes sections, injects footer button + modal; source template is members/r410a.htm.
- Service worker cache: v13.
License gate & acquire 404 fix
- Restored missing
_pwa-build/acquire.htm, thank-you.htm, and index.htm (were in pwacalc worktree only).
acquisition.js — thank-you redirect now includes expiry so offline license cache is valid.
thank-you.htm — validates key with Supabase when expiry missing from URL.
license-gate.js — pre-fills cached key and shows error when online revalidation fails.
- Service worker cache: v14 (precaches acquire + thank-you).
- Committed locally only — not pushed live.
RefCalc chrome polish
- Removed
app-header block — active refrigerant label only (e.g. R-410A), centered in top bar.
- Top bar: ← Home | refrigerant label | settings gear.
- Footer: compact
app-footer-bar matching top bar — copyright only.
- Service worker cache: v17.
Footer version + smart PWA entry
- PWA
app-footer-bar shows site version via data-site-version-tag (same site-version.js as main site).
- Version bump policy: edit
SITE_VERSION only immediately before git push; run node scripts/fix-version-placeholders.cjs.
- Root homepage PHVAC PWA App button (
pwa-entry.js) skips landing page when valid phvac-license is cached.
- Service worker cache: v19.
License device limits (5 per key)
- Migration
006_license_devices.sql — license_devices table + register/list/deactivate RPCs.
- Edge Functions: updated
validate-license; new list-license-devices, deactivate-license-device.
- Client:
device-id.js, device-aware license-client.js, Settings device list, gate device_limit messaging.
- Service worker cache: v20. Deploy migration + functions before testing online validation.
RefCalc coil airflow + log button layout
.ref-calc-page compact Air|Water and Coil TD|Disch toggles (same scale as members r410a); both pairs on one row.
- Cond TD and ODB inputs side-by-side in
#cond-air-inputs.
- Save Diagnostic Log panel: three compact
log-action-btn buttons matching toggle size.
- Service worker cache: v21.
Save Log step restore
- Save Diagnostic Log is now step 11. Save Log in the RefCalc stepper (was easy to miss below long output sections).
- After Run Diagnostic, app navigates to Save Log automatically.
- Log action buttons slightly larger (
0.72rem) for readability while staying compact.
- Service worker cache: v22.
Step 11 action buttons
- Save Log step: bottom bar shows Save PDF, Save Log, My Logs — no Recalculate or Clear All.
- Other output steps still use Recalculate + Clear All.
- Service worker cache: v23.
Still open
- App-native UI for other copied tools (electrical, aircalc, etc.) — still show site chrome.
- R-22 and additional refrigerants — no JSON data file yet.
- Merge
_pwa-build/ to production when ready.