refactor: professional code quality audit

- Fix all TypeScript compilation errors (0 errors in src/)
- Add try/catch error handling to ALL API routes (38 handlers)
- Fix empty catch blocks (api-auth.ts now logs warnings)
- Add aria-labels to all icon-only buttons (WCAG 2.1 AA)
- Fix Prisma type mismatches (OR filter, Person.companyId, Estimate.projectId, Ticket.createdAt)
- Fix webhook PATCH route (moved to [id]/route.ts)
- Fix mobile-bottom-nav type safety
- Fix KB route where-clause type
- Fix test-mail banner null vs undefined
- Fix task comment fetch: add cancellation + error toast
- ESLint: 0 errors, 0 warnings
- 175 files, 24.741 lines of code
This commit is contained in:
Z User committed 2026-10-27 12:23:32 +00:00
1 parent 969202764a
commit fa8dd46571
175 files changed
+24741 -2

No files matched your search

+91
View File
@@ -0,0 +1,91 @@
'use client'
import { useAos } from '@/store/aos'
import { SidebarNav } from './sidebar-nav'
import { TopBar } from './top-bar'
import { Footer } from './footer'
import { CommandMenu } from './command-menu'
import { CompanyDrawer } from './company-drawer'
import { Sheet, SheetContent, SheetTitle } from '@/components/ui/sheet'
import { DashboardView } from './views/dashboard'
import { CalendarView } from './views/calendar'
import { ReportingView } from './views/reporting'
import { CrmView } from './views/crm'
import { LeadsView } from './views/leads'
import { EstimatesView } from './views/estimates'
import { ProjectsView } from './views/projects'
import { TimesheetView } from './views/timesheet'
import { SupportView } from './views/support'
import { LicensesView } from './views/licenses'
import { ContractsView } from './views/contracts'
import { ExpensesView } from './views/expenses'
import { FinanceView } from './views/finance'
import { AccountingView } from './views/accounting'
import { AuditView } from './views/audit'
import { KbView } from './views/kb'
import { ApiView } from './views/api'
import { SettingsView } from './views/settings'
import { GlobalSettingsView } from './views/global-settings'
import { SetupWizardView } from './views/setup-wizard'
import { PortalShell } from './portal-shell'
import { OnboardingOverlay } from './onboarding-overlay'
import { MobileBottomNav } from './mobile-bottom-nav'
export function AppShell() {
const { view, sidebarOpen, setSidebarOpen, portalMode } = useAos()
// Portal mode renders a completely separate experience
if (portalMode) return <PortalShell />
return (
<div className="flex min-h-screen w-full bg-background">
{/* Desktop sidebar */}
<aside className="hidden w-64 shrink-0 border-r border-border md:block">
<div className="sticky top-0 h-screen">
<SidebarNav />
</div>
</aside>
{/* Mobile sidebar */}
<Sheet open={sidebarOpen} onOpenChange={setSidebarOpen}>
<SheetContent side="left" className="w-72 p-0">
<SheetTitle className="sr-only">Navigation</SheetTitle>
<SidebarNav />
</SheetContent>
</Sheet>
{/* Main */}
<div className="flex min-w-0 flex-1 flex-col">
<TopBar />
<main className="flex-1 pb-16 md:pb-0">
{view === 'dashboard' && <DashboardView />}
{view === 'calendar' && <CalendarView />}
{view === 'reporting' && <ReportingView />}
{view === 'crm' && <CrmView />}
{view === 'leads' && <LeadsView />}
{view === 'estimates' && <EstimatesView />}
{view === 'projects' && <ProjectsView />}
{view === 'timesheet' && <TimesheetView />}
{view === 'support' && <SupportView />}
{view === 'licenses' && <LicensesView />}
{view === 'contracts' && <ContractsView />}
{view === 'expenses' && <ExpensesView />}
{view === 'finance' && <FinanceView />}
{view === 'accounting' && <AccountingView />}
{view === 'audit' && <AuditView />}
{view === 'kb' && <KbView />}
{view === 'api' && <ApiView />}
{view === 'settings' && <SettingsView />}
{view === 'settings_global' && <GlobalSettingsView />}
{view === 'setup' && <SetupWizardView />}
</main>
<Footer />
</div>
<CommandMenu />
<CompanyDrawer />
<OnboardingOverlay />
<MobileBottomNav />
</div>
)
}