diff --git a/src/features/run/services.tsx b/src/features/run/services.tsx index 401e1d51b..15c5b2bf1 100644 --- a/src/features/run/services.tsx +++ b/src/features/run/services.tsx @@ -13,7 +13,7 @@ import type { RunConfig } from "@/platform/ipc"; import { useProject } from "@/platform/project"; import { projectLocation, useRemote } from "@/platform/remote"; import { tx, useT, useTxTemplate } from "@/platform/i18n"; -import { Button, EmptyState, T, showContextMenu } from "@/ui"; +import { Button, EmptyState, T, lazyComponent, showContextMenu } from "@/ui"; import type { MenuItem } from "@/ui"; import { toolWindowService, @@ -29,7 +29,6 @@ import { import { pickServices } from "./serviceImport"; import { CATEGORY_ORDER, categoryOf, commandLine, configIcon, KIND_OPTIONS, kindLabel } from "./configs"; import { openUrl } from "./navigate"; -import { SessionPanel } from "./RunView"; import { showApplicationUpdate } from "./applicationUpdate"; import { isUpdatable } from "./updatePolicies"; import { @@ -64,6 +63,8 @@ import { } from "./serviceOrder"; import styles from "./RunServices.module.css"; +const SessionPanel = lazyComponent(() => import("./RunView").then((m) => m.SessionPanel)); + export const RUN_PROVIDER = "runConfigurations"; const TYPE_PREFIX = "run:type:"; const CONFIG_PREFIX = "run:config:"; diff --git a/src/features/services/ServicesTree.debug.test.tsx b/src/features/services/ServicesTree.debug.test.tsx index 6387cb268..c31c2a278 100644 --- a/src/features/services/ServicesTree.debug.test.tsx +++ b/src/features/services/ServicesTree.debug.test.tsx @@ -231,7 +231,7 @@ it("shows the owning Run output for attached debugging and routes the controls t useDebugRunSessions.setState({ serviceSessions: [d] }); render(); select(); - expect(screen.getByRole("log")).toHaveTextContent("Maven application log"); + expect(await screen.findByRole("log")).toHaveTextContent("Maven application log"); // The console strip keeps only console controls: the window toolbar owns Run / Debug / Stop. const strip = within(screen.getByRole("toolbar", { name: "Run actions" })); expect(strip.queryByRole("button", { name: "Rerun" })).toBeNull(); diff --git a/src/features/vcs/DiffWindow.tsx b/src/features/vcs/DiffWindow.tsx index 2b804243a..a7666fce5 100644 --- a/src/features/vcs/DiffWindow.tsx +++ b/src/features/vcs/DiffWindow.tsx @@ -18,18 +18,19 @@ import { projectFolder, useProject } from "@/platform/project"; import { installDiffWindowSave } from "./diffWindowSave"; import { restoreRemote } from "@/platform/remote"; import { usePlatform } from "@/platform/platformInfo"; -import { Spinner, T, isPopupOpen } from "@/ui"; +import { Spinner, T, isPopupOpen, lazyComponent } from "@/ui"; import { ask, showError } from "@/workbench/messages"; import { editorService, notifications, provideEditorService, type OpenOptions } from "@/workbench/contributions"; import { OverlayHost } from "@/workbench/OverlayHost"; import { TitleBar } from "@/workbench/TitleBar"; import { WindowResizeHandles } from "@/workbench/WindowResizeHandles"; import { useApplyTheme, windowBackgroundHex } from "@/workbench/theme"; -import { DiffEditor } from "./DiffEditor"; import { DIFF_KIND, diffInput, diffTitle, openDiff, type DiffData, type DiffSide } from "./diffInput"; import { refreshNow, useVcs } from "./store"; import styles from "./common.module.css"; +const DiffEditor = lazyComponent(() => import("./DiffEditor").then((m) => m.DiffEditor)); + /** Opens `path` in the project window's editor (DiffEditor's "Jump to Source"). */ const OPEN_SOURCE = "openidea://diff/open-source"; /** Opens a diff in an editor tab of the project window (IDEA's "Show Diff in Editor Tab"). */ diff --git a/src/features/vcs/actions.tsx b/src/features/vcs/actions.tsx index 782f7a94b..d4fc88fae 100644 --- a/src/features/vcs/actions.tsx +++ b/src/features/vcs/actions.tsx @@ -65,7 +65,6 @@ import { tx } from "@/platform/i18n"; import { addToIgnore } from "./ignore"; import { hasFileHistory, showCurrentRevision, trackFileHistory } from "./fileRevisions"; -import { compareWithFileRevision } from "./FileRevisionChooser"; const VCS = "vcsAvailable"; const IN_COMMIT_WINDOW = "vcsAvailable && activeToolWindow == commit"; @@ -496,7 +495,10 @@ export function registerVcsActions(): () => void { icon: "diff", when: VCS, enabled: ({ arg }) => hasFileHistory(argPath(arg) ?? maybeEditorService()?.activePath()), - run: ({ arg }) => compareWithFileRevision(argPath(arg) ?? maybeEditorService()?.activePath()), + run: ({ arg }) => { + const path = argPath(arg) ?? maybeEditorService()?.activePath(); + void import("./FileRevisionChooser").then((m) => m.compareWithFileRevision(path)); + }, }, { id: "vcs.nextChange",