Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 9 additions & 19 deletions apps/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AuthCallbackView } from "./views/AuthCallbackView";
import { RootComposeRoute } from "./views/RootComposeView";
import { QuickCreateProjectProvider } from "./hooks/useQuickCreateProject";
import { ProviderCliHealthToasts } from "./components/provider-cli/ProviderCliHealthToasts";
import { AppRouteNavigationProvider } from "./components/ui/app-route-anchor";
import { RouteNavigationProvider } from "./components/ui/app-route-anchor";
import { useDesktopThemeSync } from "./hooks/useDesktopThemeSync";
import {
useDesktopUpdateAvailableToast,
Expand All @@ -14,7 +14,6 @@ import {
import { useWebSocket } from "./hooks/useWebSocket";
import {
APP_ROOT_ROUTE_PATH,
APP_SETTINGS_ROUTE_PATH,
AUTOMATIONS_ROUTE_PATH,
AUTH_CALLBACK_ROUTE_PATH,
DEVELOPMENT_REPLAY_ROUTE_PATH,
Expand All @@ -23,18 +22,18 @@ import {
PROJECT_WORKFLOWS_ROUTE_PATH,
PROJECTLESS_THREAD_DETAIL_ROUTE_PATH,
PROJECT_SETTINGS_ROUTE_PATH,
STANDALONE_APP_ROUTE_PATH,
SETTINGS_ROUTE_PATH,
THREAD_DETAIL_ROUTE_PATH,
WORKFLOW_RUN_AGENT_ROUTE_PATH,
WORKFLOW_RUN_ROUTE_PATH,
} from "./lib/app-route-paths";
} from "./lib/route-paths";

const ThreadDetailRoute = lazy(
() => import("./views/thread-detail/ThreadDetailRoute"),
);
const AppSettingsView = lazy(() =>
import("./views/AppSettingsView").then((m) => ({
default: m.AppSettingsView,
const SettingsView = lazy(() =>
import("./views/SettingsView").then((m) => ({
default: m.SettingsView,
})),
);
const AutomationsView = lazy(() =>
Expand All @@ -57,11 +56,6 @@ const InternalReplayListView = lazy(() =>
default: m.InternalReplayListView,
})),
);
const StandaloneAppView = lazy(() =>
import("./views/standalone-app/StandaloneAppView").then((m) => ({
default: m.StandaloneAppView,
})),
);
const WorkflowRunView = lazy(() =>
import("./views/workflow-run/WorkflowRunView").then((m) => ({
default: m.WorkflowRunView,
Expand All @@ -79,12 +73,8 @@ function AppRoutes() {
<Suspense fallback={null}>
<Routes>
<Route path={APP_ROOT_ROUTE_PATH} element={<RootComposeRoute />} />
<Route path={APP_SETTINGS_ROUTE_PATH} element={<AppSettingsView />} />
<Route path={SETTINGS_ROUTE_PATH} element={<SettingsView />} />
<Route path={AUTOMATIONS_ROUTE_PATH} element={<AutomationsView />} />
<Route
path={STANDALONE_APP_ROUTE_PATH}
element={<StandaloneAppView />}
/>
{import.meta.env.DEV ? (
<Route
path={DEVELOPMENT_REPLAY_ROUTE_PATH}
Expand Down Expand Up @@ -143,7 +133,7 @@ export function App() {

return (
<QuickCreateProjectProvider>
<AppRouteNavigationProvider>
<RouteNavigationProvider>
<ProviderCliHealthToasts />
<Routes>
<Route
Expand All @@ -152,7 +142,7 @@ export function App() {
/>
<Route path="*" element={<AppRoutes />} />
</Routes>
</AppRouteNavigationProvider>
</RouteNavigationProvider>
</QuickCreateProjectProvider>
);
}
173 changes: 0 additions & 173 deletions apps/app/src/components/app-viewer/AppViewer.tsx

This file was deleted.

24 changes: 4 additions & 20 deletions apps/app/src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ import {
import { useExperiments } from "@/hooks/queries/system-queries";
import { useWorkflowRun } from "@/hooks/queries/workflow-queries";
import {
useApp,
useThread,
useThreadDetailBootstrap,
} from "@/hooks/queries/thread-queries";
import { useAppRoute } from "@/hooks/useAppRoute";
import { useRouteState } from "@/hooks/useRouteState";
import { getThreadDisplayTitle } from "@/lib/thread-title";
import { applyResizeCursor, clearResizeCursor } from "@/lib/resizeCursor";
import { cn } from "@/lib/utils";
Expand All @@ -54,7 +53,7 @@ import {
getProjectArchivedRoutePath,
getProjectSettingsRoutePath,
getProjectWorkflowsRoutePath,
} from "@/lib/app-route-paths";
} from "@/lib/route-paths";
import { useQuickCreateProjectController } from "@/hooks/useQuickCreateProject";
import { useSetRootComposeProjectId } from "@/lib/root-compose-selection";
import { IframeDragGuardOverlay } from "@/lib/iframe-drag-guard";
Expand Down Expand Up @@ -393,16 +392,14 @@ export function AppLayout({ children }: AppLayoutProps) {
const {
projectId,
threadId,
applicationId,
workflowRunId,
isAppView,
isThreadView,
isArchivedView,
isWorkflowsView,
isWorkflowRunView,
isSettingsView,
isRootView,
} = useAppRoute();
} = useRouteState();
const sidebarNavigationQuery = useSidebarNavigation();
const projects = useMemo(
() => sidebarNavigationQuery.data?.projects.map(stripProjectThreads),
Expand Down Expand Up @@ -446,11 +443,6 @@ export function AppLayout({ children }: AppLayoutProps) {
: threadId
? `Thread ${threadId.slice(0, 8)}`
: "Thread";
// The standalone app route has no thread/project chrome, so the global header
// carries the app name (resolved from the manifest) the way it carries thread
// and project titles elsewhere.
const { data: app } = useApp(applicationId, { enabled: isAppView });
const appDisplayTitle = app?.name ?? "App";
// The run page route is projectless, so the run row (shared query with the
// page itself) is the only synchronous source for the document title.
const { data: workflowRun } = useWorkflowRun(
Expand All @@ -465,12 +457,7 @@ export function AppLayout({ children }: AppLayoutProps) {
title: thread ? getThreadDisplayTitle(thread) : "Thread",
subtitle: undefined,
}
: isAppView
? {
title: appDisplayTitle,
subtitle: undefined,
}
: isArchivedView && projectId
: isArchivedView && projectId
? {
title: "",
subtitle: undefined,
Expand Down Expand Up @@ -517,9 +504,6 @@ export function AppLayout({ children }: AppLayoutProps) {
if (isThreadView) {
return threadDisplayTitle;
}
if (isAppView) {
return appDisplayTitle;
}
if (isArchivedView && projectId) {
return `${projectLabel ?? projectId} · Archived`;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/project/ProjectActionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { usePathPickerHost } from "@/hooks/useLocalPathPicker";
import {
getProjectArchivedRoutePath,
getProjectSettingsRoutePath,
} from "@/lib/app-route-paths";
} from "@/lib/route-paths";
import { cn } from "@/lib/utils";
import { useProjectActions } from "./ProjectActionsProvider";

Expand Down
6 changes: 3 additions & 3 deletions apps/app/src/components/project/ProjectActionsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { useSetAtom } from "jotai";
import { useNavigate } from "react-router-dom";
import type { ProjectResponse } from "@bb/server-contract";
import { useAppRoute } from "@/hooks/useAppRoute";
import { useRouteState } from "@/hooks/useRouteState";
import {
useAddLocalProjectSource,
useDeleteProject,
Expand All @@ -29,7 +29,7 @@ import {
type ProjectRenameDialogTarget,
} from "@/components/dialogs/ProjectRenameDialog";
import { collapsedProjectIdsAtom } from "@/components/sidebar/sidebarCollapsedAtoms";
import { getRootComposeRoutePath } from "@/lib/app-route-paths";
import { getRootComposeRoutePath } from "@/lib/route-paths";

export interface ProjectActionsContextValue {
requestRename: (project: ProjectResponse) => void;
Expand Down Expand Up @@ -59,7 +59,7 @@ export function ProjectActionsProvider({
children,
}: ProjectActionsProviderProps) {
const navigate = useNavigate();
const { projectId: routeProjectId } = useAppRoute();
const { projectId: routeProjectId } = useRouteState();
const setCollapsedProjectIdList = useSetAtom(collapsedProjectIdsAtom);
const updateProject = useUpdateProject();
const deleteProject = useDeleteProject();
Expand Down
Loading
Loading