Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
0408dd7
Update singletons.ts to builder function and export React Context
franknoirot Jan 16, 2026
e68205d
Fix tsc errors in App.tsx by using useSingletons hook instead of dire…
franknoirot Jan 16, 2026
9b751a2
Fix tsc errors in Auth.tsx by using useSingletons hook instead of dir…
franknoirot Jan 16, 2026
1fbafdb
Fix tsc errors in ClientSideSceneComp.tsx by using useSingletons hook…
franknoirot Jan 16, 2026
8550f74
Fix tsc errors in AppHeader.tsx by using useSingletons hook instead o…
franknoirot Jan 16, 2026
2a108bf
Fix tsc errors in AstExplorer.tsx by using useSingletons hook instead…
franknoirot Jan 16, 2026
91fab32
Fix tsc errors in CommandArgOptionInput.tsx by using useSingletons ho…
franknoirot Jan 16, 2026
b319ed6
Fix tsc errors in CommandBar.tsx by using useSingletons hook instead …
franknoirot Jan 16, 2026
eb879ad
Fix tsc errors in CommandBarArgument.tsx
franknoirot Jan 16, 2026
6b49d19
Fix tsc errors in CommandBarBasicInput.tsx by using useSingletons hoo…
franknoirot Jan 16, 2026
a8adde6
Fix tsc errors in CommandBarHeaderFooter.tsx by using useSingletons h…
franknoirot Jan 16, 2026
9afbb5b
Fix tsc errors in CommandBarKclInput.tsx by using useSingletons hook …
franknoirot Jan 16, 2026
d3d7420
Fix tsc errors in CommandBarPathInput.tsx by using useSingletons hook…
franknoirot Jan 16, 2026
4dd0acd
Fix tsc errors in CommandBarReview.tsx by using useSingletons hook in…
franknoirot Jan 16, 2026
c80028f
Fix tsc errors in CommandBarSelectionInput.tsx by using useSingletons…
franknoirot Jan 16, 2026
cf4856f
Fix tsc errors in CommandBarSelectionMixedInput.tsx by using useSingl…
franknoirot Jan 16, 2026
8e4a58f
Fix tsc errors in CommandBarSelectionMixedInput.spec.tsx by using use…
franknoirot Jan 16, 2026
a4b7cde
Fix tsc errors in CommandBarTextareaInput.tsx by using useSingletons …
franknoirot Jan 16, 2026
94e0d57
Fix tsc errors in CommandBarVector2DInput.tsx by using useSingletons …
franknoirot Jan 16, 2026
12a48c8
Fix tsc errors in CommandBarVector3DInput.tsx by using useSingletons …
franknoirot Jan 16, 2026
f1a40c3
Fix tsc errors in Toolbar.tsx
franknoirot Jan 16, 2026
341f775
Fix tsc errors in CommandBarOpenButton.tsx by using useSingletons hoo…
franknoirot Jan 16, 2026
5624272
Fix tsc errors in CommandComboBox.tsx by using useSingletons hook ins…
franknoirot Jan 16, 2026
5ec01cf
Fix tsc errors in SignIn.tsx
franknoirot Jan 16, 2026
aed0564
Fix tsc errors in ConnectionStream.tsx by using useSingletons hook in…
franknoirot Jan 16, 2026
3883334
Fix tsc errors in Onboarding/utils.tsx
franknoirot Jan 16, 2026
c8e3ccc
Fix tsc errors in DesktopOnboardingRoutes.tsx
franknoirot Jan 16, 2026
70a98f7
Fix tsc errors in DebugArtifactGraph.tsx by using useSingletons hook …
franknoirot Jan 16, 2026
7e9b6a4
Fix tsc errors in BrowserOnboardingRoutes.tsx
franknoirot Jan 16, 2026
c739b43
Fix tsc errors in DebugSelections.tsx
franknoirot Jan 16, 2026
f9bf4fc
Fix tsc errors in Home.tsx
franknoirot Jan 16, 2026
79d6a64
Fix tsc errors in EngineCommands.tsx
franknoirot Jan 16, 2026
e2134ae
Fix tsc errors in Environment.tsx
franknoirot Jan 16, 2026
74e37ed
Fix tsc errors in ExperimentalFeaturesMenu.tsx
franknoirot Jan 16, 2026
3561bc8
Fix tsc errors in ProjectExplorer.tsx
franknoirot Jan 16, 2026
e5b1881
Fix tsc errors in AxisGizmo.tsx
franknoirot Jan 16, 2026
2315262
Fix tsc errors in CubeGizmo.tsx
franknoirot Jan 16, 2026
3615d1b
Fix tsc errors in Gizmo.tsx
franknoirot Jan 16, 2026
fe7dc23
Fix tsc errors in HelpMenu.tsx
franknoirot Jan 16, 2026
799e757
Fix tsc errors in FeatureTreeMenu.tsx
franknoirot Jan 16, 2026
89b1dc4
Fix tsc errors in FeatureTreePane.tsx
franknoirot Jan 16, 2026
26af536
Fix tsc errors in KclEditorPane.tsx
franknoirot Jan 16, 2026
cb4202e
Fix tsc errors in LoggingPanes.tsx
franknoirot Jan 16, 2026
023e955
Fix tsc errors in MemoryPane.tsx
franknoirot Jan 17, 2026
fd2fba0
Fix tsc errors in Root.tsx
franknoirot Jan 17, 2026
4c44c42
Fix tsc errors in register.ts and ModelingPageProvider.tsx
franknoirot Jan 17, 2026
9876a84
Fix tsc errors in useAuthNavigation.tsx
franknoirot Jan 17, 2026
aab6a5c
Fix tsc errors in useOnPageIdle.tsx
franknoirot Jan 17, 2026
06e55cf
Fix tsc errors in useMenu.ts
franknoirot Jan 17, 2026
2e3a5d8
Fix tsc errors in useProjectsLoader
franknoirot Jan 17, 2026
2706bb7
Fix tsc errors in useQueryParamEffects.ts
franknoirot Jan 17, 2026
5387fc7
Fix tsc errors in useReliesOnEngine.tsx
franknoirot Jan 17, 2026
9aece22
Fix tsc errors in useResolvedTheme.ts
franknoirot Jan 17, 2026
dee0bad
Fix tsc errors in useStateMachineCommands.ts
franknoirot Jan 17, 2026
a9ce169
Fix tsc errors in usePreviousVarMentions.ts
franknoirot Jan 17, 2026
c56747a
Fix tsc errors in ZookeeperCreditsMenu.tsx
franknoirot Jan 17, 2026
a30a874
Fix tsc errors in UserSidebarMenu.tsx
franknoirot Jan 17, 2026
f5e542d
Fix tsc errors in UnitsMenu.tsx
franknoirot Jan 17, 2026
cc258e1
Fix tsc errors in ShareButton.tsx
franknoirot Jan 17, 2026
fb6bd15
Fix tsc errors in SetHorVertDistanceModal.tsx
franknoirot Jan 17, 2026
b8ee5bd
Fix tsc errors in LspProvider.tsx
franknoirot Jan 17, 2026
a46403c
Fix tsc errors in MachineManagerProvider.tsx
franknoirot Jan 17, 2026
e02e00a
Fix tsc errors in SettingsSectionsList.tsx
franknoirot Jan 17, 2026
a25f0e7
Fix tsc errors in SettingsSearchBar.tsx
franknoirot Jan 17, 2026
b99847e
Fix tsc errors in SettingsFieldInput.tsx
franknoirot Jan 17, 2026
54a3ba5
Fix tsc errors in AllSettingsFields.tsx
franknoirot Jan 17, 2026
f47f3a9
Fix tsc errors in MlEphantConversation.tsx
franknoirot Jan 17, 2026
9c6dbee
Fix tsc errors in App.tsx
franknoirot Jan 17, 2026
fee3b72
Fix tsc errors in Router.tsx
franknoirot Jan 17, 2026
725e13c
Fix tsc errors in Toolbar.tsx
franknoirot Jan 17, 2026
e31cc89
Fix tsc errors in ClientSideSceneComp.tsx
franknoirot Jan 17, 2026
d3499c1
Fix tsc errors in ModelingMachineProvider.tsx
franknoirot Jan 17, 2026
d388451
Fix tsc errors in ModelingPageProvider.tsx
franknoirot Jan 17, 2026
e80118f
Fix tsc errors in OpenInDesktopAppHandler.tsx
franknoirot Jan 17, 2026
eb71ca7
Fix tsc errors in ProjectSidebarMenu.tsx
franknoirot Jan 17, 2026
d44da72
Fix tsc errors in SystemIOProviderDesktop.tsx
franknoirot Jan 17, 2026
7c6b1cf
Fix tsc errors in SystemIOProviderWeb.tsx
franknoirot Jan 17, 2026
7e7ca33
Fix tsc errors in RouteProvider.tsx
franknoirot Jan 17, 2026
b0e5eac
Fix tsc errors in SetAngleLengthModal.tsx
franknoirot Jan 17, 2026
2756462
Fix tsc errors in SetVarNameModal.tsx
franknoirot Jan 17, 2026
024f300
Fix tsc errors in ViewControlMenu.tsx
franknoirot Jan 17, 2026
993e1bd
Fix tsc errors in MlEphantConversationPaneWrapper.tsx
franknoirot Jan 17, 2026
89642df
Fix tsc errors in ProjectExplorerPane.tsx
franknoirot Jan 17, 2026
2d76410
Fix tsc errors in manager.spec.ts
franknoirot Jan 17, 2026
338b539
Fix tsc errors in useOnPageMounted.spec.tsx
franknoirot Jan 17, 2026
1e8310f
Fix tsc errors in useTryConnect.tsx
franknoirot Jan 17, 2026
9ca26e4
Fix tsc errors in index.tsx
franknoirot Jan 17, 2026
27ba688
Fix tsc errors in applicationCommandConfig.ts
franknoirot Jan 17, 2026
bca8cab
Fix tsc errors in namedViewsConfig.ts
franknoirot Jan 17, 2026
0efe21e
Fix tsc errors in toolbar.ts
franknoirot Jan 17, 2026
3cd07a9
Fix tsc errors in hooks.ts
franknoirot Jan 17, 2026
7e61cc0
Fix tsc errors in Home.tsx
franknoirot Jan 17, 2026
47c5488
Fix tsc errors in setupTests.ts
franknoirot Jan 17, 2026
d4b5221
Fix lints
franknoirot Jan 17, 2026
2b86b66
More tsc/lint cleanup
franknoirot Jan 17, 2026
7f026de
Rework to use a class so we can start deReacting this stuff a bit
franknoirot Jan 17, 2026
c5b8f6e
Rebase fixes
franknoirot Jan 17, 2026
23eebab
Convert to an App class, import useSingletons from index.tsx
franknoirot Jan 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,7 @@ import useHotkeyWrapper from '@src/lib/hotkeyWrapper'
import { isDesktop } from '@src/lib/isDesktop'
import { PATHS } from '@src/lib/paths'
import { getSelectionTypeDisplayText } from '@src/lib/selections'
import {
billingActor,
systemIOActor,
getSettings,
kclManager,
useLayout,
setLayout,
getLayout,
} from '@src/lib/singletons'
import { useSettings, useToken } from '@src/lib/singletons'
import { useSingletons } from '@src/index'
import { maybeWriteToDisk } from '@src/lib/telemetry'
import { reportRejection } from '@src/lib/trap'
import type { IndexLoaderData } from '@src/lib/types'
Expand All @@ -63,8 +54,8 @@ import {
getOpenPanes,
LayoutRootNode,
} from '@src/lib/layout'
import { defaultAreaLibrary } from '@src/lib/layout/defaultAreaLibrary'
import { defaultActionLibrary } from '@src/lib/layout/defaultActionLibrary'
import { useDefaultAreaLibrary } from '@src/lib/layout/defaultAreaLibrary'
import { useDefaultActionLibrary } from '@src/lib/layout/defaultActionLibrary'
import { getResolvedTheme } from '@src/lib/theme'
import {
MlEphantManagerReactContext,
Expand All @@ -82,6 +73,19 @@ if (window.electron) {
}

export function App() {
const {
billingActor,
systemIOActor,
getSettings,
kclManager,
useLayout,
setLayout,
getLayout,
useSettings,
useToken,
} = useSingletons()
const defaultAreaLibrary = useDefaultAreaLibrary()
const defaultActionLibrary = useDefaultActionLibrary()
const { state: modelingState } = useModelingContext()
useQueryParamEffects(kclManager)
const loaderData = useLoaderData<IndexLoaderData>()
Expand Down Expand Up @@ -113,7 +117,7 @@ export function App() {
return
void kclManager.executeCode()
kclManager.mlEphantManagerMachineBulkManipulatingFileSystem = false
}, [systemIOState])
}, [systemIOState, kclManager])

// Run LSP file open hook when navigating between projects or files
useEffect(() => {
Expand Down Expand Up @@ -207,6 +211,7 @@ export function App() {
kclManager,
theme: getResolvedTheme(settings.app.theme.current),
accountUrl: withSiteBaseURL('/account'),
systemIOActor,
}),
{
id: ONBOARDING_TOAST_ID,
Expand All @@ -223,6 +228,8 @@ export function App() {
navigate,
searchParams.size,
authToken,
kclManager,
systemIOActor,
])

// This is, at time of writing, the only spot we need @preact/signals-react,
Expand Down Expand Up @@ -297,7 +304,7 @@ export function App() {
className="flex items-center px-2 border-x border-chalkboard-30 dark:border-chalkboard-80"
/>
),
[]
[kclManager]
)

const notifications: boolean[] = Object.values(defaultAreaLibrary).map(
Expand Down
3 changes: 2 additions & 1 deletion src/Auth.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Loading from '@src/components/Loading'
import { useAuthState } from '@src/lib/singletons'
import { useSingletons } from '@src/index'

// Wrapper around protected routes, used in src/Router.tsx
export const Auth = ({ children }: React.PropsWithChildren) => {
const { useAuthState } = useSingletons()
const authState = useAuthState()
const isLoggingIn = authState.matches('checkIfLoggedIn')

Expand Down
3 changes: 2 additions & 1 deletion src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import { RouteProvider } from '@src/components/RouteProvider'
import { isDesktop } from '@src/lib/isDesktop'
import { Outlet } from 'react-router-dom'
import { MlEphantManagerReactContext } from '@src/machines/mlEphantManagerMachine'
import { useToken } from '@src/lib/singletons'
import { useSingletons } from '@src/index'

// Root component will live for the entire applications runtime
// This is a great place to add polling code.
function RootLayout() {
const { useToken } = useSingletons()
// Many providers need at the very least a Zoo API token to work.
// We can provide that here.
const apiToken = useToken()
Expand Down
Loading