chore: filemachineprovider still has useful code, it is now modelingpageprovider

This commit is contained in:
Kevin
2025-06-25 10:15:25 -05:00
parent 9b90c98fb4
commit 4d7623bca8
2 changed files with 12 additions and 16 deletions

View File

@ -12,7 +12,7 @@ import { App } from '@src/App'
import { Auth } from '@src/Auth' import { Auth } from '@src/Auth'
import { CommandBar } from '@src/components/CommandBar/CommandBar' import { CommandBar } from '@src/components/CommandBar/CommandBar'
import { ErrorPage } from '@src/components/ErrorPage' import { ErrorPage } from '@src/components/ErrorPage'
import FileMachineProvider from '@src/components/FileMachineProvider' import ModelingPageProvider from '@src/components/ModelingPageProvider'
import ModelingMachineProvider from '@src/components/ModelingMachineProvider' import ModelingMachineProvider from '@src/components/ModelingMachineProvider'
import { NetworkContext } from '@src/hooks/useNetworkContext' import { NetworkContext } from '@src/hooks/useNetworkContext'
import { useNetworkStatus } from '@src/hooks/useNetworkStatus' import { useNetworkStatus } from '@src/hooks/useNetworkStatus'
@ -76,14 +76,14 @@ const router = createRouter([
errorElement: <ErrorPage />, errorElement: <ErrorPage />,
element: ( element: (
<Auth> <Auth>
<FileMachineProvider> <ModelingPageProvider>
<ModelingMachineProvider> <ModelingMachineProvider>
<CoreDump /> <CoreDump />
<Outlet /> <Outlet />
<App /> <App />
<CommandBar /> <CommandBar />
</ModelingMachineProvider> </ModelingMachineProvider>
</FileMachineProvider> </ModelingPageProvider>
</Auth> </Auth>
), ),
children: [ children: [

View File

@ -16,7 +16,13 @@ import { useSettings, useToken } from '@src/lib/singletons'
import { commandBarActor } from '@src/lib/singletons' import { commandBarActor } from '@src/lib/singletons'
import { modelingMenuCallbackMostActions } from '@src/menu/register' import { modelingMenuCallbackMostActions } from '@src/menu/register'
export const FileMachineProvider = ({ /**
* FileMachineProvider moved to ModelingPageProvider.
* This is a root provider for the modeling page to initialize any react code required for the run
* time of the modeling page.
*/
export const ModelingPageProvider = ({
children, children,
}: { }: {
children: React.ReactNode children: React.ReactNode
@ -63,7 +69,7 @@ export const FileMachineProvider = ({
markOnce('code/didLoadFile') markOnce('code/didLoadFile')
}, []) }, [])
// Due to the route provider, i've moved this to the FileMachineProvider instead of CommandBarProvider // Due to the route provider, i've moved this to the ModelingPageProvider instead of CommandBarProvider
// This will register the commands to route to Telemetry, Home, and Settings. // This will register the commands to route to Telemetry, Home, and Settings.
useEffect(() => { useEffect(() => {
const filePath = const filePath =
@ -97,16 +103,6 @@ export const FileMachineProvider = ({
}, },
}) })
} }
// TODO: KEVIN DELETE
// // GOTCHA: If we call navigate() while in the /file route the fileMachineProvider
// // has a context.project of the original one that was loaded. It does not update
// // Watch when the navigation changes, if it changes set a new Project within the fileMachine
// // to load the latest state of the project you are in.
// if (project) {
// // TODO: Clean this up with global application state when fileMachine gets merged into SystemIOMachine
// send({ type: 'Refresh with new project', data: { project } })
// }
}, [location]) }, [location])
const cb = modelingMenuCallbackMostActions( const cb = modelingMenuCallbackMostActions(
@ -176,4 +172,4 @@ export const FileMachineProvider = ({
return <div>{children}</div> return <div>{children}</div>
} }
export default FileMachineProvider export default ModelingPageProvider