Файли
openidea/src/features/app/newProjectWindow.tsx
T
l0ng-ai 61b86f4f5e feat(ui): open New Project, Get from VCS and Remote Development in their own windows
Each dialog gets a native window over its project window: a full-height
sidebar under the traffic lights, the title heading the content and the
buttons in its corner. The windows hand their result back to the project
window, which opens the created or cloned project or makes the remote
connection and reports its progress. Remote windows and the browser build
keep the dialogs in the page.
2026-11-26 23:04:44 +08:00

28 рядки
1014 B
TypeScript

/**
* The New Project window (`new-project-<parent>`): the wizard in its own native window. The
* created project opens from the parent project window, which then has it (or a new window).
*/
import { emitTo } from "@tauri-apps/api/event";
import { closeDialogWindow, useDialogWindow } from "@/workbench/dialogWindow";
import { OverlayHost } from "@/workbench/OverlayHost";
import { useApplyTheme } from "@/workbench/theme";
import { WindowResizeHandles } from "@/workbench/WindowResizeHandles";
import { NEW_PROJECT_CREATED, NewProjectDialog } from "./NewProject";
export function NewProjectWindow() {
useApplyTheme();
const parent = useDialogWindow((s) => s.parent);
const created = async (dir: string) => {
if (!parent) return;
await emitTo(parent, NEW_PROJECT_CREATED, { dir });
closeDialogWindow();
};
return (
<>
{parent && <NewProjectDialog standalone onClose={closeDialogWindow} onCreated={created} />}
<OverlayHost />
<WindowResizeHandles />
</>
);
}