Add /contractors revenue dashboard to silverback-ai-studio command center#12
Add /contractors revenue dashboard to silverback-ai-studio command center#12
Conversation
Agent-Logs-Url: https://github.com/BelichickGillisMusk/github/sessions/55e9aa18-923e-455b-9d01-a759f4ae054b Co-authored-by: fsu9913-gif <261542133+fsu9913-gif@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
dmc-properties | 9b60be5 | Apr 14 2026, 02:36 PM |
Agent-Logs-Url: https://github.com/BelichickGillisMusk/github/sessions/55e9aa18-923e-455b-9d01-a759f4ae054b Co-authored-by: fsu9913-gif <261542133+fsu9913-gif@users.noreply.github.com>
fsu9913-gif
left a comment
There was a problem hiding this comment.
Wrong website. Looks like you have another command center type thing not supposed to be associated with carb test Stockton
…ruckcheckstockton Agent-Logs-Url: https://github.com/BelichickGillisMusk/github/sessions/e6c79f9c-4f0e-4bed-97b2-1821b15e409d Co-authored-by: fsu9913-gif <261542133+fsu9913-gif@users.noreply.github.com>
…upport Agent-Logs-Url: https://github.com/BelichickGillisMusk/github/sessions/e6c79f9c-4f0e-4bed-97b2-1821b15e409d Co-authored-by: fsu9913-gif <261542133+fsu9913-gif@users.noreply.github.com>
You're right — moved the The contractors page now lives at
Commit: 9958d44 |
There was a problem hiding this comment.
Pull request overview
Adds a /contractors route to the Silverback AI Studio command center and introduces a contractor revenue dashboard UI for that route.
Changes:
- Added a
ContractorsPagedashboard (KPIs, filtering/search, table, CSV export) toApp.tsx. - Implemented minimal URL-based routing for
/contractorsusingwindow.history.pushState+popstatehandling. - Added a local
.gitignorefor the app to ignoredist/andpackage-lock.json.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
workers/silverback-ai-studio/src/App.tsx |
Adds contractors dashboard component and a simple history/pathname-driven route switch to render it. |
workers/silverback-ai-studio/.gitignore |
Ignores build output and package-lock.json for this worker app. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (page === 'contractors') { | ||
| return ( | ||
| <ContractorsPage | ||
| onBack={() => { | ||
| window.history.pushState({ page: 'main' }, '', '/'); | ||
| setPage('main'); | ||
| }} | ||
| /> |
There was a problem hiding this comment.
The contractors revenue dashboard is rendered purely based on page state, so navigating directly to /contractors will show the contractor revenue data even when the user is not signed in. If this data is intended to be protected like the rest of the command center, gate this route behind user (e.g., redirect back to / or show the sign-in view when !user).
| const header = 'ID,Company,City,Service Type,Vehicles,Last Test,Revenue,YTD Tests,Status\n'; | ||
| const rows = CONTRACTOR_DATA.map(c => | ||
| `"${c.id}","${c.company}","${c.city}","${c.type}",${c.vehicles},"${c.lastTest}",${c.revenue},${c.ytd},"${c.status}"` | ||
| ).join('\n'); | ||
| const blob = new Blob([header + rows], { type: 'text/csv' }); | ||
| const a = document.createElement('a'); | ||
| a.href = URL.createObjectURL(blob); | ||
| a.download = 'NorCalCARB_Contractors_YTD.csv'; | ||
| a.click(); |
There was a problem hiding this comment.
exportCSV() creates an object URL via URL.createObjectURL(blob) but never revokes it, which can leak memory if the user exports multiple times. Also, values are quoted but not CSV-escaped (no doubling of embedded quotes), unlike downloadReportCSV later in this file. Consider escaping fields and revoking the object URL after triggering the download.
| const header = 'ID,Company,City,Service Type,Vehicles,Last Test,Revenue,YTD Tests,Status\n'; | |
| const rows = CONTRACTOR_DATA.map(c => | |
| `"${c.id}","${c.company}","${c.city}","${c.type}",${c.vehicles},"${c.lastTest}",${c.revenue},${c.ytd},"${c.status}"` | |
| ).join('\n'); | |
| const blob = new Blob([header + rows], { type: 'text/csv' }); | |
| const a = document.createElement('a'); | |
| a.href = URL.createObjectURL(blob); | |
| a.download = 'NorCalCARB_Contractors_YTD.csv'; | |
| a.click(); | |
| const escapeCSVField = (value: string | number) => { | |
| const stringValue = String(value).replace(/"/g, '""'); | |
| return `"${stringValue}"`; | |
| }; | |
| const header = 'ID,Company,City,Service Type,Vehicles,Last Test,Revenue,YTD Tests,Status\n'; | |
| const rows = CONTRACTOR_DATA.map(c => | |
| [ | |
| c.id, | |
| c.company, | |
| c.city, | |
| c.type, | |
| c.vehicles, | |
| c.lastTest, | |
| c.revenue, | |
| c.ytd, | |
| c.status, | |
| ].map(escapeCSVField).join(',') | |
| ).join('\n'); | |
| const blob = new Blob([header + rows], { type: 'text/csv' }); | |
| const a = document.createElement('a'); | |
| const url = URL.createObjectURL(blob); | |
| try { | |
| a.href = url; | |
| a.download = 'NorCalCARB_Contractors_YTD.csv'; | |
| a.click(); | |
| } finally { | |
| URL.revokeObjectURL(url); | |
| } |
| <table className="w-full min-w-[900px]"> | ||
| <thead> | ||
| <tr className="border-b border-white/5 bg-white/[0.02]"> | ||
| {['#', 'Company', 'Service Type', 'Vehicles', 'Last Test', 'Revenue', 'YTD Tests', 'Status'].map(h => ( |
There was a problem hiding this comment.
The first table column displays c.id values like C001, but the header label is '#', which is misleading. Rename the header to something like ID to match the data being displayed.
| {['#', 'Company', 'Service Type', 'Vehicles', 'Last Test', 'Revenue', 'YTD Tests', 'Status'].map(h => ( | |
| {['ID', 'Company', 'Service Type', 'Vehicles', 'Last Test', 'Revenue', 'YTD Tests', 'Status'].map(h => ( |
| // --- Contractors Revenue Page --- | ||
| const CONTRACTOR_DATA = [ | ||
| { id:'C001', company:'Pacific Coast Freight LLC', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-03-28', revenue:1800, ytd:12, status:'active' }, | ||
| { id:'C002', company:'Central Valley Trucking Co.', city:'Modesto', type:'Opacity + HD-OBD', vehicles:8, lastTest:'2026-04-02', revenue:2120, ytd:8, status:'active' }, | ||
| { id:'C003', company:'Delta Transport Inc.', city:'Stockton', type:'Fleet HD-OBD', vehicles:15, lastTest:'2026-03-15', revenue:2250, ytd:15, status:'active' }, | ||
| { id:'C004', company:'San Joaquin Logistics', city:'Tracy', type:'HD-OBD Only', vehicles:6, lastTest:'2026-04-05', revenue:450, ytd:6, status:'active' }, | ||
| { id:'C005', company:'Valley Farm Transport', city:'Lodi', type:'Opacity Test', vehicles:4, lastTest:'2026-02-20', revenue:796, ytd:4, status:'active' }, | ||
| { id:'C006', company:'Stockton Steel & Iron', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-03-22', revenue:1350, ytd:9, status:'active' }, | ||
| { id:'C007', company:'Big Rig Ready Inc.', city:'Manteca', type:'HD-OBD Only', vehicles:7, lastTest:'2026-04-01', revenue:525, ytd:7, status:'active' }, | ||
| { id:'C008', company:'Sunrise Haulers', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-10', revenue:1500, ytd:5, status:'active' }, | ||
| { id:'C009', company:'Interstate Cargo Partners', city:'Lathrop', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-04-08', revenue:1650, ytd:11, status:'active' }, | ||
| { id:'C010', company:'Golden State Refrigerated', city:'Stockton', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-05', revenue:225, ytd:3, status:'pending' }, | ||
| { id:'C011', company:'Manteca Moving & Storage', city:'Manteca', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-18', revenue:150, ytd:2, status:'active' }, | ||
| { id:'C012', company:'Turlock Ag Transport', city:'Turlock', type:'Opacity Test', vehicles:6, lastTest:'2026-02-14', revenue:1194, ytd:6, status:'active' }, | ||
| { id:'C013', company:'Crossroads Cement Co.', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-03-29', revenue:1490, ytd:10, status:'active' }, | ||
| { id:'C014', company:'West Valley Waste Solutions', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-04-03', revenue:1960, ytd:7, status:'active' }, | ||
| { id:'C015', company:'Port of Stockton Contractors', city:'Stockton', type:'Fleet HD-OBD', vehicles:20, lastTest:'2026-04-07', revenue:2980, ytd:20, status:'active' }, | ||
| { id:'C016', company:'NorCal Box Trucking', city:'Sacramento', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-17', revenue:375, ytd:5, status:'active' }, | ||
| { id:'C017', company:'Sierra Pacific Timber Haul', city:'Angels Camp', type:'Opacity Test', vehicles:3, lastTest:'2026-02-28', revenue:597, ytd:3, status:'active' }, | ||
| { id:'C018', company:'Lodi Nursery & Landscape', city:'Lodi', type:'HD-OBD Only', vehicles:2, lastTest:'2025-12-10', revenue:150, ytd:2, status:'inactive' }, | ||
| { id:'C019', company:'Tracy Distribution Center', city:'Tracy', type:'Fleet HD-OBD', vehicles:14, lastTest:'2026-04-04', revenue:2086, ytd:14, status:'active' }, | ||
| { id:'C020', company:'Valley Propane & Gas', city:'Stockton', type:'HD-OBD Only', vehicles:4, lastTest:'2026-03-20', revenue:300, ytd:4, status:'active' }, | ||
| { id:'C021', company:'SJV Excavating LLC', city:'Fresno', type:'Opacity + HD-OBD', vehicles:6, lastTest:'2026-03-12', revenue:1680, ytd:6, status:'active' }, | ||
| { id:'C022', company:'Riverbend Concrete Pumping', city:'Stockton', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-25', revenue:1192, ytd:8, status:'active' }, | ||
| { id:'C023', company:'Bay Area Flatbed Express', city:'Oakland', type:'HD-OBD Only', vehicles:3, lastTest:'2026-01-30', revenue:225, ytd:3, status:'pending' }, | ||
| { id:'C024', company:'Diablo Asphalt Services', city:'Antioch', type:'Opacity Test', vehicles:5, lastTest:'2026-02-22', revenue:995, ytd:5, status:'active' }, | ||
| { id:'C025', company:'Stanislaus Tank Liners', city:'Modesto', type:'HD-OBD Only', vehicles:2, lastTest:'2026-03-08', revenue:150, ytd:2, status:'active' }, | ||
| { id:'C026', company:'Central Valley RV Fleet', city:'Stockton', type:'RV Testing', vehicles:4, lastTest:'2026-02-05', revenue:1200, ytd:4, status:'active' }, | ||
| { id:'C027', company:'Coastal Crane Rentals', city:'Lathrop', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-06', revenue:1043, ytd:7, status:'active' }, | ||
| { id:'C028', company:'Gold Rush Gravel & Sand', city:'Ione', type:'Opacity Test', vehicles:3, lastTest:'2026-03-03', revenue:597, ytd:3, status:'active' }, | ||
| { id:'C029', company:'Modesto Ice & Cold Chain', city:'Modesto', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-14', revenue:375, ytd:5, status:'active' }, | ||
| { id:'C030', company:'Apex Auto Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-04-09', revenue:1341, ytd:9, status:'active' }, | ||
| { id:'C031', company:'Heritage Lumber Transport', city:'Sonora', type:'Opacity Test', vehicles:4, lastTest:'2026-01-22', revenue:796, ytd:4, status:'pending' }, | ||
| { id:'C032', company:'Crossroads Food Distribution', city:'Stockton', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-03-31', revenue:1639, ytd:11, status:'active' }, | ||
| { id:'C033', company:'Mission Ready Mechanical', city:'Tracy', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-18', revenue:225, ytd:3, status:'active' }, | ||
| { id:'C034', company:'Valley Visions Recycling', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-19', revenue:1400, ytd:5, status:'active' }, | ||
| { id:'C035', company:'Pacific Rim Containers', city:'Stockton', type:'Fleet HD-OBD', vehicles:16, lastTest:'2026-04-10', revenue:2384, ytd:16, status:'active' }, | ||
| { id:'C036', company:'North Valley Fire Protection', city:'Chico', type:'HD-OBD Only', vehicles:2, lastTest:'2025-11-14', revenue:150, ytd:2, status:'inactive' }, | ||
| { id:'C037', company:'San Joaquin Crane Service', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-03-26', revenue:894, ytd:6, status:'active' }, | ||
| { id:'C038', company:'Delta Ag Spraying LLC', city:'Lodi', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-10', revenue:300, ytd:4, status:'active' }, | ||
| { id:'C039', company:'I-5 Corridor Express', city:'Stockton', type:'Fleet HD-OBD', vehicles:13, lastTest:'2026-04-02', revenue:1937, ytd:13, status:'active' }, | ||
| { id:'C040', company:'Sunrise Septic & Drain', city:'Manteca', type:'Opacity Test', vehicles:3, lastTest:'2026-03-07', revenue:597, ytd:3, status:'active' }, | ||
| { id:'C041', company:'Big Valley Beverage Dist.', city:'Fresno', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-21', revenue:1192, ytd:8, status:'active' }, | ||
| { id:'C042', company:'Turlock Towing & Recovery', city:'Turlock', type:'HD-OBD Only', vehicles:5, lastTest:'2026-01-28', revenue:375, ytd:5, status:'pending' }, | ||
| { id:'C043', company:'Sutter Crane & Rigging', city:'Sacramento', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-01', revenue:1043, ytd:7, status:'active' }, | ||
| { id:'C044', company:'West Side Produce Inc.', city:'Fresno', type:'Opacity + HD-OBD', vehicles:9, lastTest:'2026-03-16', revenue:2520, ytd:9, status:'active' }, | ||
| { id:'C045', company:'Capitol City Flatbed', city:'Sacramento', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-25', revenue:300, ytd:4, status:'active' }, | ||
| { id:'C046', company:'Mountain Pass Logging', city:'Sonora', type:'Opacity Test', vehicles:5, lastTest:'2025-12-20', revenue:995, ytd:5, status:'inactive' }, | ||
| { id:'C047', company:'Eastside Iron & Metal', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-04-07', revenue:894, ytd:6, status:'active' }, | ||
| { id:'C048', company:'Valley Air Freight', city:'Fresno', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-11', revenue:225, ytd:3, status:'active' }, | ||
| { id:'C049', company:'Horizon Tank Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-04-08', revenue:1490, ytd:10, status:'active' }, | ||
| { id:'C050', company:'Sierra Nevada Brewing Dist.', city:'Chico', type:'HD-OBD Only', vehicles:6, lastTest:'2026-03-04', revenue:450, ytd:6, status:'active' }, | ||
| { id:'C051', company:'Central Valley Hay & Feed', city:'Tulare', type:'Opacity Test', vehicles:4, lastTest:'2026-02-08', revenue:796, ytd:4, status:'active' }, | ||
| { id:'C052', company:'Gold Hills Aggregate', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-04-03', revenue:1788, ytd:12, status:'active' }, | ||
| { id:'C053', company:'Triton Marine Transport', city:'Stockton', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-15', revenue:150, ytd:2, status:'pending' }, | ||
| { id:'C054', company:'Sunrise Demolition LLC', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-03-27', revenue:1960, ytd:7, status:'active' }, | ||
| { id:'C055', company:'NorCal Mobile Crane', city:'Sacramento', type:'Fleet HD-OBD', vehicles:5, lastTest:'2026-04-04', revenue:745, ytd:5, status:'active' }, | ||
| { id:'C056', company:'Valley Vines Vineyard Svc.', city:'Lodi', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-17', revenue:225, ytd:3, status:'active' }, | ||
| { id:'C057', company:'Stockton Ready Mix Concrete', city:'Stockton', type:'Fleet HD-OBD', vehicles:18, lastTest:'2026-04-09', revenue:2682, ytd:18, status:'active' }, | ||
| { id:'C058', company:'Amador County Timber', city:'Jackson', type:'Opacity Test', vehicles:3, lastTest:'2025-10-30', revenue:597, ytd:3, status:'inactive' }, | ||
| ]; | ||
|
|
||
| type ContractorStatus = 'active' | 'pending' | 'inactive'; | ||
|
|
||
| interface Contractor { | ||
| id: string; | ||
| company: string; | ||
| city: string; | ||
| type: string; | ||
| vehicles: number; | ||
| lastTest: string; | ||
| revenue: number; | ||
| ytd: number; | ||
| status: ContractorStatus; | ||
| } | ||
|
|
||
| function ContractorsPage({ onBack }: { onBack: () => void }) { | ||
| const [filter, setFilter] = useState<'all' | ContractorStatus | 'fleet'>('all'); | ||
| const [search, setSearch] = useState(''); | ||
|
|
||
| const filtered = CONTRACTOR_DATA.filter((c: Contractor) => { | ||
| if (search) { | ||
| const q = search.toLowerCase(); | ||
| if (!c.company.toLowerCase().includes(q) && !c.city.toLowerCase().includes(q)) return false; | ||
| } | ||
| if (filter === 'all') return true; | ||
| if (filter === 'fleet') return c.vehicles >= 5; | ||
| return c.status === filter; | ||
| }); |
There was a problem hiding this comment.
CONTRACTOR_DATA is not typed as Contractor[], and the code works around that by annotating callback params as Contractor. This can mask accidental shape/type regressions in the dataset (e.g., an invalid status string) because the annotation is effectively a type assertion. Prefer typing the constant directly (e.g., const CONTRACTOR_DATA: Contractor[] = ... or satisfies Contractor[]) and then remove the manual (c: Contractor) annotations.
| // --- Contractors Revenue Page --- | ||
| const CONTRACTOR_DATA = [ | ||
| { id:'C001', company:'Pacific Coast Freight LLC', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-03-28', revenue:1800, ytd:12, status:'active' }, | ||
| { id:'C002', company:'Central Valley Trucking Co.', city:'Modesto', type:'Opacity + HD-OBD', vehicles:8, lastTest:'2026-04-02', revenue:2120, ytd:8, status:'active' }, | ||
| { id:'C003', company:'Delta Transport Inc.', city:'Stockton', type:'Fleet HD-OBD', vehicles:15, lastTest:'2026-03-15', revenue:2250, ytd:15, status:'active' }, | ||
| { id:'C004', company:'San Joaquin Logistics', city:'Tracy', type:'HD-OBD Only', vehicles:6, lastTest:'2026-04-05', revenue:450, ytd:6, status:'active' }, | ||
| { id:'C005', company:'Valley Farm Transport', city:'Lodi', type:'Opacity Test', vehicles:4, lastTest:'2026-02-20', revenue:796, ytd:4, status:'active' }, | ||
| { id:'C006', company:'Stockton Steel & Iron', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-03-22', revenue:1350, ytd:9, status:'active' }, | ||
| { id:'C007', company:'Big Rig Ready Inc.', city:'Manteca', type:'HD-OBD Only', vehicles:7, lastTest:'2026-04-01', revenue:525, ytd:7, status:'active' }, | ||
| { id:'C008', company:'Sunrise Haulers', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-10', revenue:1500, ytd:5, status:'active' }, | ||
| { id:'C009', company:'Interstate Cargo Partners', city:'Lathrop', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-04-08', revenue:1650, ytd:11, status:'active' }, | ||
| { id:'C010', company:'Golden State Refrigerated', city:'Stockton', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-05', revenue:225, ytd:3, status:'pending' }, | ||
| { id:'C011', company:'Manteca Moving & Storage', city:'Manteca', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-18', revenue:150, ytd:2, status:'active' }, | ||
| { id:'C012', company:'Turlock Ag Transport', city:'Turlock', type:'Opacity Test', vehicles:6, lastTest:'2026-02-14', revenue:1194, ytd:6, status:'active' }, | ||
| { id:'C013', company:'Crossroads Cement Co.', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-03-29', revenue:1490, ytd:10, status:'active' }, | ||
| { id:'C014', company:'West Valley Waste Solutions', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-04-03', revenue:1960, ytd:7, status:'active' }, | ||
| { id:'C015', company:'Port of Stockton Contractors', city:'Stockton', type:'Fleet HD-OBD', vehicles:20, lastTest:'2026-04-07', revenue:2980, ytd:20, status:'active' }, | ||
| { id:'C016', company:'NorCal Box Trucking', city:'Sacramento', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-17', revenue:375, ytd:5, status:'active' }, | ||
| { id:'C017', company:'Sierra Pacific Timber Haul', city:'Angels Camp', type:'Opacity Test', vehicles:3, lastTest:'2026-02-28', revenue:597, ytd:3, status:'active' }, | ||
| { id:'C018', company:'Lodi Nursery & Landscape', city:'Lodi', type:'HD-OBD Only', vehicles:2, lastTest:'2025-12-10', revenue:150, ytd:2, status:'inactive' }, | ||
| { id:'C019', company:'Tracy Distribution Center', city:'Tracy', type:'Fleet HD-OBD', vehicles:14, lastTest:'2026-04-04', revenue:2086, ytd:14, status:'active' }, | ||
| { id:'C020', company:'Valley Propane & Gas', city:'Stockton', type:'HD-OBD Only', vehicles:4, lastTest:'2026-03-20', revenue:300, ytd:4, status:'active' }, | ||
| { id:'C021', company:'SJV Excavating LLC', city:'Fresno', type:'Opacity + HD-OBD', vehicles:6, lastTest:'2026-03-12', revenue:1680, ytd:6, status:'active' }, | ||
| { id:'C022', company:'Riverbend Concrete Pumping', city:'Stockton', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-25', revenue:1192, ytd:8, status:'active' }, | ||
| { id:'C023', company:'Bay Area Flatbed Express', city:'Oakland', type:'HD-OBD Only', vehicles:3, lastTest:'2026-01-30', revenue:225, ytd:3, status:'pending' }, | ||
| { id:'C024', company:'Diablo Asphalt Services', city:'Antioch', type:'Opacity Test', vehicles:5, lastTest:'2026-02-22', revenue:995, ytd:5, status:'active' }, | ||
| { id:'C025', company:'Stanislaus Tank Liners', city:'Modesto', type:'HD-OBD Only', vehicles:2, lastTest:'2026-03-08', revenue:150, ytd:2, status:'active' }, | ||
| { id:'C026', company:'Central Valley RV Fleet', city:'Stockton', type:'RV Testing', vehicles:4, lastTest:'2026-02-05', revenue:1200, ytd:4, status:'active' }, | ||
| { id:'C027', company:'Coastal Crane Rentals', city:'Lathrop', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-06', revenue:1043, ytd:7, status:'active' }, | ||
| { id:'C028', company:'Gold Rush Gravel & Sand', city:'Ione', type:'Opacity Test', vehicles:3, lastTest:'2026-03-03', revenue:597, ytd:3, status:'active' }, | ||
| { id:'C029', company:'Modesto Ice & Cold Chain', city:'Modesto', type:'HD-OBD Only', vehicles:5, lastTest:'2026-03-14', revenue:375, ytd:5, status:'active' }, | ||
| { id:'C030', company:'Apex Auto Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:9, lastTest:'2026-04-09', revenue:1341, ytd:9, status:'active' }, | ||
| { id:'C031', company:'Heritage Lumber Transport', city:'Sonora', type:'Opacity Test', vehicles:4, lastTest:'2026-01-22', revenue:796, ytd:4, status:'pending' }, | ||
| { id:'C032', company:'Crossroads Food Distribution', city:'Stockton', type:'Fleet HD-OBD', vehicles:11, lastTest:'2026-03-31', revenue:1639, ytd:11, status:'active' }, | ||
| { id:'C033', company:'Mission Ready Mechanical', city:'Tracy', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-18', revenue:225, ytd:3, status:'active' }, | ||
| { id:'C034', company:'Valley Visions Recycling', city:'Stockton', type:'Opacity + HD-OBD', vehicles:5, lastTest:'2026-03-19', revenue:1400, ytd:5, status:'active' }, | ||
| { id:'C035', company:'Pacific Rim Containers', city:'Stockton', type:'Fleet HD-OBD', vehicles:16, lastTest:'2026-04-10', revenue:2384, ytd:16, status:'active' }, | ||
| { id:'C036', company:'North Valley Fire Protection', city:'Chico', type:'HD-OBD Only', vehicles:2, lastTest:'2025-11-14', revenue:150, ytd:2, status:'inactive' }, | ||
| { id:'C037', company:'San Joaquin Crane Service', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-03-26', revenue:894, ytd:6, status:'active' }, | ||
| { id:'C038', company:'Delta Ag Spraying LLC', city:'Lodi', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-10', revenue:300, ytd:4, status:'active' }, | ||
| { id:'C039', company:'I-5 Corridor Express', city:'Stockton', type:'Fleet HD-OBD', vehicles:13, lastTest:'2026-04-02', revenue:1937, ytd:13, status:'active' }, | ||
| { id:'C040', company:'Sunrise Septic & Drain', city:'Manteca', type:'Opacity Test', vehicles:3, lastTest:'2026-03-07', revenue:597, ytd:3, status:'active' }, | ||
| { id:'C041', company:'Big Valley Beverage Dist.', city:'Fresno', type:'Fleet HD-OBD', vehicles:8, lastTest:'2026-03-21', revenue:1192, ytd:8, status:'active' }, | ||
| { id:'C042', company:'Turlock Towing & Recovery', city:'Turlock', type:'HD-OBD Only', vehicles:5, lastTest:'2026-01-28', revenue:375, ytd:5, status:'pending' }, | ||
| { id:'C043', company:'Sutter Crane & Rigging', city:'Sacramento', type:'Fleet HD-OBD', vehicles:7, lastTest:'2026-04-01', revenue:1043, ytd:7, status:'active' }, | ||
| { id:'C044', company:'West Side Produce Inc.', city:'Fresno', type:'Opacity + HD-OBD', vehicles:9, lastTest:'2026-03-16', revenue:2520, ytd:9, status:'active' }, | ||
| { id:'C045', company:'Capitol City Flatbed', city:'Sacramento', type:'HD-OBD Only', vehicles:4, lastTest:'2026-02-25', revenue:300, ytd:4, status:'active' }, | ||
| { id:'C046', company:'Mountain Pass Logging', city:'Sonora', type:'Opacity Test', vehicles:5, lastTest:'2025-12-20', revenue:995, ytd:5, status:'inactive' }, | ||
| { id:'C047', company:'Eastside Iron & Metal', city:'Stockton', type:'Fleet HD-OBD', vehicles:6, lastTest:'2026-04-07', revenue:894, ytd:6, status:'active' }, | ||
| { id:'C048', company:'Valley Air Freight', city:'Fresno', type:'HD-OBD Only', vehicles:3, lastTest:'2026-03-11', revenue:225, ytd:3, status:'active' }, | ||
| { id:'C049', company:'Horizon Tank Transport', city:'Stockton', type:'Fleet HD-OBD', vehicles:10, lastTest:'2026-04-08', revenue:1490, ytd:10, status:'active' }, | ||
| { id:'C050', company:'Sierra Nevada Brewing Dist.', city:'Chico', type:'HD-OBD Only', vehicles:6, lastTest:'2026-03-04', revenue:450, ytd:6, status:'active' }, | ||
| { id:'C051', company:'Central Valley Hay & Feed', city:'Tulare', type:'Opacity Test', vehicles:4, lastTest:'2026-02-08', revenue:796, ytd:4, status:'active' }, | ||
| { id:'C052', company:'Gold Hills Aggregate', city:'Stockton', type:'Fleet HD-OBD', vehicles:12, lastTest:'2026-04-03', revenue:1788, ytd:12, status:'active' }, | ||
| { id:'C053', company:'Triton Marine Transport', city:'Stockton', type:'HD-OBD Only', vehicles:2, lastTest:'2026-01-15', revenue:150, ytd:2, status:'pending' }, | ||
| { id:'C054', company:'Sunrise Demolition LLC', city:'Modesto', type:'Opacity + HD-OBD', vehicles:7, lastTest:'2026-03-27', revenue:1960, ytd:7, status:'active' }, | ||
| { id:'C055', company:'NorCal Mobile Crane', city:'Sacramento', type:'Fleet HD-OBD', vehicles:5, lastTest:'2026-04-04', revenue:745, ytd:5, status:'active' }, | ||
| { id:'C056', company:'Valley Vines Vineyard Svc.', city:'Lodi', type:'HD-OBD Only', vehicles:3, lastTest:'2026-02-17', revenue:225, ytd:3, status:'active' }, | ||
| { id:'C057', company:'Stockton Ready Mix Concrete', city:'Stockton', type:'Fleet HD-OBD', vehicles:18, lastTest:'2026-04-09', revenue:2682, ytd:18, status:'active' }, | ||
| { id:'C058', company:'Amador County Timber', city:'Jackson', type:'Opacity Test', vehicles:3, lastTest:'2025-10-30', revenue:597, ytd:3, status:'inactive' }, | ||
| ]; | ||
|
|
||
| type ContractorStatus = 'active' | 'pending' | 'inactive'; | ||
|
|
||
| interface Contractor { | ||
| id: string; | ||
| company: string; | ||
| city: string; | ||
| type: string; | ||
| vehicles: number; | ||
| lastTest: string; | ||
| revenue: number; | ||
| ytd: number; | ||
| status: ContractorStatus; | ||
| } | ||
|
|
||
| function ContractorsPage({ onBack }: { onBack: () => void }) { |
There was a problem hiding this comment.
App.tsx is already very large (≈1950 lines), and adding a full page component plus a large inlined dataset here makes it harder to maintain and review. Consider moving ContractorsPage (and the dataset) into a separate module (e.g., src/pages/ContractorsPage.tsx and src/data/contractors.ts) to keep App.tsx focused on app shell/routing and to enable easier future changes/code-splitting.
The silverback-ai-studio command center app had no
/contractorsroute, so visiting that path showed nothing instead of the expected 50+ sales records.Changes
workers/silverback-ai-studio/src/App.tsx— addedContractorsPagecomponent and URL-based routing:pagestate initialized fromwindow.location.pathname— navigating directly to/contractorsrenders the contractors pagepopstateevent listener syncs state with browser back/forward navigationwindow.history.pushState({ page: 'main' }, '', '/')to return to the main appContractorsPage— full contractor revenue dashboard matching the Silverback AI dark black/orange theme:workers/cleantruckcheckstockton/worker.js— reverted to original state; no routing changes belong on the CARB testing site