Feature/v2/automate (#4248)

* automate feature
* Moved all providers to app level to simplify homepage 
* Circular dependency fixes
* You will see that now toolRegistry gets a tool config and a tool
settings object. These enable automate to run the tools using as much
static code as possible.

---------

Co-authored-by: Connor Yoh <[email protected]>
This commit is contained in:
ConnorYoh
2025-08-22 14:40:27 +01:00
committed by GitHub
co-authored by Connor Yoh
parent 7d9c0b0298
commit 23d86deae7
84 changed files with 4784 additions and 572 deletions
+3 -28
View File
@@ -1,10 +1,8 @@
import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { useFileActions, useFileSelection } from "../contexts/FileContext";
import { useNavigationActions } from "../contexts/NavigationContext";
import { ToolWorkflowProvider, useToolWorkflow } from "../contexts/ToolWorkflowContext";
import { useToolWorkflow } from "../contexts/ToolWorkflowContext";
import { Group } from "@mantine/core";
import { SidebarProvider, useSidebarContext } from "../contexts/SidebarContext";
import { useSidebarContext } from "../contexts/SidebarContext";
import { useDocumentMeta } from "../hooks/useDocumentMeta";
import { getBaseUrl } from "../constants/app";
@@ -14,7 +12,7 @@ import QuickAccessBar from "../components/shared/QuickAccessBar";
import FileManager from "../components/FileManager";
function HomePageContent() {
export default function HomePage() {
const { t } = useTranslation();
const {
sidebarRefs,
@@ -22,8 +20,6 @@ function HomePageContent() {
const { quickAccessRef } = sidebarRefs;
const { setSelectedFiles } = useFileSelection();
const { selectedTool, selectedToolKey } = useToolWorkflow();
const baseUrl = getBaseUrl();
@@ -54,24 +50,3 @@ function HomePageContent() {
</Group>
);
}
function HomePageWithProviders() {
const { actions } = useNavigationActions();
// Wrapper to convert string to ModeType
const handleViewChange = (view: string) => {
actions.setMode(view as any); // ToolWorkflowContext should validate this
};
return (
<ToolWorkflowProvider onViewChange={handleViewChange}>
<SidebarProvider>
<HomePageContent />
</SidebarProvider>
</ToolWorkflowProvider>
);
}
export default function HomePage() {
return <HomePageWithProviders />;
}