fix: crash bugs in TeamInvoices + faster load

Bug fixes:
- TeamInvoices: add useAuth import/currentUser (invoice-create crash)
- TeamInvoices: setChartYear -> setExportYear (year-dropdown crash)
- TeamDashboard: drop redundant setState-in-effect (cascading renders)
- Companies: delete dead _UnusedClientCompanies (illegal hook calls)
- annotate intentional empty PDF-fallback catches

Load speed:
- preconnect/dns-prefetch to Supabase origin
- lazy-load heic-to in Converters: page chunk 2737KB -> 9KB
- split recharts into its own 'charts' vendor chunk

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Krao Hasanee
2026-06-08 12:59:11 -04:00
parent 85625f4d95
commit 04e0911e9f
101 changed files with 11786 additions and 7445 deletions
@@ -0,0 +1,686 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Checked Sites Revision Audit</title>
<style>
:root {
--bg: #f5f1e8;
--panel: rgba(255,255,255,0.78);
--panel-strong: rgba(255,255,255,0.92);
--border: rgba(43,37,28,0.12);
--text: #231d14;
--muted: #6b6255;
--accent: #b8831f;
--accent-soft: rgba(184,131,31,0.18);
--ok: #1f8a4c;
--ok-soft: rgba(31,138,76,0.12);
--warn: #b45309;
--warn-soft: rgba(180,83,9,0.14);
--review: #2563eb;
--review-soft: rgba(37,99,235,0.13);
--todo: #7c3aed;
--todo-soft: rgba(124,58,237,0.12);
--shadow: 0 18px 40px rgba(35,29,20,0.08);
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
color: var(--text);
background:
radial-gradient(circle at top left, rgba(184,131,31,0.14), transparent 28%),
radial-gradient(circle at top right, rgba(37,99,235,0.09), transparent 24%),
linear-gradient(180deg, #fbf8f2 0%, var(--bg) 100%);
}
.wrap {
width: min(1400px, calc(100vw - 40px));
margin: 32px auto 48px;
}
.hero, .panel {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 18px;
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
box-shadow: var(--shadow);
}
.hero {
padding: 28px 30px;
margin-bottom: 24px;
}
.eyebrow {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--muted);
margin-bottom: 10px;
}
h1 {
margin: 0 0 10px;
font-size: 34px;
line-height: 1.05;
letter-spacing: -0.04em;
}
.subtitle {
margin: 0;
color: var(--muted);
font-size: 15px;
max-width: 900px;
}
.grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 16px;
margin-bottom: 24px;
}
.card {
padding: 20px 22px;
}
.label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.12em;
color: var(--muted);
margin-bottom: 8px;
}
.value {
font-size: 34px;
line-height: 1;
letter-spacing: -0.05em;
}
.sub {
margin-top: 8px;
font-size: 13px;
color: var(--muted);
}
.two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin-bottom: 24px;
}
.panel {
padding: 20px 22px;
}
h2 {
margin: 0 0 14px;
font-size: 18px;
letter-spacing: -0.03em;
}
.bar-row {
display: grid;
grid-template-columns: 150px 1fr 36px;
gap: 10px;
align-items: center;
margin-bottom: 10px;
}
.bar-label, .bar-value {
font-size: 13px;
}
.bar-track {
height: 10px;
border-radius: 999px;
background: rgba(35,29,20,0.08);
overflow: hidden;
}
.bar-fill {
height: 100%;
border-radius: 999px;
background: linear-gradient(90deg, var(--accent), #d7a84b);
}
.table-wrap {
overflow: auto;
}
table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
th, td {
padding: 10px 12px;
border-bottom: 1px solid rgba(35,29,20,0.08);
vertical-align: top;
text-align: left;
font-size: 13px;
}
th {
position: sticky;
top: 0;
background: var(--panel-strong);
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.08em;
font-size: 11px;
z-index: 1;
}
.mono {
font-variant-numeric: tabular-nums;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pill {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 72px;
padding: 4px 10px;
border-radius: 999px;
font-size: 11px;
border: 1px solid transparent;
white-space: nowrap;
}
.ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(31,138,76,0.2); }
.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(180,83,9,0.2); }
.review { color: var(--review); background: var(--review-soft); border-color: rgba(37,99,235,0.2); }
.todo { color: var(--todo); background: var(--todo-soft); border-color: rgba(124,58,237,0.18); }
.neutral { color: var(--muted); background: rgba(35,29,20,0.06); border-color: rgba(35,29,20,0.08); }
.section {
margin-bottom: 24px;
}
.small {
color: var(--muted);
font-size: 13px;
}
@media (max-width: 1100px) {
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-col { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
.wrap { width: min(100vw - 20px, 1400px); margin: 20px auto 32px; }
.hero, .panel { padding: 18px; border-radius: 14px; }
.grid { grid-template-columns: 1fr; }
h1 { font-size: 28px; }
}
</style>
</head>
<body>
<div class="wrap">
<section class="hero">
<div class="eyebrow">Fourge Portal Audit</div>
<h1>Checked Sites Revision Audit</h1>
<p class="subtitle">This report treats your checkmark as “R00 was completed,” then separates that from billing and from any newer active revisions. It is designed to make client-billing comparison easier at a glance.</p>
</section>
<section class="grid">
<div class="panel card">
<div class="label">Checked Sites</div>
<div class="value">26</div>
<div class="sub">Sites found in the database from your checked list.</div>
</div>
<div class="panel card">
<div class="label">Active Revisions</div>
<div class="value">16</div>
<div class="sub">Checked sites that now have an active R01+.</div>
</div>
<div class="panel card">
<div class="label">R00 Billed</div>
<div class="value">23</div>
<div class="sub">Checked sites where the new-book unit is already on an invoice.</div>
</div>
<div class="panel card">
<div class="label">R00 Unbilled</div>
<div class="value">3</div>
<div class="sub">Checked sites completed at R00 but not yet billed.</div>
</div>
</section>
<section class="two-col">
<div class="panel">
<h2>Active Revision Status</h2>
<div class="bar-row">
<div class="bar-label">not_started</div>
<div class="bar-track"><div class="bar-fill" style="width:100%"></div></div>
<div class="bar-value">12</div>
</div>
<div class="bar-row">
<div class="bar-label">client_review</div>
<div class="bar-track"><div class="bar-fill" style="width:25%"></div></div>
<div class="bar-value">3</div>
</div>
<div class="bar-row">
<div class="bar-label">client_approved</div>
<div class="bar-track"><div class="bar-fill" style="width:8%"></div></div>
<div class="bar-value">1</div>
</div>
</div>
<div class="panel">
<h2>Active Revision Depth</h2>
<div class="bar-row">
<div class="bar-label">R01</div>
<div class="bar-track"><div class="bar-fill" style="width:100%"></div></div>
<div class="bar-value">10</div>
</div>
<div class="bar-row">
<div class="bar-label">R02</div>
<div class="bar-track"><div class="bar-fill" style="width:60%"></div></div>
<div class="bar-value">6</div>
</div>
</div>
</section>
<section class="panel section">
<h2>Sites With Active Revisions</h2>
<p class="small">These are the ones where R00 may be done, but a newer version is still active or awaiting review/approval.</p>
<div class="table-wrap">
<table>
<thead>
<tr>
<th style="width:90px;">Site #</th>
<th style="width:240px;">DB Title</th>
<th style="width:80px;">Internal #</th>
<th style="width:96px;">R00 Done</th>
<th style="width:180px;">R00 Billed</th>
<th style="width:90px;">Active R#</th>
<th style="width:120px;">Active Status</th>
<th style="width:170px;">Completed Revisions</th>
<th style="width:220px;">Billed Versions</th>
<th>Version Summary</th>
</tr>
</thead>
<tbody>
<tr>
<td class="mono">00286</td>
<td>00286 Riverside, CA</td>
<td class="mono">31</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill todo">not_started</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=not_started</td>
</tr>
<tr>
<td class="mono">30055</td>
<td>30055 Moreno Valley, CA</td>
<td class="mono">33</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill review">client_review</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=client_review</td>
</tr>
<tr>
<td class="mono">30096</td>
<td>30096 Eerie, CO</td>
<td class="mono">36</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R02</td>
<td><span class="pill todo">not_started</span></td>
<td>R01 (unbilled)</td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=completed; R02=not_started</td>
</tr>
<tr>
<td class="mono">68639</td>
<td>68639 NSA Los Lunas NM</td>
<td class="mono">40</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill review">client_review</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=client_review</td>
</tr>
<tr>
<td class="mono">68663</td>
<td>68663 NSA Oklahoma City OK</td>
<td class="mono">41</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill todo">not_started</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=not_started</td>
</tr>
<tr>
<td class="mono">68664</td>
<td>68664 NSA Oklahoma City OK</td>
<td class="mono">42</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill todo">not_started</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=not_started</td>
</tr>
<tr>
<td class="mono">68666</td>
<td>68666 NSA Oklahoma City, OK</td>
<td class="mono">43</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill todo">not_started</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=not_started</td>
</tr>
<tr>
<td class="mono">68669</td>
<td>68669 NSA Oklahoma City OK</td>
<td class="mono">44</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill todo">not_started</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=not_started</td>
</tr>
<tr>
<td class="mono">68670</td>
<td>68670 NSA Oklahoma City OK</td>
<td class="mono">45</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R02</td>
<td><span class="pill todo">not_started</span></td>
<td>R01 (billed)</td>
<td>R00: INV-2026-006 (sent) | R01: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=completed/billed; R02=not_started</td>
</tr>
<tr>
<td class="mono">68671</td>
<td>68671 NSA Oklahoma City OK</td>
<td class="mono">46</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill todo">not_started</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=not_started</td>
</tr>
<tr>
<td class="mono">68673</td>
<td>68673 NSA Oklahoma City OK</td>
<td class="mono">47</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill review">client_review</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=client_review</td>
</tr>
<tr>
<td class="mono">68721</td>
<td>68721 NSA Mechanicsburg PA</td>
<td class="mono">48</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R02</td>
<td><span class="pill approved">client_approved</span></td>
<td>R01 (billed), R02 (unbilled)</td>
<td>R00: INV-2026-006 (sent) | R01: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=completed/billed; R02=completed</td>
</tr>
<tr>
<td class="mono">68808</td>
<td>68808 Camas, WA</td>
<td class="mono">49</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R01</td>
<td><span class="pill todo">not_started</span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=not_started</td>
</tr>
<tr>
<td class="mono">68809</td>
<td>68809 Centralia, WA</td>
<td class="mono">50</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R02</td>
<td><span class="pill todo">not_started</span></td>
<td>R01 (billed)</td>
<td>R00: INV-2026-006 (sent) | R01: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=completed/billed; R02=not_started</td>
</tr>
<tr>
<td class="mono">68810</td>
<td>68810 Chehalis, WA</td>
<td class="mono">51</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R02</td>
<td><span class="pill todo">not_started</span></td>
<td>R01 (billed)</td>
<td>R00: INV-2026-006 (sent) | R01: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=completed/billed; R02=not_started</td>
</tr>
<tr>
<td class="mono">68811</td>
<td>68811 Kelso, WA</td>
<td class="mono">52</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill review">Yes</span></td>
<td class="mono">R02</td>
<td><span class="pill todo">not_started</span></td>
<td>R01 (unbilled)</td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed; R01=completed; R02=not_started</td>
</tr>
</tbody>
</table>
</div>
</section>
<section class="panel section">
<h2>Checked Sites With No Active Revision</h2>
<p class="small">These are simpler to read: R00 completed, and no current revision chain is active right now.</p>
<div class="table-wrap">
<table>
<thead>
<tr>
<th style="width:90px;">Site #</th>
<th style="width:240px;">DB Title</th>
<th style="width:80px;">Internal #</th>
<th style="width:96px;">R00 Done</th>
<th style="width:180px;">R00 Billed</th>
<th style="width:90px;">Active R#</th>
<th style="width:120px;">Active Status</th>
<th style="width:170px;">Completed Revisions</th>
<th style="width:220px;">Billed Versions</th>
<th>Version Summary</th>
</tr>
</thead>
<tbody>
<tr>
<td class="mono">30062</td>
<td>30062 Riverside, CA</td>
<td class="mono">34</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed</td>
</tr>
<tr>
<td class="mono">30094</td>
<td>30094 Colorado Springs, CO</td>
<td class="mono">35</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill warn">No</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td></td>
<td>R00=completed</td>
</tr>
<tr>
<td class="mono">30258</td>
<td>30258 Lebanon, NH</td>
<td class="mono">38</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed</td>
</tr>
<tr>
<td class="mono">30259</td>
<td>30259 Hamburg, NJ</td>
<td class="mono">39</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed</td>
</tr>
<tr>
<td class="mono">30261</td>
<td>30261 NSA Clovis NM</td>
<td class="mono">70</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill warn">No</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td></td>
<td>R00=completed</td>
</tr>
<tr>
<td class="mono">68720</td>
<td>68720 NSA Lancaster PA</td>
<td class="mono">74</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill warn">No</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td></td>
<td>R00=completed</td>
</tr>
<tr>
<td class="mono">68724</td>
<td>68724 NSA York PA</td>
<td class="mono">75</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed</td>
</tr>
<tr>
<td class="mono">68752</td>
<td>68752 NSA Brownsville TX</td>
<td class="mono">76</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed</td>
</tr>
<tr>
<td class="mono">68753</td>
<td>68753 NSA Brownsville TX</td>
<td class="mono">77</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed</td>
</tr>
<tr>
<td class="mono">68758</td>
<td>68758 NSA Brownsville TX</td>
<td class="mono">81</td>
<td><span class="pill ok">Yes</span></td>
<td><span class="pill ok">INV-2026-006 (sent)</span></td>
<td><span class="pill neutral">No</span></td>
<td class="mono"></td>
<td><span class="pill neutral"></span></td>
<td></td>
<td>R00: INV-2026-006 (sent)</td>
<td>R00=completed/billed</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</body>
</html>