1- import { Router , useCurrentMatches } from "@solidjs/router" ;
2- import { FileRoutes } from "@solidjs/start/router" ;
1+ import { Route , Router , useCurrentMatches } from "@solidjs/router" ;
32import { QueryClient , QueryClientProvider } from "@tanstack/solid-query" ;
43import {
54 getCurrentWebviewWindow ,
65 type WebviewWindow ,
76} from "@tauri-apps/api/webviewWindow" ;
87import { message } from "@tauri-apps/plugin-dialog" ;
9- import { createEffect , onCleanup , onMount , Suspense } from "solid-js" ;
8+ import { createEffect , lazy , onCleanup , onMount , Suspense } from "solid-js" ;
109import { Toaster } from "solid-toast" ;
1110
1211import "@cap/ui-solid/main.css" ;
@@ -19,6 +18,35 @@ import { initAnonymousUser } from "./utils/analytics";
1918import { type AppTheme , commands } from "./utils/tauri" ;
2019import titlebar from "./utils/titlebar-state" ;
2120
21+ const WindowChromeLayout = lazy ( ( ) => import ( "./routes/(window-chrome)" ) ) ;
22+ const MainPage = lazy ( ( ) => import ( "./routes/(window-chrome)/(main)" ) ) ;
23+ const NewMainPage = lazy ( ( ) => import ( "./routes/(window-chrome)/new-main" ) ) ;
24+ const SetupPage = lazy ( ( ) => import ( "./routes/(window-chrome)/setup" ) ) ;
25+ const SettingsLayout = lazy ( ( ) => import ( "./routes/(window-chrome)/settings" ) ) ;
26+ const SettingsGeneralPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/general" ) ) ;
27+ const SettingsRecordingsPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/recordings" ) ) ;
28+ const SettingsScreenshotsPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/screenshots" ) ) ;
29+ const SettingsHotkeysPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/hotkeys" ) ) ;
30+ const SettingsChangelogPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/changelog" ) ) ;
31+ const SettingsFeedbackPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/feedback" ) ) ;
32+ const SettingsExperimentalPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/experimental" ) ) ;
33+ const SettingsLicensePage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/license" ) ) ;
34+ const SettingsIntegrationsPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/integrations" ) ) ;
35+ const SettingsS3ConfigPage = lazy ( ( ) => import ( "./routes/(window-chrome)/settings/integrations/s3-config" ) ) ;
36+ const UpgradePage = lazy ( ( ) => import ( "./routes/(window-chrome)/upgrade" ) ) ;
37+ const UpdatePage = lazy ( ( ) => import ( "./routes/(window-chrome)/update" ) ) ;
38+ const CameraPage = lazy ( ( ) => import ( "./routes/camera" ) ) ;
39+ const CaptureAreaPage = lazy ( ( ) => import ( "./routes/capture-area" ) ) ;
40+ const DebugPage = lazy ( ( ) => import ( "./routes/debug" ) ) ;
41+ const EditorPage = lazy ( ( ) => import ( "./routes/editor" ) ) ;
42+ const InProgressRecordingPage = lazy ( ( ) => import ( "./routes/in-progress-recording" ) ) ;
43+ const ModeSelectPage = lazy ( ( ) => import ( "./routes/mode-select" ) ) ;
44+ const NotificationsPage = lazy ( ( ) => import ( "./routes/notifications" ) ) ;
45+ const RecordingsOverlayPage = lazy ( ( ) => import ( "./routes/recordings-overlay" ) ) ;
46+ const ScreenshotEditorPage = lazy ( ( ) => import ( "./routes/screenshot-editor" ) ) ;
47+ const TargetSelectOverlayPage = lazy ( ( ) => import ( "./routes/target-select-overlay" ) ) ;
48+ const WindowCaptureOccluderPage = lazy ( ( ) => import ( "./routes/window-capture-occluder" ) ) ;
49+
2250const queryClient = new QueryClient ( {
2351 defaultOptions : {
2452 queries : {
@@ -35,6 +63,9 @@ const queryClient = new QueryClient({
3563} ) ;
3664
3765export default function App ( ) {
66+ // #region agent log
67+ fetch ( 'http://127.0.0.1:7243/ingest/1cff95e2-fcb2-4b1f-a666-2aa2ac4f0e23' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'App.tsx:App' , message :'App component rendering' , data :{ pathname :location . pathname } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'C' } ) } ) . catch ( ( ) => { } ) ;
68+ // #endregion
3869 return (
3970 < QueryClientProvider client = { queryClient } >
4071 < Suspense >
@@ -45,10 +76,16 @@ export default function App() {
4576}
4677
4778function Inner ( ) {
79+ // #region agent log
80+ fetch ( 'http://127.0.0.1:7243/ingest/1cff95e2-fcb2-4b1f-a666-2aa2ac4f0e23' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'App.tsx:Inner' , message :'Inner component rendering' , data :{ pathname :location . pathname } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'C' } ) } ) . catch ( ( ) => { } ) ;
81+ // #endregion
4882 const currentWindow = getCurrentWebviewWindow ( ) ;
4983 createThemeListener ( currentWindow ) ;
5084
5185 onMount ( ( ) => {
86+ // #region agent log
87+ fetch ( 'http://127.0.0.1:7243/ingest/1cff95e2-fcb2-4b1f-a666-2aa2ac4f0e23' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'App.tsx:Inner:onMount' , message :'Inner onMount' , data :{ pathname :location . pathname } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'C' } ) } ) . catch ( ( ) => { } ) ;
88+ // #endregion
5289 initAnonymousUser ( ) ;
5390 } ) ;
5491
@@ -78,6 +115,9 @@ function Inner() {
78115 const matches = useCurrentMatches ( ) ;
79116
80117 onMount ( ( ) => {
118+ // #region agent log
119+ fetch ( 'http://127.0.0.1:7243/ingest/1cff95e2-fcb2-4b1f-a666-2aa2ac4f0e23' , { method :'POST' , headers :{ 'Content-Type' :'application/json' } , body :JSON . stringify ( { location :'App.tsx:Router:root:onMount' , message :'Router root onMount' , data :{ pathname :location . pathname , matchCount :matches ( ) . length , autoShowFlags :matches ( ) . map ( m => m . route . info ?. AUTO_SHOW_WINDOW ) } , timestamp :Date . now ( ) , sessionId :'debug-session' , hypothesisId :'C,D' } ) } ) . catch ( ( ) => { } ) ;
120+ // #endregion
81121 for ( const match of matches ( ) ) {
82122 if ( match . route . info ?. AUTO_SHOW_WINDOW === false ) return ;
83123 }
@@ -98,7 +138,37 @@ function Inner() {
98138 ) ;
99139 } }
100140 >
101- < FileRoutes />
141+ < Route path = "/" component = { WindowChromeLayout } >
142+ < Route path = "/" component = { MainPage } />
143+ < Route path = "/new-main" component = { NewMainPage } />
144+ < Route path = "/setup" component = { SetupPage } />
145+ < Route path = "/settings" component = { SettingsLayout } >
146+ < Route path = "/" component = { SettingsGeneralPage } />
147+ < Route path = "/general" component = { SettingsGeneralPage } />
148+ < Route path = "/recordings" component = { SettingsRecordingsPage } />
149+ < Route path = "/screenshots" component = { SettingsScreenshotsPage } />
150+ < Route path = "/hotkeys" component = { SettingsHotkeysPage } />
151+ < Route path = "/changelog" component = { SettingsChangelogPage } />
152+ < Route path = "/feedback" component = { SettingsFeedbackPage } />
153+ < Route path = "/experimental" component = { SettingsExperimentalPage } />
154+ < Route path = "/license" component = { SettingsLicensePage } />
155+ < Route path = "/integrations" component = { SettingsIntegrationsPage } />
156+ < Route path = "/integrations/s3-config" component = { SettingsS3ConfigPage } />
157+ </ Route >
158+ < Route path = "/upgrade" component = { UpgradePage } />
159+ < Route path = "/update" component = { UpdatePage } />
160+ </ Route >
161+ < Route path = "/camera" component = { CameraPage } />
162+ < Route path = "/capture-area" component = { CaptureAreaPage } />
163+ < Route path = "/debug" component = { DebugPage } />
164+ < Route path = "/editor" component = { EditorPage } />
165+ < Route path = "/in-progress-recording" component = { InProgressRecordingPage } />
166+ < Route path = "/mode-select" component = { ModeSelectPage } />
167+ < Route path = "/notifications" component = { NotificationsPage } />
168+ < Route path = "/recordings-overlay" component = { RecordingsOverlayPage } />
169+ < Route path = "/screenshot-editor" component = { ScreenshotEditorPage } />
170+ < Route path = "/target-select-overlay" component = { TargetSelectOverlayPage } />
171+ < Route path = "/window-capture-occluder" component = { WindowCaptureOccluderPage } />
102172 </ Router >
103173 </ CapErrorBoundary >
104174 </ >
0 commit comments