🙌 OpenHands: AI-Driven Development
feat(conversation): add overview panel and unified commits drawer (#16230)
FraterCCCLXIIId70cf83a334d
diff --git a/__tests__/components/features/chat/plan-preview.test.tsx b/__tests__/components/features/chat/plan-preview.test.tsxindex 6af94df2d4..c48a09c48d 100644--- a/__tests__/components/features/chat/plan-preview.test.tsx+++ b/__tests__/components/features/chat/plan-preview.test.tsx@@ -208,8 +208,7 @@ describe("PlanPreview", () => {await user.click(buildButton);// Assert- const pending =- useOptimisticUserMessageStore.getState().pendingMessages;+ const pending = useOptimisticUserMessageStore.getState().pendingMessages;expect(pending).toHaveLength(1);expect(pending[0].text).toBe(expectedPrompt);expect(pending[0].status).toBe("sending");@@ -381,9 +380,9 @@ describe("PlanPreview", () => {const viewButton = screen.getByTestId("plan-preview-view-button");await user.click(viewButton);- // Assert: selectTab was called with 'planner' and the drawer opened- // (in-memory). The drawer-open state is session-only and must not- // touch localStorage; only the selected tab persists.+ // Assert: selectTab was called with 'planner' and the drawer opened.+ // Opening the drawer also mirrors `rightPanelShown` into the+ // conversation's localStorage blob, alongside the selected tab.expect(useConversationStore.getState().selectedTab).toBe("planner");expect(useConversationStore.getState().hasRightPanelToggled).toBe(true);@@ -391,7 +390,7 @@ describe("PlanPreview", () => {localStorage.getItem(`conversation-state-${conversationId}`)!,);expect(storedState.selectedTab).toBe("planner");- expect(storedState).not.toHaveProperty("rightPanelShown");+ expect(storedState.rightPanelShown).toBe(true);});it("should call selectTab with 'planner' when Read more button is clicked", async () => {@@ -412,9 +411,9 @@ describe("PlanPreview", () => {const readMoreButton = screen.getByTestId("plan-preview-read-more-button");await user.click(readMoreButton);- // Assert: selectTab was called with 'planner' and the drawer opened- // (in-memory). The drawer-open state is session-only and must not- // touch localStorage; only the selected tab persists.+ // Assert: selectTab was called with 'planner' and the drawer opened.+ // Opening the drawer also mirrors `rightPanelShown` into the+ // conversation's localStorage blob, alongside the selected tab.expect(useConversationStore.getState().selectedTab).toBe("planner");expect(useConversationStore.getState().hasRightPanelToggled).toBe(true);@@ -422,6 +421,6 @@ describe("PlanPreview", () => {localStorage.getItem(`conversation-state-${conversationId}`)!,);expect(storedState.selectedTab).toBe("planner");- expect(storedState).not.toHaveProperty("rightPanelShown");+ expect(storedState.rightPanelShown).toBe(true);});});diff --git a/__tests__/components/features/conversation/chat-interface-wrapper.test.tsx b/__tests__/components/features/conversation/chat-interface-wrapper.test.tsxindex 9617e3fcb7..dd796ff599 100644--- a/__tests__/components/features/conversation/chat-interface-wrapper.test.tsx+++ b/__tests__/components/features/conversation/chat-interface-wrapper.test.tsx@@ -1,12 +1,39 @@import { render, screen } from "@testing-library/react";-import { describe, it, expect, vi } from "vitest";+import { describe, it, expect, vi, beforeEach } from "vitest";import { ChatInterfaceWrapper } from "#/components/features/conversation/conversation-main/chat-interface-wrapper";+import { useConversationStore } from "#/stores/conversation-store";vi.mock("#/components/features/chat/chat-interface", () => ({ChatInterface: () => <div data-testid="chat-interface" />,}));+vi.mock("#/components/features/conversation/conversation-overview-panel", () => ({+ ConversationOverviewPanel: () => (+ <div data-testid="conversation-overview-panel" />+ ),+}));++vi.mock("#/hooks/use-breakpoint", () => ({+ useBreakpoint: () => false,+}));++const mockUseConversationOverviewColumnSpace = vi.fn(() => true);++vi.mock("#/hooks/use-conversation-overview-column-space", () => ({+ useConversationOverviewColumnSpace: () =>+ mockUseConversationOverviewColumnSpace(),+}));+describe("ChatInterfaceWrapper", () => {+ beforeEach(() => {+ mockUseConversationOverviewColumnSpace.mockReturnValue(true);+ useConversationStore.setState({+ isOverviewPanelShown: false,+ isOverviewPanelPeeked: false,+ isRightPanelShown: false,+ });+ });+it("renders the chat interface when the right panel is hidden", () => {render(<ChatInterfaceWrapper isRightPanelShown={false} />);@@ -18,4 +45,38 @@ describe("ChatInterfaceWrapper", () => {expect(screen.getByTestId("chat-interface")).toBeInTheDocument();});++ it("uses the overview grid layout when space is available", () => {+ useConversationStore.setState({ isOverviewPanelShown: true });+ render(<ChatInterfaceWrapper isRightPanelShown={false} />);++ expect(screen.getByTestId("conversation-overview-column")).toBeInTheDocument();+ expect(screen.getByTestId("conversation-overview-panel")).toBeInTheDocument();+ });++ it("keeps the thread in a height-constrained flex column when overview is shown", () => {+ useConversationStore.setState({ isOverviewPanelShown: true });+ const { container } = render(+ <ChatInterfaceWrapper isRightPanelShown={false} />,+ );++ const threadColumn = container.querySelector(".overflow-hidden.flex-1");+ expect(threadColumn).toBeInTheDocument();+ expect(threadColumn).toHaveClass("min-h-0");+ });++ it("falls back to the centered thread layout when the right column is too narrow", () => {+ mockUseConversationOverviewColumnSpace.mockReturnValue(false);+ useConversationStore.setState({ isOverviewPanelShown: true });++ render(<ChatInterfaceWrapper isRightPanelShown={false} />);++ expect(+ screen.queryByTestId("conversation-overview-column"),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-panel"),+ ).not.toBeInTheDocument();+ expect(screen.getByTestId("chat-interface")).toBeInTheDocument();+ });});diff --git a/__tests__/components/features/conversation/conversation-git-actions-toggle.test.tsx b/__tests__/components/features/conversation/conversation-git-actions-toggle.test.tsxnew file mode 100644index 0000000000..679208430c--- /dev/null+++ b/__tests__/components/features/conversation/conversation-git-actions-toggle.test.tsx@@ -0,0 +1,84 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { beforeEach, describe, expect, it, vi } from "vitest";+import { ConversationGitActionsToggle } from "#/components/features/conversation/conversation-git-actions-toggle";+import { useConversationStore } from "#/stores/conversation-store";++const { breakpointIsMobile } = vi.hoisted(() => ({+ breakpointIsMobile: { value: false },+}));++vi.mock("#/hooks/use-breakpoint", () => ({+ useBreakpoint: () => breakpointIsMobile.value,+}));++vi.mock("#/hooks/use-is-archived-conversation", () => ({+ useIsArchivedConversation: () => false,+}));++vi.mock("#/hooks/query/use-active-conversation", () => ({+ useActiveConversation: () => ({+ data: {+ id: "conv-1",+ git_provider: "github",+ },+ }),+}));++describe("ConversationGitActionsToggle", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ breakpointIsMobile.value = false;+ useConversationStore.setState({ messageToSend: null });+ });++ it("stays visible on smaller screens", () => {+ breakpointIsMobile.value = true;++ render(<ConversationGitActionsToggle />);++ expect(+ screen.getByTestId("conversation-git-actions-toggle"),+ ).toBeInTheDocument();+ });++ it("opens a dropdown of git actions and fills the composer with prompts", async () => {+ const user = userEvent.setup();+ render(<ConversationGitActionsToggle />);++ await user.click(screen.getByTestId("conversation-git-actions-toggle"));++ await user.click(+ await screen.findByTestId("conversation-git-actions-commit"),+ );+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "commit",+ );++ await user.click(screen.getByTestId("conversation-git-actions-toggle"));+ await user.click(screen.getByTestId("conversation-git-actions-pull"));+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "pull",+ );++ await user.click(screen.getByTestId("conversation-git-actions-toggle"));+ await user.click(screen.getByTestId("conversation-git-actions-push"));+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "push",+ );++ await user.click(screen.getByTestId("conversation-git-actions-toggle"));+ await user.click(screen.getByTestId("conversation-git-actions-create-pr"));+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "pull request",+ );++ await user.click(screen.getByTestId("conversation-git-actions-toggle"));+ await user.click(+ screen.getByTestId("conversation-git-actions-create-new-branch"),+ );+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "new branch",+ );+ });+});diff --git a/__tests__/components/features/conversation/conversation-name-with-status.test.tsx b/__tests__/components/features/conversation/conversation-name-with-status.test.tsxindex 9cb41ff550..00f2b9ea4d 100644--- a/__tests__/components/features/conversation/conversation-name-with-status.test.tsx+++ b/__tests__/components/features/conversation/conversation-name-with-status.test.tsx@@ -30,6 +30,9 @@ vi.mock("#/hooks/query/use-active-conversation", () => ({vi.mock("#/hooks/use-conversation-id", () => ({useConversationId: () => ({ conversationId: "test-conversation-id" }),+ useOptionalConversationId: () => ({+ conversationId: "test-conversation-id",+ }),}));vi.mock("#/hooks/mutation/use-unified-stop-conversation", () => ({diff --git a/__tests__/components/features/conversation/conversation-overview-diffs-row.test.tsx b/__tests__/components/features/conversation/conversation-overview-diffs-row.test.tsxnew file mode 100644index 0000000000..9912d302f4--- /dev/null+++ b/__tests__/components/features/conversation/conversation-overview-diffs-row.test.tsx@@ -0,0 +1,140 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, it, expect, vi, beforeEach } from "vitest";+import { ConversationOverviewDiffsRow } from "#/components/features/conversation/conversation-overview-diffs-row";+import { useConversationStore } from "#/stores/conversation-store";++const navigateToTabMock = vi.fn();+const closeDrawerMock = vi.fn();++vi.mock("#/hooks/use-conversation-overview-git-diff-stats", () => ({+ useConversationOverviewGitDiffStats: () => ({+ additions: 12,+ deletions: 4,+ changeCount: 2,+ isLoading: false,+ isError: false,+ }),+}));++const navigateToChangesMock = vi.fn();++vi.mock("#/hooks/use-select-conversation-tab", () => ({+ useSelectConversationTab: () => ({+ navigateToTab: navigateToTabMock,+ navigateToChanges: navigateToChangesMock,+ }),+}));++vi.mock("#/hooks/query/use-active-conversation", () => ({+ useActiveConversation: () => ({+ data: {+ id: "conv-1",+ git_provider: "github",+ },+ }),+}));++vi.mock(+ "#/components/features/conversation/conversation-overview-drawer-context",+ () => ({+ useConversationOverviewDrawerOptional: () => ({+ section: "skills",+ openAdd: false,+ openSection: vi.fn(),+ closeDrawer: closeDrawerMock,+ }),+ }),+);++describe("ConversationOverviewDiffsRow", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ useConversationStore.setState({ messageToSend: null });+ });++ it("opens the git actions menu and sends commit, pull, push, and create PR prompts", async () => {+ const user = userEvent.setup();+ render(<ConversationOverviewDiffsRow />);++ await user.click(+ screen.getByTestId("conversation-overview-diffs-git-action"),+ );++ await user.click(+ await screen.findByTestId("conversation-overview-diffs-git-commit"),+ );+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "commit",+ );++ await user.click(+ screen.getByTestId("conversation-overview-diffs-git-action"),+ );+ await user.click(screen.getByTestId("conversation-overview-diffs-git-pull"));+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "pull",+ );++ await user.click(+ screen.getByTestId("conversation-overview-diffs-git-action"),+ );+ await user.click(screen.getByTestId("conversation-overview-diffs-git-push"));+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "push",+ );++ await user.click(+ screen.getByTestId("conversation-overview-diffs-git-action"),+ );+ await user.click(+ screen.getByTestId("conversation-overview-diffs-git-create-pr"),+ );+ expect(useConversationStore.getState().messageToSend?.text).toContain(+ "pull request",+ );+ });++ it("keeps diff numbers hidden while the git menu is open", async () => {+ const user = userEvent.setup();+ render(<ConversationOverviewDiffsRow />);++ const stats = screen.getByTestId(+ "conversation-overview-diffs-additions",+ ).parentElement;++ await user.click(+ screen.getByTestId("conversation-overview-diffs-git-action"),+ );++ expect(stats).toHaveClass("opacity-0");+ });++ it("opens Diff view and closes open drawers when the changes label is clicked", async () => {+ const user = userEvent.setup();+ render(<ConversationOverviewDiffsRow />);++ await user.click(screen.getByTestId("conversation-overview-diffs"));++ expect(closeDrawerMock).toHaveBeenCalled();+ expect(navigateToChangesMock).toHaveBeenCalled();+ expect(navigateToTabMock).not.toHaveBeenCalled();+ });++ it("uses a full-row hover that clears when the git action is hovered", () => {+ render(<ConversationOverviewDiffsRow />);++ const row = screen.getByTestId("conversation-overview-diffs").closest("li");+ const changesButton = screen.getByTestId("conversation-overview-diffs");+ const gitAction = screen.getByTestId(+ "conversation-overview-diffs-git-action",+ );++ expect(row).toHaveClass("hover:bg-white/5");+ expect(row?.className).toContain(+ "has-[.conversation-overview-diffs-git-action:hover]:bg-transparent",+ );+ expect(changesButton).not.toHaveClass("hover:bg-white/5");+ expect(gitAction).toHaveClass("hover:bg-white/10");+ });+});diff --git a/__tests__/components/features/conversation/conversation-overview-drawer-content.test.tsx b/__tests__/components/features/conversation/conversation-overview-drawer-content.test.tsxnew file mode 100644index 0000000000..5ad02e370d--- /dev/null+++ b/__tests__/components/features/conversation/conversation-overview-drawer-content.test.tsx@@ -0,0 +1,260 @@+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";+import { render, screen, within } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { beforeEach, describe, expect, it, vi } from "vitest";+import { ConversationOverviewDrawerContent } from "#/components/features/conversation/conversation-overview-drawer-content";+import {+ ConversationOverviewDrawerProvider,+ useConversationOverviewDrawer,+} from "#/components/features/conversation/conversation-overview-drawer-context";+import { CONVERSATION_OVERVIEW_DRAWER_SECTION } from "#/components/features/conversation/conversation-overview-drawer.types";+import { ActiveBackendProvider } from "#/contexts/active-backend-context";+import SettingsService from "#/api/settings-service/settings-service.api";+import SkillsService from "#/api/skills-service";+import { MOCK_DEFAULT_USER_SETTINGS } from "#/mocks/handlers";+import type { SkillInfo } from "#/types/settings";++vi.mock("#/hooks/use-conversation-overview-stats", () => ({+ useConversationOverviewStats: () => ({+ workspaceName: "demo",+ }),+}));++vi.mock("#/hooks/use-conversation-primary-repository", () => ({+ useConversationPrimaryRepository: () => ({+ repository: "openhands/agent-canvas",+ provider: "github" as const,+ branch: "main",+ isConnected: true,+ }),+}));++vi.mock("#/hooks/query/use-repository-git-items", () => ({+ useRepositoryPullRequests: () => ({+ data: [],+ isLoading: false,+ isError: false,+ }),+ useRepositoryIssues: () => ({+ data: [],+ isLoading: false,+ isError: false,+ }),+}));++vi.mock("#/hooks/query/use-active-conversation", () => ({+ useActiveConversation: () => ({+ data: { selected_workspace: "/workspace/project/demo" },+ }),+}));++vi.mock("#/hooks/query/use-automation-health", () => ({+ useAutomationHealth: () => ({+ data: { status: "ok" },+ isLoading: false,+ refetch: vi.fn(),+ }),+}));++vi.mock("#/hooks/query/use-automations", () => ({+ useAutomations: () => ({+ data: { automations: [], total: 0 },+ isLoading: false,+ isError: false,+ refetch: vi.fn(),+ }),+ useToggleAutomation: () => ({ mutate: vi.fn() }),+ useDeleteAutomation: () => ({ mutate: vi.fn(), isPending: false }),+ useDispatchAutomation: () => ({ mutate: vi.fn() }),+}));++vi.mock("#/hooks/use-tracking", () => ({+ useTracking: () => ({+ trackPrebuiltAutomationEnabled: vi.fn(),+ }),+}));++vi.mock("#/hooks/use-create-automation-in-chat", () => ({+ useCreateAutomationInChat: () => vi.fn(),+}));++vi.mock("#/hooks/use-is-creating-conversation", () => ({+ useIsCreatingConversation: () => false,+}));++vi.mock("#/hooks/mutation/use-create-conversation", () => ({+ useCreateConversation: () => ({ mutate: vi.fn(), isPending: false }),+}));++function buildSkill(overrides: Partial<SkillInfo> = {}): SkillInfo {+ return {+ name: "deno",+ type: "knowledge",+ source: "/Users/test/.openhands/cache/skills/public-skills/skills/deno/SKILL.md",+ description: "Use this skill for Deno projects.",+ triggers: ["deno"],+ version: "1.0.0",+ license: "Apache-2.0",+ compatibility: null,+ metadata: null,+ allowed_tools: null,+ is_agentskills_format: true,+ disable_model_invocation: false,+ ...overrides,+ };+}++function OpenSection({+ section,+}: {+ section: (typeof CONVERSATION_OVERVIEW_DRAWER_SECTION)[keyof typeof CONVERSATION_OVERVIEW_DRAWER_SECTION];+}) {+ const { openSection } = useConversationOverviewDrawer();+ return (+ <button+ type="button"+ data-testid="open-drawer-section"+ onClick={() => openSection(section)}+ >+ Open+ </button>+ );+}++function renderDrawer(+ section: (typeof CONVERSATION_OVERVIEW_DRAWER_SECTION)[keyof typeof CONVERSATION_OVERVIEW_DRAWER_SECTION],+) {+ return render(+ <ConversationOverviewDrawerProvider>+ <OpenSection section={section} />+ <ConversationOverviewDrawerContent />+ </ConversationOverviewDrawerProvider>,+ {+ wrapper: ({ children }) => (+ <QueryClientProvider+ client={+ new QueryClient({+ defaultOptions: { queries: { retry: false } },+ })+ }+ >+ <ActiveBackendProvider>{children}</ActiveBackendProvider>+ </QueryClientProvider>+ ),+ },+ );+}++describe("ConversationOverviewDrawerContent", () => {+ beforeEach(() => {+ vi.restoreAllMocks();+ vi.spyOn(SettingsService, "getSettings").mockResolvedValue(+ MOCK_DEFAULT_USER_SETTINGS,+ );+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([buildSkill()]);+ });++ it("places the close button left of the title and the add control on the right", async () => {+ const user = userEvent.setup();+ renderDrawer(CONVERSATION_OVERVIEW_DRAWER_SECTION.skills);++ await user.click(screen.getByTestId("open-drawer-section"));++ const header = screen+ .getByTestId("conversation-overview-drawer-content")+ .querySelector("header");+ expect(header).not.toBeNull();+ expect(header).toHaveClass("h-10");+ expect(header).toHaveClass("min-h-10");+ expect(header).toHaveClass("pr-4");+ expect(+ within(header as HTMLElement).getByTestId(+ "conversation-overview-skills-add-skill-button",+ ),+ ).toHaveClass("h-7");++ const headerItems = within(header as HTMLElement).getAllByRole("button");+ expect(headerItems[0]).toHaveAttribute(+ "data-testid",+ "conversation-overview-drawer-close",+ );+ expect(headerItems[1]).toHaveAttribute(+ "data-testid",+ "conversation-overview-skills-add-skill-button",+ );+ });++ it("opens the add skill modal from the header add button", async () => {+ const user = userEvent.setup();+ renderDrawer(CONVERSATION_OVERVIEW_DRAWER_SECTION.skills);++ await user.click(screen.getByTestId("open-drawer-section"));+ await user.click(+ await screen.findByTestId("conversation-overview-skills-add-skill-button"),+ );++ expect(await screen.findByTestId("add-skill-modal")).toBeInTheDocument();+ });++ it("shows the automations add button in the header", async () => {+ const user = userEvent.setup();+ renderDrawer(CONVERSATION_OVERVIEW_DRAWER_SECTION.automations);++ await user.click(screen.getByTestId("open-drawer-section"));++ expect(+ await screen.findByTestId("conversation-overview-automations-add"),+ ).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-automations-panel")+ ?.querySelector(+ '[data-testid="conversation-overview-automations-add"]',+ ),+ ).toBeNull();+ });++ it("shows the mcp add button in the header", async () => {+ const user = userEvent.setup();+ renderDrawer(CONVERSATION_OVERVIEW_DRAWER_SECTION.mcp);++ await user.click(screen.getByTestId("open-drawer-section"));++ const header = screen+ .getByTestId("conversation-overview-drawer-content")+ .querySelector("header");+ expect(+ within(header as HTMLElement).getByTestId(+ "conversation-overview-mcp-add-server",+ ),+ ).toBeInTheDocument();+ });++ it("places the view-on-provider link in the header for pull requests", async () => {+ const user = userEvent.setup();+ renderDrawer(CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests);++ await user.click(screen.getByTestId("open-drawer-section"));++ const header = screen+ .getByTestId("conversation-overview-drawer-content")+ .querySelector("header");+ const externalLink = within(header as HTMLElement).getByTestId(+ "conversation-overview-pull_requests-open-external",+ );++ expect(externalLink).toHaveAttribute(+ "href",+ "https://github.com/openhands/agent-canvas/pulls",+ );+ expect(externalLink).toHaveTextContent(+ "CONVERSATION$OVERVIEW_VIEW_ON_PROVIDER",+ );+ expect(+ screen+ .getByTestId("conversation-overview-pull_requests-panel")+ .querySelector(+ '[data-testid="conversation-overview-pull_requests-open-external"]',+ ),+ ).toBeNull();+ });+});diff --git a/__tests__/components/features/conversation/conversation-overview-panel.test.tsx b/__tests__/components/features/conversation/conversation-overview-panel.test.tsxnew file mode 100644index 0000000000..44b490704e--- /dev/null+++ b/__tests__/components/features/conversation/conversation-overview-panel.test.tsx@@ -0,0 +1,289 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, it, expect, vi, beforeEach } from "vitest";+import { ConversationOverviewPanel } from "#/components/features/conversation/conversation-overview-panel";+import { NavigationProvider } from "#/context/navigation-context";+import { ConversationOverviewDrawerProvider } from "#/components/features/conversation/conversation-overview-drawer-context";+import { CONVERSATION_OVERVIEW_DRAWER_SECTION } from "#/components/features/conversation/conversation-overview-drawer.types";++const openSection = vi.fn();+const closeDrawer = vi.fn();+const navigateToCommits = vi.fn();++vi.mock("#/hooks/use-conversation-id", () => ({+ useConversationId: () => ({ conversationId: "conv-1" }),+}));++vi.mock("#/hooks/use-conversation-overview-git-diff-stats", () => ({+ useConversationOverviewGitDiffStats: () => ({+ additions: 4161,+ deletions: 1824,+ changeCount: 3,+ isLoading: false,+ isError: false,+ }),+}));++vi.mock("#/hooks/use-select-conversation-tab", () => ({+ useSelectConversationTab: () => ({+ navigateToTab: vi.fn(),+ navigateToChanges: vi.fn(),+ navigateToCommits,+ }),+}));++vi.mock("#/hooks/query/use-active-conversation", () => ({+ useActiveConversation: () => ({+ data: {+ id: "conv-1",+ selected_workspace: "/workspace/project/demo",+ llm_model: "openhands/test-model",+ },+ }),+}));++vi.mock("#/hooks/query/use-settings", () => ({+ useSettings: () => ({+ data: {+ llm_model: "openhands/test-model",+ agent_settings: {+ mcp_config: {+ mcpServers: {+ example: {+ url: "https://example.com/mcp",+ },+ },+ },+ },+ },+ }),+}));++vi.mock("#/hooks/use-conversation-primary-repository", () => ({+ useConversationPrimaryRepository: () => ({+ repository: "openhands/agent-canvas",+ provider: "github" as const,+ branch: "main",+ isConnected: true,+ }),+}));++vi.mock("#/hooks/query/use-unified-git-commits", () => ({+ useUnifiedGitCommits: () => ({+ commits: [{ sha: "abc" }, { sha: "def" }, { sha: "ghi" }],+ hasMore: false,+ isUnsupported: false,+ isLoading: false,+ isFetching: false,+ isSuccess: true,+ isError: false,+ }),+}));++vi.mock("#/hooks/query/use-repository-git-items", () => ({+ useRepositoryPullRequests: () => ({+ data: [+ {+ id: 1,+ number: 10,+ title: "Fix overview",+ url: "https://github.com/openhands/agent-canvas/pull/10",+ authorLogin: "dev",+ updatedAt: null,+ },+ ],+ isLoading: false,+ isError: false,+ }),+ useRepositoryIssues: () => ({+ data: [],+ isLoading: false,+ isError: false,+ }),+}));++vi.mock("#/api/conversation-metadata-store", () => ({+ getStoredConversationMetadata: () => ({+ selected_workspace: "/workspace/project/demo",+ }),+}));++vi.mock(+ "#/components/features/conversation/conversation-overview-drawer-context",+ async (importOriginal) => {+ const actual = await importOriginal<+ typeof import("#/components/features/conversation/conversation-overview-drawer-context")+ >();+ return {+ ...actual,+ useConversationOverviewDrawerOptional: () => ({+ section: null,+ openAdd: false,+ openSection,+ closeDrawer,+ }),+ };+ },+);++function renderPanel() {+ return render(+ <NavigationProvider+ value={{+ currentPath: "/conversations/conv-1",+ conversationId: "conv-1",+ isNavigating: false,+ navigate: vi.fn(),+ }}+ >+ <ConversationOverviewDrawerProvider>+ <ConversationOverviewPanel />+ </ConversationOverviewDrawerProvider>+ </NavigationProvider>,+ );+}++describe("ConversationOverviewPanel", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ localStorage.clear();+ });++ it("renders workspace and git changes without MCP, secrets, skills, or automations", () => {+ renderPanel();++ expect(screen.getByTestId("conversation-overview-panel")).toBeInTheDocument();+ expect(screen.getByTestId("conversation-overview-workspace")).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-git-title"),+ ).not.toBeInTheDocument();+ expect(screen.getByTestId("conversation-overview-diffs")).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-mcp"),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-automations"),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-skills"),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-secrets"),+ ).not.toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-issues"),+ ).not.toBeInTheDocument();+ });++ it("shows changes inside the git area with commits and pull requests when a repo is connected", async () => {+ const user = userEvent.setup();+ renderPanel();++ const gitBlock = screen.getByTestId("conversation-overview-git-block");+ const diffs = screen.getByTestId("conversation-overview-diffs");+ expect(gitBlock).toContainElement(diffs);++ const workspace = screen.getByTestId("conversation-overview-workspace");+ const gitSection = screen.getByTestId("conversation-overview-git-section");+ // Workspace sits below the git content.+ expect(gitSection.compareDocumentPosition(workspace)).toBe(+ Node.DOCUMENT_POSITION_FOLLOWING,+ );+ const repoLink = screen.getByTestId("conversation-overview-git-repo");+ expect(repoLink).toHaveTextContent("openhands/agent-canvas");+ expect(repoLink.getAttribute("href")).toContain("github.com");+ const branchLink = screen.getByTestId("conversation-overview-git-branch");+ expect(branchLink).toHaveTextContent("main");+ expect(branchLink).toHaveAttribute(+ "href",+ "https://github.com/openhands/agent-canvas/tree/main",+ );+ expect(+ screen.getByTestId("conversation-overview-commits-count"),+ ).toHaveTextContent("3");+ expect(+ screen.getByTestId("conversation-overview-pull-requests-count"),+ ).toHaveTextContent("1");++ await user.click(screen.getByTestId("conversation-overview-commits"));+ expect(navigateToCommits).toHaveBeenCalled();++ await user.click(screen.getByTestId("conversation-overview-pull-requests"));+ expect(openSection).toHaveBeenCalledWith(+ CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests,+ );+ });++ it("lets users pin and unpin git changes from the overflow menu", async () => {+ const user = userEvent.setup();+ renderPanel();++ expect(screen.getByTestId("conversation-overview-diffs")).toBeInTheDocument();++ await user.click(screen.getByTestId("conversation-overview-ellipsis"));+ expect(+ screen.getByTestId("conversation-overview-context-menu"),+ ).toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-overview-menu-divider-git"),+ ).toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-overview-menu-pin-git-changes"),+ ).toHaveAttribute("aria-pressed", "true");++ await user.click(+ screen.getByTestId("conversation-overview-menu-pin-git-changes"),+ );++ expect(+ screen.queryByTestId("conversation-overview-diffs"),+ ).not.toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-overview-menu-pin-git-changes"),+ ).toHaveAttribute("aria-pressed", "false");++ await user.click(+ screen.getByTestId("conversation-overview-menu-pin-git-changes"),+ );++ expect(screen.getByTestId("conversation-overview-diffs")).toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-overview-menu-pin-git-changes"),+ ).toHaveAttribute("aria-pressed", "true");+ });++ it("lets users unpin the git section and individual git parts from the overflow menu", async () => {+ const user = userEvent.setup();+ renderPanel();++ expect(+ screen.getByTestId("conversation-overview-git-section"),+ ).toBeInTheDocument();++ await user.click(screen.getByTestId("conversation-overview-ellipsis"));+ expect(+ screen.getByTestId("conversation-overview-menu-pin-git"),+ ).toHaveAttribute("aria-pressed", "true");+ expect(+ screen.getByTestId("conversation-overview-menu-pin-git-branch"),+ ).toHaveAttribute("aria-pressed", "true");++ await user.click(+ screen.getByTestId("conversation-overview-menu-pin-git-branch"),+ );+ expect(+ screen.queryByTestId("conversation-overview-git-branch"),+ ).not.toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-overview-git-repo"),+ ).toBeInTheDocument();++ await user.click(screen.getByTestId("conversation-overview-menu-pin-git"));+ expect(+ screen.queryByTestId("conversation-overview-git-block"),+ ).not.toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-overview-menu-pin-git"),+ ).toHaveAttribute("aria-pressed", "false");+ });+});diff --git a/__tests__/components/features/conversation/conversation-overview-skills-panel.test.tsx b/__tests__/components/features/conversation/conversation-overview-skills-panel.test.tsxnew file mode 100644index 0000000000..ec89ba7b24--- /dev/null+++ b/__tests__/components/features/conversation/conversation-overview-skills-panel.test.tsx@@ -0,0 +1,106 @@+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { beforeEach, describe, expect, it, vi } from "vitest";+import { ConversationOverviewSkillsPanel } from "#/components/features/conversation/conversation-overview-skills-panel";+import SettingsService from "#/api/settings-service/settings-service.api";+import SkillsService from "#/api/skills-service";+import { MOCK_DEFAULT_USER_SETTINGS } from "#/mocks/handlers";+import type { SkillInfo } from "#/types/settings";+import { ActiveBackendProvider } from "#/contexts/active-backend-context";++vi.mock("#/hooks/query/use-active-conversation", () => ({+ useActiveConversation: () => ({+ data: { selected_workspace: "/workspace/project/demo" },+ }),+}));++function buildSkill(overrides: Partial<SkillInfo> = {}): SkillInfo {+ return {+ name: "deno",+ type: "knowledge",+ source: "/Users/test/.openhands/cache/skills/public-skills/skills/deno/SKILL.md",+ description: "Use this skill for Deno projects.",+ triggers: ["deno"],+ version: "1.0.0",+ license: "Apache-2.0",+ compatibility: null,+ metadata: null,+ allowed_tools: null,+ is_agentskills_format: true,+ disable_model_invocation: false,+ ...overrides,+ };+}++function renderPanel(openAdd = false) {+ return render(<ConversationOverviewSkillsPanel openAdd={openAdd} />, {+ wrapper: ({ children }) => (+ <QueryClientProvider+ client={+ new QueryClient({+ defaultOptions: { queries: { retry: false } },+ })+ }+ >+ <ActiveBackendProvider>{children}</ActiveBackendProvider>+ </QueryClientProvider>+ ),+ });+}++describe("ConversationOverviewSkillsPanel", () => {+ beforeEach(() => {+ vi.restoreAllMocks();+ vi.spyOn(SettingsService, "getSettings").mockResolvedValue(+ MOCK_DEFAULT_USER_SETTINGS,+ );+ });++ it("opens the add skill modal when openAdd is true", async () => {+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([buildSkill()]);++ renderPanel(true);++ expect(await screen.findByTestId("add-skill-modal")).toBeInTheDocument();+ });++ it("shows the empty state without an inline add skill button", async () => {+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([]);++ renderPanel();++ expect(+ await screen.findByTestId("conversation-overview-skills-empty"),+ ).toBeInTheDocument();+ expect(+ screen.queryByTestId("conversation-overview-skills-add-skill-button"),+ ).not.toBeInTheDocument();+ });++ it("defaults to this-project scope and can show all skills", async () => {+ const user = userEvent.setup();+ vi.spyOn(SkillsService, "getSkills").mockResolvedValue([+ buildSkill({+ name: "project-skill",+ source: "/workspace/project/demo/.openhands/skills/project/SKILL.md",+ }),+ buildSkill({ name: "public-skill" }),+ ]);++ renderPanel();++ expect(+ await screen.findByTestId("conversation-overview-skills-scope"),+ ).toBeInTheDocument();+ expect(await screen.findByText("project-skill")).toBeInTheDocument();+ expect(screen.queryByText("public-skill")).not.toBeInTheDocument();++ await user.click(+ screen.getByTestId("conversation-overview-skills-scope-option-all"),+ );++ expect(await screen.findByText("public-skill")).toBeInTheDocument();+ expect(screen.getByText("project-skill")).toBeInTheDocument();+ });+});diff --git a/__tests__/components/features/conversation/conversation-overview-toggle.test.tsx b/__tests__/components/features/conversation/conversation-overview-toggle.test.tsxnew file mode 100644index 0000000000..5d6cd92535--- /dev/null+++ b/__tests__/components/features/conversation/conversation-overview-toggle.test.tsx@@ -0,0 +1,126 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, it, expect, vi, beforeEach } from "vitest";+import { ConversationOverviewToggle } from "#/components/features/conversation/conversation-overview-toggle";+import { useConversationStore } from "#/stores/conversation-store";++const { breakpointIsMobile } = vi.hoisted(() => ({+ breakpointIsMobile: { value: false },+}));++vi.mock("#/hooks/use-breakpoint", () => ({+ useBreakpoint: () => breakpointIsMobile.value,+}));++vi.mock("#/hooks/use-is-archived-conversation", () => ({+ useIsArchivedConversation: () => false,+}));++vi.mock("#/components/features/conversation/conversation-overview-panel", () => ({+ ConversationOverviewPanel: () => (+ <div data-testid="conversation-overview-panel" />+ ),+}));++describe("ConversationOverviewToggle", () => {+ beforeEach(() => {+ breakpointIsMobile.value = false;+ useConversationStore.setState({+ isOverviewPanelShown: false,+ isOverviewPanelPeeked: false,+ isRightPanelShown: false,+ hasRightPanelToggled: false,+ });+ });++ it("toggles the overview panel when clicked", async () => {+ const user = userEvent.setup();+ render(<ConversationOverviewToggle />);++ await user.click(screen.getByTestId("conversation-overview-toggle"));+ expect(useConversationStore.getState().isOverviewPanelShown).toBe(true);++ await user.click(screen.getByTestId("conversation-overview-toggle"));+ expect(useConversationStore.getState().isOverviewPanelShown).toBe(false);+ });++ it("closes the files drawer and shows overview when the files drawer is open", async () => {+ const user = userEvent.setup();+ useConversationStore.setState({+ isOverviewPanelShown: false,+ isRightPanelShown: true,+ hasRightPanelToggled: true,+ });+ render(<ConversationOverviewToggle />);++ await user.click(screen.getByTestId("conversation-overview-toggle"));++ const state = useConversationStore.getState();+ expect(state.isRightPanelShown).toBe(false);+ expect(state.hasRightPanelToggled).toBe(false);+ expect(state.isOverviewPanelShown).toBe(true);+ });++ it("closes the overview panel when the right drawer opens", () => {+ useConversationStore.setState({+ isOverviewPanelShown: true,+ isRightPanelShown: false,+ });++ const { rerender } = render(<ConversationOverviewToggle />);+ expect(useConversationStore.getState().isOverviewPanelShown).toBe(true);++ useConversationStore.setState({ isRightPanelShown: true });+ rerender(<ConversationOverviewToggle />);++ expect(useConversationStore.getState().isOverviewPanelShown).toBe(false);+ });++ it("peeks the overview on hover while the right drawer is open", async () => {+ const user = userEvent.setup();+ useConversationStore.setState({+ isOverviewPanelShown: false,+ isRightPanelShown: true,+ });+ render(<ConversationOverviewToggle />);++ await user.hover(screen.getByTestId("conversation-overview-toggle"));++ expect(useConversationStore.getState().isOverviewPanelPeeked).toBe(true);+ expect(useConversationStore.getState().isOverviewPanelShown).toBe(false);+ expect(screen.getByTestId("conversation-overview-peek")).toBeInTheDocument();+ expect(+ screen.getByTestId("conversation-overview-panel"),+ ).toBeInTheDocument();+ });++ it("does not peek the overview on hover when the right drawer is closed", async () => {+ const user = userEvent.setup();+ render(<ConversationOverviewToggle />);++ await user.hover(screen.getByTestId("conversation-overview-toggle"));++ expect(useConversationStore.getState().isOverviewPanelPeeked).toBe(false);+ expect(+ screen.queryByTestId("conversation-overview-peek"),+ ).not.toBeInTheDocument();+ });++ it("stays visible and supports hover peek on smaller screens", async () => {+ const user = userEvent.setup();+ breakpointIsMobile.value = true;+ useConversationStore.setState({+ isOverviewPanelShown: false,+ isRightPanelShown: true,+ });+ render(<ConversationOverviewToggle />);++ const toggle = screen.getByTestId("conversation-overview-toggle");+ expect(toggle).toBeInTheDocument();++ await user.hover(toggle);++ expect(useConversationStore.getState().isOverviewPanelPeeked).toBe(true);+ expect(screen.getByTestId("conversation-overview-peek")).toBeInTheDocument();+ });+});diff --git a/__tests__/components/features/conversation/conversation-tabs-context-menu.test.tsx b/__tests__/components/features/conversation/conversation-tabs-context-menu.test.tsxindex 36c60f3387..6dd3f78d10 100644--- a/__tests__/components/features/conversation/conversation-tabs-context-menu.test.tsx+++ b/__tests__/components/features/conversation/conversation-tabs-context-menu.test.tsx@@ -62,11 +62,18 @@ describe("ConversationTabsContextMenu", () => {it("should render all default tabs when open", () => {render(<ConversationTabsContextMenu isOpen={true} onClose={vi.fn()} />);- const expectedTabs = ["COMMON$FILES", "COMMON$TERMINAL", "COMMON$BROWSER"];+ const expectedTabs = [+ "COMMON$FILES",+ "DIFF_VIEWER$COMMITS",+ "COMMON$TERMINAL",+ "COMMON$BROWSER",+ ];for (const tab of expectedTabs) {expect(screen.getByText(tab)).toBeInTheDocument();}+ expect(screen.queryByText("FILES$DIFF_VIEW")).not.toBeInTheDocument();+// Planner is cloud-only; on the default (local) backend it is hidden.expect(screen.queryByText("COMMON$PLANNER")).not.toBeInTheDocument();});@@ -132,13 +139,14 @@ describe("ConversationTabsContextMenu", () => {const storeState = useConversationStore.getState();expect(storeState.hasRightPanelToggled).toBe(true);- expect(storeState.selectedTab).toBe("terminal");+ // Next pinned tab after Files is Commits.+ expect(storeState.selectedTab).toBe("commits");const storedState = JSON.parse(localStorage.getItem(`conversation-state-${CONVERSATION_ID}`)!,);expect(storedState.unpinnedTabs).toContain("files");- expect(storedState.selectedTab).toBe("terminal");+ expect(storedState.selectedTab).toBe("commits");});it("should not close the right panel when unpinning a non-active tab", async () => {diff --git a/__tests__/components/features/conversation/conversation-tabs.test.tsx b/__tests__/components/features/conversation/conversation-tabs.test.tsxindex 11b01527e4..7a145ee986 100644--- a/__tests__/components/features/conversation/conversation-tabs.test.tsx+++ b/__tests__/components/features/conversation/conversation-tabs.test.tsx@@ -82,6 +82,8 @@ const seedConversationState = (JSON.stringify({selectedTab: "files",unpinnedTabs: [],+ unpinnedOverviewSections: [],+ unpinnedOverviewGitParts: [],conversationMode: "code",subConversationTaskId: null,draftMessage: null,@@ -102,6 +104,7 @@ function seedActiveBackend(backend: Backend): void {const setActiveTabState = (tab: "files" | "planner") => {seedConversationState(REAL_CONVERSATION_ID, {selectedTab: tab,+ rightPanelShown: true,});useConversationStore.setState({selectedTab: tab,@@ -160,9 +163,7 @@ describe("ConversationTabs localStorage behavior", () => {const parsed = JSON.parse(storedState!);expect(parsed).toHaveProperty("selectedTab");expect(parsed).toHaveProperty("unpinnedTabs");- // The right-drawer open state is session-only and must never- // be persisted into the consolidated conversation-state blob.- expect(parsed).not.toHaveProperty("rightPanelShown");+ expect(parsed.rightPanelShown).toBe(true);});});@@ -186,16 +187,15 @@ describe("ConversationTabs localStorage behavior", () => {const terminalTab = screen.getByTestId("conversation-tab-terminal");await user.click(terminalTab);- // Assert: Panel should be open and terminal tab selected (in-memory only).+ // Assert: Panel should be open and terminal tab selected.expect(useConversationStore.getState().selectedTab).toBe("terminal");expect(useConversationStore.getState().hasRightPanelToggled).toBe(true);- // Tab selection persists to localStorage; drawer-open state does not.const storedState = JSON.parse(localStorage.getItem(`conversation-state-${REAL_CONVERSATION_ID}`)!,);expect(storedState.selectedTab).toBe("terminal");- expect(storedState).not.toHaveProperty("rightPanelShown");+ expect(storedState.rightPanelShown).toBe(true);});it("should close panel when clicking the same active tab", async () => {@@ -203,6 +203,10 @@ describe("ConversationTabs localStorage behavior", () => {const user = userEvent.setup();// Arrange: Panel is open with editor tab selected+ seedConversationState(REAL_CONVERSATION_ID, {+ selectedTab: "files",+ rightPanelShown: true,+ });useConversationStore.setState({selectedTab: "files",isRightPanelShown: true,@@ -217,17 +221,13 @@ describe("ConversationTabs localStorage behavior", () => {const editorTab = screen.getByTestId("conversation-tab-files");await user.click(editorTab);- // Assert: Panel should be closed (in-memory only).+ // Assert: Panel should be closed and persisted.expect(useConversationStore.getState().hasRightPanelToggled).toBe(false);- // localStorage must NOT carry the drawer-open state — that's- // session-only by design.- const raw = localStorage.getItem(- `conversation-state-${REAL_CONVERSATION_ID}`,+ const storedState = JSON.parse(+ localStorage.getItem(`conversation-state-${REAL_CONVERSATION_ID}`)!,);- if (raw !== null) {- expect(JSON.parse(raw)).not.toHaveProperty("rightPanelShown");- }+ expect(storedState.rightPanelShown).toBe(false);});it("should switch to different tab when clicking another tab while panel is open", async () => {@@ -235,6 +235,10 @@ describe("ConversationTabs localStorage behavior", () => {const user = userEvent.setup();// Arrange: Panel is open with editor tab selected+ seedConversationState(REAL_CONVERSATION_ID, {+ selectedTab: "files",+ rightPanelShown: true,+ });useConversationStore.setState({selectedTab: "files",isRightPanelShown: true,@@ -289,7 +293,7 @@ describe("ConversationTabs localStorage behavior", () => {expect(refreshButtons).toHaveLength(0);});- it("places the Files tab leftmost in the tab bar", () => {+ it("places the Files tab leftmost, followed by Commits", () => {setActiveTabState("files");render(<ConversationTabs />, {@@ -300,8 +304,13 @@ describe("ConversationTabs localStorage behavior", () => {document.querySelectorAll('[data-testid^="conversation-tab-"]'),);const testIds = tabs.map((t) => t.getAttribute("data-testid"));- // Files must be the first tab rendered in the bar.+ // Files must be the first tab; Commits sits beside it as the git view.expect(testIds[0]).toBe("conversation-tab-files");+ expect(testIds).toContain("conversation-tab-commits");+ expect(testIds).not.toContain("conversation-tab-changes");+ expect(testIds.indexOf("conversation-tab-files")).toBeLessThan(+ testIds.indexOf("conversation-tab-commits"),+ );});it("keeps Files leftmost even when the task list tab is present", () => {@@ -335,6 +344,7 @@ describe("ConversationTabs localStorage behavior", () => {seedConversationState(REAL_CONVERSATION_ID, {selectedTab: "planner",unpinnedTabs: ["planner"],+ rightPanelShown: true,});useConversationStore.setState({selectedTab: "planner",@@ -365,6 +375,7 @@ describe("ConversationTabs localStorage behavior", () => {seedConversationState(REAL_CONVERSATION_ID, {selectedTab: "files",unpinnedTabs: ["planner"],+ rightPanelShown: true,});useConversationStore.setState({selectedTab: "files",diff --git a/__tests__/components/features/conversation/right-panel-toggle.test.tsx b/__tests__/components/features/conversation/right-panel-toggle.test.tsxindex f3a17912b5..a4fd8dba39 100644--- a/__tests__/components/features/conversation/right-panel-toggle.test.tsx+++ b/__tests__/components/features/conversation/right-panel-toggle.test.tsx@@ -61,10 +61,10 @@ describe("RightPanelToggle", () => {expect(storeState.hasRightPanelToggled).toBe(false);expect(storeState.isRightPanelShown).toBe(false);- const raw = localStorage.getItem(`conversation-state-${CONVERSATION_ID}`);- if (raw !== null) {- expect(JSON.parse(raw)).not.toHaveProperty("rightPanelShown");- }+ const storedState = JSON.parse(+ localStorage.getItem(`conversation-state-${CONVERSATION_ID}`)!,+ );+ expect(storedState.rightPanelShown).toBe(false);});it("should show the panel when clicked while panel is hidden", async () => {@@ -84,10 +84,10 @@ describe("RightPanelToggle", () => {expect(storeState.hasRightPanelToggled).toBe(true);expect(storeState.isRightPanelShown).toBe(true);- const raw = localStorage.getItem(`conversation-state-${CONVERSATION_ID}`);- if (raw !== null) {- expect(JSON.parse(raw)).not.toHaveProperty("rightPanelShown");- }+ const storedState = JSON.parse(+ localStorage.getItem(`conversation-state-${CONVERSATION_ID}`)!,+ );+ expect(storedState.rightPanelShown).toBe(true);});it("should have aria-pressed attribute reflecting panel state on desktop", () => {diff --git a/__tests__/components/features/diff-viewer/commit-list.test.tsx b/__tests__/components/features/diff-viewer/commit-list.test.tsxnew file mode 100644index 0000000000..1d97948999--- /dev/null+++ b/__tests__/components/features/diff-viewer/commit-list.test.tsx@@ -0,0 +1,177 @@+import React from "react";+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, it, expect, vi } from "vitest";+import { CommitList } from "#/components/features/diff-viewer/commit-list";+import type { GitCommit } from "#/api/open-hands.types";++vi.mock("react-i18next", () => ({+ useTranslation: () => ({+ t: (key: string, options?: { count?: number }) => {+ if (+ key === "DIFF_VIEWER$UNCOMMITTED_FILE_COUNT" &&+ typeof options?.count === "number"+ ) {+ return options.count === 1+ ? `${options.count} file`+ : `${options.count} files`;+ }+ return key;+ },+ }),+}));++vi.mock("#/hooks/query/use-commit-changes", () => ({+ useCommitChanges: () => ({+ data: undefined,+ isLoading: false,+ isSuccess: false,+ }),+}));++vi.mock("#/components/features/diff-viewer/diff-change-list", () => ({+ DiffChangeList: ({+ changes,+ }: {+ changes: Array<{ path: string; status: string }>;+ }) => (+ <div data-testid="diff-change-list">+ {changes.map((change) => (+ <div key={change.path}>{change.path}</div>+ ))}+ </div>+ ),+}));++const makeCommit = (overrides: Partial<GitCommit> = {}): GitCommit => ({+ sha: "a".repeat(40),+ shortSha: "aaaaaaa",+ subject: "add logging",+ author: "Agent",+ timestamp: "2026-07-10T12:00:00+07:00",+ ...overrides,+});++describe("CommitList", () => {+ it("renders an Uncommitted accordion row above the commit rows", () => {+ // Arrange / Act+ render(+ <CommitList+ commits={[makeCommit()]}+ hasMore={false}+ uncommittedChanges={[{ path: "src/a.ts", status: "M" }]}+ />,+ );++ // Assert+ expect(screen.getByTestId("uncommitted-changes-row")).toBeInTheDocument();+ expect(screen.getByText("DIFF_VIEWER$UNCOMMITTED")).toBeInTheDocument();+ expect(screen.getByTestId("uncommitted-changes-count")).toHaveTextContent(+ "1 file",+ );+ const rows = screen.getAllByTestId(/^(uncommitted-changes-row|commit-row)$/);+ expect(rows[0]).toHaveAttribute("data-testid", "uncommitted-changes-row");+ });++ it("pluralizes the Uncommitted file count", () => {+ // Arrange / Act+ render(+ <CommitList+ commits={[makeCommit()]}+ hasMore={false}+ uncommittedChanges={[+ { path: "src/a.ts", status: "M" },+ { path: "src/b.ts", status: "A" },+ ]}+ />,+ );++ // Assert+ expect(screen.getByTestId("uncommitted-changes-count")).toHaveTextContent(+ "2 files",+ );+ });++ it("expands Uncommitted into the working-tree file list", async () => {+ // Arrange+ const user = userEvent.setup();+ render(+ <CommitList+ commits={[makeCommit()]}+ hasMore={false}+ uncommittedChanges={[{ path: "src/a.ts", status: "M" }]}+ />,+ );++ // Act+ await user.click(screen.getByTestId("uncommitted-changes-row-toggle"));++ // Assert+ expect(await screen.findByText("src/a.ts")).toBeInTheDocument();+ });++ it("collapses Uncommitted when a commit row is expanded", async () => {+ // Arrange+ const user = userEvent.setup();+ render(+ <CommitList+ commits={[makeCommit()]}+ hasMore={false}+ uncommittedChanges={[{ path: "src/a.ts", status: "M" }]}+ />,+ );+ const uncommittedToggle = screen.getByTestId(+ "uncommitted-changes-row-toggle",+ );+ await user.click(uncommittedToggle);+ expect(uncommittedToggle).toHaveAttribute("aria-expanded", "true");+ expect(await screen.findByText("src/a.ts")).toBeInTheDocument();++ // Act+ await user.click(screen.getByTestId("commit-row-toggle"));++ // Assert — single-open accordion: Uncommitted collapses when a commit opens.+ expect(uncommittedToggle).toHaveAttribute("aria-expanded", "false");+ expect(screen.getByTestId("commit-row-toggle")).toHaveAttribute(+ "aria-expanded",+ "true",+ );+ });++ it("expands Uncommitted on request and clears the request", () => {+ // Arrange+ const onAutoExpandHandled = vi.fn();++ // Act+ render(+ <CommitList+ commits={[makeCommit()]}+ hasMore={false}+ uncommittedChanges={[{ path: "src/a.ts", status: "M" }]}+ autoExpandUncommitted+ onAutoExpandHandled={onAutoExpandHandled}+ />,+ );++ // Assert+ expect(+ screen.getByTestId("uncommitted-changes-row-toggle"),+ ).toHaveAttribute("aria-expanded", "true");+ expect(screen.getByText("src/a.ts")).toBeInTheDocument();+ expect(onAutoExpandHandled).toHaveBeenCalled();+ });++ it("still renders Uncommitted when there are no working-tree changes", () => {+ // Arrange / Act+ render(+ <CommitList+ commits={[makeCommit()]}+ hasMore={false}+ uncommittedChanges={[]}+ />,+ );++ // Assert+ expect(screen.getByTestId("uncommitted-changes-row")).toBeInTheDocument();+ });+});diff --git a/__tests__/components/features/diff-viewer/diff-change-list.test.tsx b/__tests__/components/features/diff-viewer/diff-change-list.test.tsxnew file mode 100644index 0000000000..512cb0efe8--- /dev/null+++ b/__tests__/components/features/diff-viewer/diff-change-list.test.tsx@@ -0,0 +1,84 @@+import { render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { describe, it, expect, vi, beforeEach } from "vitest";+import { DiffChangeList } from "#/components/features/diff-viewer/diff-change-list";++vi.mock("framer-motion", async (importOriginal) => {+ const actual = await importOriginal<typeof import("framer-motion")>();+ return {+ ...actual,+ // Skip exit animations so open/close assertions are synchronous.+ useReducedMotion: () => true,+ };+});++vi.mock("#/hooks/query/use-unified-git-diff", () => ({+ useUnifiedGitDiff: () => ({+ data: { original: "a", modified: "b" },+ isLoading: false,+ isSuccess: true,+ isRefetching: false,+ }),+}));++vi.mock("@monaco-editor/react", () => ({+ DiffEditor: () => <div data-testid="file-diff-viewer" />,+ Editor: () => <div data-testid="file-single-viewer" />,+}));++describe("DiffChangeList", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ });++ it("keeps only one file expanded at a time", async () => {+ const user = userEvent.setup();+ render(+ <DiffChangeList+ changes={[+ { path: "a.ts", status: "M" },+ { path: "b.ts", status: "A" },+ ]}+ />,+ );++ const [firstToggle, secondToggle] = screen.getAllByTestId("collapse");++ await user.click(firstToggle);+ expect(+ screen.getAllByTestId("file-diff-viewer-outer")[0].querySelector(+ '[data-testid="file-diff-viewer"]',+ ),+ ).toBeTruthy();+ expect(+ screen.getAllByTestId("file-diff-viewer-outer")[1].querySelector(+ '[data-testid="file-diff-viewer"]',+ ),+ ).toBeNull();++ await user.click(secondToggle);+ expect(+ screen.getAllByTestId("file-diff-viewer-outer")[0].querySelector(+ '[data-testid="file-diff-viewer"]',+ ),+ ).toBeNull();+ expect(+ screen.getAllByTestId("file-diff-viewer-outer")[1].querySelector(+ '[data-testid="file-diff-viewer"]',+ ),+ ).toBeTruthy();+ });++ it("collapses the open file when its header is clicked again", async () => {+ const user = userEvent.setup();+ render(+ <DiffChangeList changes={[{ path: "a.ts", status: "M" }]} />,+ );++ await user.click(screen.getByTestId("collapse"));+ expect(screen.getByTestId("file-diff-viewer")).toBeInTheDocument();++ await user.click(screen.getByTestId("collapse"));+ expect(screen.queryByTestId("file-diff-viewer")).not.toBeInTheDocument();+ });+});diff --git a/__tests__/components/features/diff-viewer/file-diff-viewer.test.tsx b/__tests__/components/features/diff-viewer/file-diff-viewer.test.tsxindex 8f3a49622f..7bdb37e28e 100644--- a/__tests__/components/features/diff-viewer/file-diff-viewer.test.tsx+++ b/__tests__/components/features/diff-viewer/file-diff-viewer.test.tsx@@ -1,7 +1,10 @@import { render, screen } from "@testing-library/react";import userEvent from "@testing-library/user-event";import { describe, it, expect, vi, beforeEach } from "vitest";-import { FileDiffViewer } from "#/components/features/diff-viewer/file-diff-viewer";+import {+ FileDiffViewer,+ MAX_DIFF_EDITOR_HEIGHT_PX,+} from "#/components/features/diff-viewer/file-diff-viewer";const MOCK_DIFF = { original: "old content", modified: "new content" };const MOCK_MD_DIFF = {@@ -48,20 +51,29 @@ describe("FileDiffViewer", () => {mockIsLoading = false;});- it("starts collapsed with no view mode buttons", () => {+ it("caps opened editor panes at 600px", () => {+ expect(MAX_DIFF_EDITOR_HEIGHT_PX).toBe(600);+ });++ it("keeps view mode controls reserved but inert while collapsed", () => {render(<FileDiffViewer path="src/index.ts" type="M" />);- expect(screen.queryByTestId("view-mode-old")).not.toBeInTheDocument();- expect(screen.queryByTestId("view-mode-diff")).not.toBeInTheDocument();- expect(screen.queryByTestId("view-mode-new")).not.toBeInTheDocument();+ const viewModeGroup = screen.getByTestId("view-mode-diff").parentElement;+ expect(viewModeGroup).toHaveClass("invisible");+ expect(screen.getByTestId("view-mode-old")).toHaveAttribute(+ "tabIndex",+ "-1",+ );});- it("shows view mode buttons when expanded", async () => {+ it("reveals view mode buttons when expanded", async () => {const user = userEvent.setup();render(<FileDiffViewer path="src/index.ts" type="M" />);await expand(user);+ const viewModeGroup = screen.getByTestId("view-mode-diff").parentElement;+ expect(viewModeGroup).not.toHaveClass("invisible");expect(screen.getByTestId("view-mode-old")).toBeInTheDocument();expect(screen.getByTestId("view-mode-diff")).toBeInTheDocument();expect(screen.getByTestId("view-mode-new")).toBeInTheDocument();diff --git a/__tests__/conversation-local-storage.test.ts b/__tests__/conversation-local-storage.test.tsindex 07571b36e9..b2b6dc4308 100644--- a/__tests__/conversation-local-storage.test.ts+++ b/__tests__/conversation-local-storage.test.ts@@ -50,51 +50,37 @@ describe("conversation localStorage utilities", () => {expect(state.selectedTab).toBe("terminal");});- it("silently drops the legacy rightPanelShown field from older persisted blobs", () => {- // Older builds persisted the right-drawer state alongside the- // selected tab. The schema no longer carries that field — verify- // the read path strips it instead of leaking the unknown property- // onto consumers (and that legacy `false` values don't somehow- // pin the panel closed forever).- const conversationId = "conv-legacy-right-panel";- const key = `${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`;- localStorage.setItem(- key,- JSON.stringify({- selectedTab: "terminal",- rightPanelShown: false,- unpinnedTabs: ["browser"],- }),- );+ it("round-trips rightPanelShown through localStorage", () => {+ const conversationId = "conv-right-panel";+ setConversationState(conversationId, {+ selectedTab: "terminal",+ rightPanelShown: true,+ unpinnedTabs: ["browser"],+ });const state = getConversationState(conversationId);expect(state.selectedTab).toBe("terminal");expect(state.unpinnedTabs).toEqual(["browser"]);- expect(state).not.toHaveProperty("rightPanelShown");+ expect(state.rightPanelShown).toBe(true);});- it("also drops legacy rightPanelShown: true (not just the falsy variant)", () => {- // Older builds could persist either boolean. The previous test- // covered `false`; this one covers `true` so an upgrading user- // with the drawer open can't have it leak through into the new- // schema either.- const conversationId = "conv-legacy-right-panel-true";+ it("defaults rightPanelShown to false and drops corrupt values", () => {+ expect(getConversationState("conv-right-panel-default").rightPanelShown).toBe(+ false,+ );++ const conversationId = "conv-right-panel-corrupt";const key = `${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`;localStorage.setItem(key,JSON.stringify({selectedTab: "terminal",- rightPanelShown: true,- unpinnedTabs: ["browser"],+ rightPanelShown: "yes",}),);- const state = getConversationState(conversationId);-- expect(state.selectedTab).toBe("terminal");- expect(state.unpinnedTabs).toEqual(["browser"]);- expect(state).not.toHaveProperty("rightPanelShown");+ expect(getConversationState(conversationId).rightPanelShown).toBe(false);});it("returns default state when key is missing or invalid", () => {@@ -160,6 +146,30 @@ describe("conversation localStorage utilities", () => {expect(state.subConversationTaskId).toBeNull();expect(state.selectedTab).toBe("files");expect(state.unpinnedTabs).toEqual([]);+ expect(state.unpinnedOverviewSections).toEqual([]);+ expect(state.unpinnedOverviewGitParts).toEqual([]);+ });++ it("persists and sanitizes unpinnedOverviewSections", () => {+ const conversationId = "conv-overview-pins";+ setConversationState(conversationId, {+ unpinnedOverviewSections: ["skills", "not-a-section", "mcp", "workspace"],+ });++ const state = getConversationState(conversationId);+ // Legacy section ids (mcp/skills/secrets/…) are dropped by the allowlist.+ expect(state.unpinnedOverviewSections).toEqual(["workspace"]);+ });++ it("persists and sanitizes unpinnedOverviewGitParts", () => {+ const conversationId = "conv-overview-git-pins";+ setConversationState(conversationId, {+ unpinnedOverviewGitParts: ["branch", "not-a-part", "issues"],+ });++ const state = getConversationState(conversationId);+ // Legacy git part ids (issues) are dropped by the allowlist.+ expect(state.unpinnedOverviewGitParts).toEqual(["branch"]);});it("retrieves subConversationTaskId from localStorage when it exists", () => {@@ -217,14 +227,29 @@ describe("conversation localStorage utilities", () => {expect(state.selectedTab).toBe("files");});- it("filters obsolete tabs out of stored unpinnedTabs (changes / editor / served / app)", () => {- // Returning users may have unpinned the now-removed Changes,- // Editor, Served, or App tabs in a previous version. Those names+ it("migrates a stored Diffs (changes) tab selection to Commits", () => {+ const conversationId = "conv-123";+ const consolidatedKey = `${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`;++ localStorage.setItem(+ consolidatedKey,+ JSON.stringify({+ selectedTab: "changes",+ unpinnedTabs: [],+ }),+ );++ const state = getConversationState(conversationId);++ expect(state.selectedTab).toBe("commits");+ });++ it("filters obsolete tabs out of stored unpinnedTabs (editor / served / app / changes)", () => {+ // Returning users may have unpinned the now-removed Editor, Served,+ // App, or Diffs (`changes`) tabs in a previous version. Those names// should not survive the read — otherwise they linger forever in// localStorage since the UI has no way to surface them again to be- // re-pinned. We cover ALL four removed names here (the previous- // version of this test missed `app` and the gap let a denylist-vs-- // whitelist regression slip through review).+ // re-pinned.const conversationId = "conv-123";const consolidatedKey = `${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`;@@ -238,8 +263,7 @@ describe("conversation localStorage utilities", () => {const state = getConversationState(conversationId);- // Only the still-valid `terminal` entry survives; all four- // obsolete names are dropped.+ // Obsolete names are dropped; still-valid `terminal` stays.expect(state.unpinnedTabs).toEqual(["terminal"]);});});@@ -537,53 +561,19 @@ describe("conversation localStorage utilities", () => {});});- describe("filesTabDiffView persistence", () => {- // The diff-view toggle is per-conversation: in a git repo it- // defaults to ON, in a plain workspace it defaults to OFF, but the- // user's last explicit choice should win. Verify the boolean- // round-trips through localStorage and that the unset case stays- // `null` (so the higher layer can apply the repo-aware default).-- it("defaults to null when nothing is stored", () => {- const state = getConversationState("files-diff-conv-1");- expect(state.filesTabDiffView).toBeNull();- });-- it("round-trips `true` through localStorage", () => {- const conversationId = "files-diff-conv-2";- setConversationState(conversationId, { filesTabDiffView: true });-- const state = getConversationState(conversationId);- expect(state.filesTabDiffView).toBe(true);-- // Also verify the on-disk shape — important because the consumer- // code reads it back via `JSON.parse`, so a wrong-type value would- // be a silent regression.- const raw = localStorage.getItem(+ describe("filesTabDiffView preference", () => {+ it("preserves filesTabDiffView from stored blobs on read", () => {+ const conversationId = "files-diff-legacy";+ localStorage.setItem(`${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`,+ JSON.stringify({+ selectedTab: "files",+ filesTabDiffView: true,+ }),);- expect(raw).not.toBeNull();- expect(JSON.parse(raw as string).filesTabDiffView).toBe(true);- });-- it("round-trips `false` through localStorage", () => {- const conversationId = "files-diff-conv-3";- setConversationState(conversationId, { filesTabDiffView: false });const state = getConversationState(conversationId);- expect(state.filesTabDiffView).toBe(false);- });-- it("is isolated per conversation", () => {- setConversationState("files-diff-convA", { filesTabDiffView: true });- setConversationState("files-diff-convB", { filesTabDiffView: false });-- expect(getConversationState("files-diff-convA").filesTabDiffView).toBe(- true,- );- expect(getConversationState("files-diff-convB").filesTabDiffView).toBe(- false,- );+ expect(state.filesTabDiffView).toBe(true);});});@@ -658,4 +648,45 @@ describe("conversation localStorage utilities", () => {expect(state.filesTabContentViewMode).toBe("rich");});});++ describe("files tab open-state / tree persistence", () => {+ it("defaults to an expanded tree and no open files", () => {+ const state = getConversationState("files-open-defaults");+ expect(state.filesTabTreeVisible).toBe(true);+ expect(state.filesTabOpenPaths).toEqual([]);+ expect(state.filesTabSelectedPath).toBeNull();+ });++ it("round-trips tree visibility and open tabs", () => {+ const conversationId = "files-open-roundtrip";+ setConversationState(conversationId, {+ filesTabTreeVisible: false,+ filesTabOpenPaths: ["README.md", "src/main.ts"],+ filesTabSelectedPath: "src/main.ts",+ });++ const state = getConversationState(conversationId);+ expect(state.filesTabTreeVisible).toBe(false);+ expect(state.filesTabOpenPaths).toEqual(["README.md", "src/main.ts"]);+ expect(state.filesTabSelectedPath).toBe("src/main.ts");+ });++ it("sanitizes corrupt open-state fields", () => {+ const conversationId = "files-open-corrupt";+ const key = `${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`;+ localStorage.setItem(+ key,+ JSON.stringify({+ filesTabTreeVisible: "yes",+ filesTabOpenPaths: ["ok.ts", 12, "", null],+ filesTabSelectedPath: { path: "nope" },+ }),+ );++ const state = getConversationState(conversationId);+ expect(state.filesTabTreeVisible).toBe(true);+ expect(state.filesTabOpenPaths).toEqual(["ok.ts"]);+ expect(state.filesTabSelectedPath).toBeNull();+ });+ });});diff --git a/__tests__/hooks/use-select-conversation-tab.test.ts b/__tests__/hooks/use-select-conversation-tab.test.tsindex 2fa1bbcead..0d61701133 100644--- a/__tests__/hooks/use-select-conversation-tab.test.ts+++ b/__tests__/hooks/use-select-conversation-tab.test.ts@@ -37,17 +37,16 @@ describe("useSelectConversationTab", () => {result.current.selectTab("files");});- // Assert: Panel should be open and tab selected (in-memory only).+ // Assert: Panel should be open and tab selected.expect(useConversationStore.getState().selectedTab).toBe("files");expect(useConversationStore.getState().hasRightPanelToggled).toBe(true);+ expect(useConversationStore.getState().isRightPanelShown).toBe(true);- // Tab selection is persisted; the right-drawer open state is- // intentionally session-only and must NOT touch localStorage.const storedState = JSON.parse(localStorage.getItem(`conversation-state-${TEST_CONVERSATION_ID}`)!,);expect(storedState.selectedTab).toBe("files");- expect(storedState).not.toHaveProperty("rightPanelShown");+ expect(storedState.rightPanelShown).toBe(true);});it("should close panel when clicking the same active tab", () => {@@ -65,19 +64,14 @@ describe("useSelectConversationTab", () => {result.current.selectTab("files");});- // Assert: Panel should be closed (in-memory only).+ // Assert: Panel should be closed and persisted.expect(useConversationStore.getState().hasRightPanelToggled).toBe(false);+ expect(useConversationStore.getState().isRightPanelShown).toBe(false);- // The drawer-close shouldn't have written to localStorage at all- // (session-only behavior). If anything is persisted, it's just the- // pre-existing tab selection from earlier writes — never a- // `rightPanelShown` field.- const raw = localStorage.getItem(- `conversation-state-${TEST_CONVERSATION_ID}`,+ const storedState = JSON.parse(+ localStorage.getItem(`conversation-state-${TEST_CONVERSATION_ID}`)!,);- if (raw !== null) {- expect(JSON.parse(raw)).not.toHaveProperty("rightPanelShown");- }+ expect(storedState.rightPanelShown).toBe(false);});it("should switch to different tab when panel is already open", () => {@@ -153,6 +147,77 @@ describe("useSelectConversationTab", () => {});});+ describe("navigateToTab", () => {+ it("always opens the panel even when isRightPanelShown is stale true", () => {+ useConversationStore.setState({+ selectedTab: "terminal",+ isRightPanelShown: true,+ hasRightPanelToggled: false,+ isOverviewPanelShown: true,+ });++ const { result } = renderHook(() => useSelectConversationTab());++ act(() => {+ result.current.navigateToTab("files");+ });++ expect(useConversationStore.getState().selectedTab).toBe("files");+ expect(useConversationStore.getState().hasRightPanelToggled).toBe(true);+ expect(useConversationStore.getState().isOverviewPanelShown).toBe(false);+ });+ });++ describe("navigateToChanges", () => {+ it("opens the commits tab with Uncommitted requested", () => {+ useConversationStore.setState({+ selectedTab: "terminal",+ isRightPanelShown: false,+ hasRightPanelToggled: false,+ isOverviewPanelShown: true,+ commitsAutoExpandSection: null,+ });++ const { result } = renderHook(() => useSelectConversationTab());++ act(() => {+ result.current.navigateToChanges();+ });++ expect(useConversationStore.getState().selectedTab).toBe("commits");+ expect(useConversationStore.getState().commitsAutoExpandSection).toBe(+ "uncommitted",+ );+ expect(useConversationStore.getState().hasRightPanelToggled).toBe(true);+ expect(useConversationStore.getState().isOverviewPanelShown).toBe(false);+ });+ });++ describe("navigateToCommits", () => {+ it("opens the commits tab without requesting Uncommitted", () => {+ useConversationStore.setState({+ selectedTab: "terminal",+ isRightPanelShown: false,+ hasRightPanelToggled: false,+ isOverviewPanelShown: true,+ commitsAutoExpandSection: "uncommitted",+ });++ const { result } = renderHook(() => useSelectConversationTab());++ act(() => {+ result.current.navigateToCommits();+ });++ expect(useConversationStore.getState().selectedTab).toBe("commits");+ expect(+ useConversationStore.getState().commitsAutoExpandSection,+ ).toBeNull();+ expect(useConversationStore.getState().hasRightPanelToggled).toBe(true);+ expect(useConversationStore.getState().isOverviewPanelShown).toBe(false);+ });+ });+describe("onTabChange", () => {it("should update both Zustand store and localStorage when changing tab", () => {// Arrangediff --git a/__tests__/routes/changes-tab.test.tsx b/__tests__/routes/changes-tab.test.tsxdeleted file mode 100644index 1891ab761e..0000000000--- a/__tests__/routes/changes-tab.test.tsx+++ /dev/null@@ -1,132 +0,0 @@-import { render, screen } from "@testing-library/react";-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";-import { describe, expect, it, vi } from "vitest";-import { MemoryRouter } from "react-router";-import { AxiosError } from "axios";-import GitChanges from "#/routes/changes-tab";-import { useUnifiedGetGitChanges } from "#/hooks/query/use-unified-get-git-changes";-import { useAgentState } from "#/hooks/use-agent-state";-import { AgentState } from "#/types/agent-state";--vi.mock("react-i18next", () => ({- useTranslation: () => ({- t: (key: string) => key,- }),-}));--vi.mock("#/hooks/query/use-unified-get-git-changes");-vi.mock("#/hooks/use-agent-state");-vi.mock("#/hooks/use-conversation-id", () => ({- useConversationId: () => ({ conversationId: "test-id" }),- useOptionalConversationId: () => ({ conversationId: "test-id" }),-}));--const wrapper = ({ children }: { children: React.ReactNode }) => (- <MemoryRouter>- <QueryClientProvider client={new QueryClient()}>- {children}- </QueryClientProvider>- </MemoryRouter>-);--describe("Changes Tab", () => {- it("should show EmptyChangesMessage when there are no changes", () => {- vi.mocked(useUnifiedGetGitChanges).mockReturnValue({- data: [],- isLoading: false,- isFetching: false,- isSuccess: true,- isError: false,- error: null,- refetch: vi.fn(),- });- vi.mocked(useAgentState).mockReturnValue({- curAgentState: AgentState.RUNNING,- });-- render(<GitChanges />, { wrapper });-- expect(screen.getByText("DIFF_VIEWER$NO_CHANGES")).toBeInTheDocument();- });-- it("should not show EmptyChangesMessage when there are changes", () => {- vi.mocked(useUnifiedGetGitChanges).mockReturnValue({- data: [{ path: "src/file.ts", status: "M" }],- isLoading: false,- isFetching: false,- isSuccess: true,- isError: false,- error: null,- refetch: vi.fn(),- });- vi.mocked(useAgentState).mockReturnValue({- curAgentState: AgentState.RUNNING,- });-- render(<GitChanges />, { wrapper });-- expect(- screen.queryByText("DIFF_VIEWER$NO_CHANGES"),- ).not.toBeInTheDocument();- });-- it("should render the Protip alongside the empty state when there are no changes", () => {- vi.mocked(useUnifiedGetGitChanges).mockReturnValue({- data: [],- isLoading: false,- isFetching: false,- isSuccess: true,- isError: false,- error: null,- refetch: vi.fn(),- });- vi.mocked(useAgentState).mockReturnValue({- curAgentState: AgentState.RUNNING,- });-- render(<GitChanges />, { wrapper });-- expect(screen.getByText("TIPS$PROTIP")).toBeInTheDocument();- });-- it("should hide the Protip when the git changes request errors", () => {- vi.mocked(useUnifiedGetGitChanges).mockReturnValue({- data: [],- isLoading: false,- isFetching: false,- isSuccess: false,- isError: true,- error: new AxiosError("fatal: not a git repository"),- refetch: vi.fn(),- });- vi.mocked(useAgentState).mockReturnValue({- curAgentState: AgentState.RUNNING,- });-- render(<GitChanges />, { wrapper });-- expect(screen.queryByText("TIPS$PROTIP")).not.toBeInTheDocument();- expect(- screen.getByText("DIFF_VIEWER$NOT_A_GIT_REPO"),- ).toBeInTheDocument();- });-- it("should show the loading message while git changes are loading", () => {- vi.mocked(useUnifiedGetGitChanges).mockReturnValue({- data: [],- isLoading: true,- isFetching: true,- isSuccess: false,- isError: false,- error: null,- refetch: vi.fn(),- });- vi.mocked(useAgentState).mockReturnValue({- curAgentState: AgentState.RUNNING,- });-- render(<GitChanges />, { wrapper });-- expect(screen.getByText("DIFF_VIEWER$LOADING")).toBeInTheDocument();- });-});diff --git a/__tests__/routes/commits-tab.test.tsx b/__tests__/routes/commits-tab.test.tsxindex 37872f092f..683d821970 100644--- a/__tests__/routes/commits-tab.test.tsx+++ b/__tests__/routes/commits-tab.test.tsx@@ -55,10 +55,13 @@ describe("Commits Tab", () => {AgentServerGitService,"getCommitChanges",);+ const getGitChangesSpy = vi.spyOn(AgentServerGitService, "getGitChanges");beforeEach(() => {getGitCommitsSpy.mockReset();getCommitChangesSpy.mockReset();+ getGitChangesSpy.mockReset();+ getGitChangesSpy.mockResolvedValue([]);vi.mocked(useAgentState).mockReturnValue({curAgentState: AgentState.RUNNING,});@@ -112,6 +115,22 @@ describe("Commits Tab", () => {expect(await screen.findByText("add logging")).toBeInTheDocument();expect(screen.getByText("fix tests")).toBeInTheDocument();expect(screen.getByText("aaaaaaa")).toBeInTheDocument();+ expect(screen.getByTestId("uncommitted-changes-row")).toBeInTheDocument();+ });++ it("shows Uncommitted alone when there are working-tree changes but no commits", async () => {+ // Arrange+ getGitCommitsSpy.mockResolvedValue({ commits: [], hasMore: false });+ getGitChangesSpy.mockResolvedValue([{ path: "src/a.ts", status: "M" }]);++ // Act+ render(<GitCommits />, { wrapper });++ // Assert+ expect(+ await screen.findByTestId("uncommitted-changes-row"),+ ).toBeInTheDocument();+ expect(screen.queryByTestId("commit-row")).not.toBeInTheDocument();});it("expanding a commit fetches and lists the files it changed", async () => {diff --git a/__tests__/routes/files-tab.test.tsx b/__tests__/routes/files-tab.test.tsxindex 0cbaed3638..27afdf3f24 100644--- a/__tests__/routes/files-tab.test.tsx+++ b/__tests__/routes/files-tab.test.tsx@@ -1,5 +1,4 @@-/* eslint-disable react/jsx-props-no-spreading */-import { render, screen, waitFor, within } from "@testing-library/react";+import { render, screen, waitFor } from "@testing-library/react";import userEvent from "@testing-library/user-event";import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { describe, it, expect, vi, beforeEach } from "vitest";@@ -8,28 +7,15 @@ import { MemoryRouter } from "react-router";import FilesTab from "#/routes/files-tab";import { useFilesTabStore } from "#/stores/files-tab-store";import { NavigationProvider } from "#/context/navigation-context";+import {+ LOCAL_STORAGE_KEYS,+ setConversationState,+} from "#/utils/conversation-local-storage";// Mocks must be declared before the SUT is imported.-const useHasAttachedSourceMock = vi.fn();-const useHasGitCommitsMock = vi.fn();-const useUnifiedGitCommitsMock = vi.fn();const useWorkspaceFilesMock = vi.fn();const useWorkspaceFileContentMock = vi.fn();const useActiveConversationMock = vi.fn();-const refetchGitChangesMock = vi.fn();--vi.mock("#/hooks/use-has-attached-source", () => ({- useHasAttachedSource: () => useHasAttachedSourceMock(),-}));--vi.mock("#/hooks/query/use-has-git-commits", () => ({- useHasGitCommits: (opts?: { enabled?: boolean }) =>- useHasGitCommitsMock(opts),-}));--vi.mock("#/hooks/query/use-unified-git-commits", () => ({- useUnifiedGitCommits: () => useUnifiedGitCommitsMock(),-}));vi.mock("#/hooks/query/use-workspace-files", () => ({useWorkspaceFiles: () => useWorkspaceFilesMock(),@@ -44,21 +30,6 @@ vi.mock("#/hooks/query/use-active-conversation", () => ({useActiveConversation: () => useActiveConversationMock(),}));-vi.mock("#/hooks/query/use-unified-get-git-changes", () => ({- useUnifiedGetGitChanges: () => ({- refetch: refetchGitChangesMock,- isFetching: false,- }),-}));--vi.mock("#/routes/changes-tab", () => ({- default: () => <div data-testid="changes-tab-content">Diff View</div>,-}));--vi.mock("#/routes/commits-tab", () => ({- default: () => <div data-testid="commits-tab-content">Commits View</div>,-}));-function renderTab(conversationId: string | null = null) {const client = new QueryClient({defaultOptions: { queries: { retry: false } },@@ -81,43 +52,22 @@ function renderTab(conversationId: string | null = null) {);}+function openFile(path: string, conversationId: string | null = null) {+ useFilesTabStore.getState().setSelectedPath(path, conversationId);+}+describe("FilesTab", () => {beforeEach(() => {- // `selectedPath` lives in a global Zustand store (useFilesTabStore) and- // the auto-select effect re-fires when the store is reset between tests,- // which can race with the Zustand mock's afterEach reset and leave the- // store polluted with the previous test's path. Resetting here, after- // the previous test's cleanup() has unmounted any FilesTab, defeats- // that race so each test starts with a clean selection.useFilesTabStore.setState({selectedPath: null,selectedConversationId: null,+ openPaths: [],});+ localStorage.clear();- useHasAttachedSourceMock.mockReset();- useHasGitCommitsMock.mockReset();- useUnifiedGitCommitsMock.mockReset();useWorkspaceFilesMock.mockReset();useWorkspaceFileContentMock.mockReset();useActiveConversationMock.mockReset();- refetchGitChangesMock.mockReset();- // Default: pretend the probe has already resolved with at least one- // commit. Individual tests can override this for "empty repo" cases.- useHasGitCommitsMock.mockReturnValue({- hasCommits: true,- isLoading: false,- });- // Default: the agent server supports the commits API (the third toggle- // segment is offered) but the conversation has no commits yet.- useUnifiedGitCommitsMock.mockReturnValue({- commits: [],- hasMore: false,- isUnsupported: false,- isLoading: false,- isFetching: false,- isSuccess: true,- isError: false,- });useWorkspaceFilesMock.mockReturnValue({data: ["index.html", "src/main.ts", "README.md"],@@ -142,93 +92,29 @@ describe("FilesTab", () => {});});- it("defaults to diff view when the user attached a source (repo or workspace)", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });-+ it("renders the file browser without a Diff/Commits toggle", () => {renderTab();- expect(screen.getByTestId("changes-tab-content")).toBeInTheDocument();- // The Rich/Plain toggle is hidden when diff view is active.+ expect(screen.getByTestId("files-tab")).toBeInTheDocument();expect(screen.queryByTestId("files-tab-content-mode-toggle"),).not.toBeInTheDocument();- });-- it("defaults to files+rich view when the attached source has no commits (non-git workspace or unborn HEAD)", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });- useHasGitCommitsMock.mockReturnValue({- hasCommits: false,- isLoading: false,- });-- renderTab();-- // Even though something is attached, the diff view is suppressed when- // there's nothing to diff against.- expect(screen.queryByTestId("changes-tab-content")).not.toBeInTheDocument();expect(- screen.getByTestId("files-tab-content-mode-toggle"),- ).toBeInTheDocument();- });-- it("does NOT probe for commits when no source is attached", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });-- renderTab();-- // The hook is still called (so the diff toggle has a value), but it- // must be called with enabled: false so we don't shell out to the- // workspace pointlessly.- expect(useHasGitCommitsMock).toHaveBeenCalledWith({ enabled: false });- });-- it("optimistically defaults to diff view while the attachment / has-commits probes are still loading", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });- useHasGitCommitsMock.mockReturnValue({- hasCommits: null,- isLoading: true,- });-- renderTab();-- // The common case is a repo with commits, so to avoid a files→diff- // flash on initial mount we lean diff-view while loading.- expect(screen.getByTestId("changes-tab-content")).toBeInTheDocument();+ screen.queryByTestId("files-tab-diff-toggle"),+ ).not.toBeInTheDocument();});- it("defaults to plain file viewer when no source is attached", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });-+ it("does not open file tabs until a file is selected", () => {renderTab();- expect(screen.queryByTestId("changes-tab-content")).not.toBeInTheDocument();- // Tree is collapsed by default — user expands via the caret.- expect(screen.queryByTestId("files-tab-tree")).not.toBeInTheDocument();+ expect(useWorkspaceFileContentMock).toHaveBeenCalledWith(null);+ expect(screen.queryByRole("tab")).not.toBeInTheDocument();expect(- screen.getByTestId("files-tab-content-mode-toggle"),+ screen.getByTestId("file-quick-row-tree-toggle"),).toBeInTheDocument();});- it("shows the active conversation workspace path in files view", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });+ it("shows the active conversation workspace path", () => {useActiveConversationMock.mockReturnValue({data: {workspace: { working_dir: "/workspace/project/worktree-123" },@@ -242,48 +128,44 @@ describe("FilesTab", () => {).toHaveTextContent("/workspace/project/worktree-123");});- it("lets users toggle diff view off even when a source is attached", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });+ it("opens a tab when a file is selected and closes it from the tab strip", async () => {const user = userEvent.setup();-+ openFile("src/main.ts");renderTab();- expect(screen.getByTestId("changes-tab-content")).toBeInTheDocument();+ expect(+ screen.getByTestId("file-quick-row-item-src/main.ts"),+ ).toBeInTheDocument();+ expect(screen.getByRole("tab", { selected: true })).toHaveTextContent(+ "main.ts",+ );- // Click the "Files" segment of the diff-view toggle.- await user.click(screen.getByTestId("files-tab-diff-toggle-option-off"));+ await user.click(screen.getByTestId("file-quick-row-close-src/main.ts"));- await waitFor(() => {- expect(- screen.queryByTestId("changes-tab-content"),- ).not.toBeInTheDocument();- });- // Quick-row toggle exists and the file-viewer area is shown.expect(- screen.getByTestId("file-quick-row-tree-toggle"),- ).toBeInTheDocument();+ screen.queryByTestId("file-quick-row-item-src/main.ts"),+ ).not.toBeInTheDocument();+ expect(useFilesTabStore.getState().selectedPath).toBeNull();+ expect(useFilesTabStore.getState().openPaths).toEqual([]);});- it("auto-selects the highest-priority file on first render", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });-+ it("keeps vertical edges on every open tab", () => {+ openFile("README.md");+ openFile("src/main.ts");renderTab();- // Either index.html (top-priority entrypoint) should be selected.- expect(useWorkspaceFileContentMock).toHaveBeenCalledWith("index.html");+ const firstTab = screen.getByTestId(+ "file-quick-row-item-README.md",+ ).parentElement;+ const secondTab = screen.getByTestId(+ "file-quick-row-item-src/main.ts",+ ).parentElement;+ expect(firstTab).toHaveClass("border-l");+ expect(firstTab).toHaveClass("border-r");+ expect(secondTab).toHaveClass("border-r");});it("renders the binary fallback in plain mode for binary files", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });useWorkspaceFileContentMock.mockReturnValue({data: {path: "logo.png",@@ -298,6 +180,7 @@ describe("FilesTab", () => {});const user = userEvent.setup();+ openFile("logo.png");renderTab();await user.click(@@ -309,45 +192,56 @@ describe("FilesTab", () => {).toBeInTheDocument();});- it("shows full file paths (not just basenames) as quick-row pills", () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });-+ it("shows the file name (not the full path) on quick-row tabs", () => {+ openFile("src/main.ts");renderTab();- // The pill for src/main.ts should display the full relative path.- const pill = screen.getByTestId("file-quick-row-item-src/main.ts");- expect(pill).toHaveTextContent("src/main.ts");+ const tab = screen.getByTestId("file-quick-row-item-src/main.ts");+ expect(tab).toHaveTextContent("main.ts");+ expect(tab).toHaveAttribute("title", "src/main.ts");+ expect(tab).toHaveAttribute("role", "tab");});- it("collapses the file tree by default and expands it via the caret", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });+ it("shows the file tree by default and collapses it via the caret", async () => {const user = userEvent.setup();renderTab();- // Hidden by default.+ expect(screen.getByTestId("files-tab-tree")).toBeInTheDocument();++ await user.click(screen.getByTestId("file-quick-row-tree-toggle"));expect(screen.queryByTestId("files-tab-tree")).not.toBeInTheDocument();await user.click(screen.getByTestId("file-quick-row-tree-toggle"));expect(screen.getByTestId("files-tab-tree")).toBeInTheDocument();+ });- await user.click(screen.getByTestId("file-quick-row-tree-toggle"));- expect(screen.queryByTestId("files-tab-tree")).not.toBeInTheDocument();+ it("exposes a grippable resize handle on the tree's right edge when expanded", () => {+ window.localStorage.clear();++ renderTab();++ expect(+ screen.getByTestId("files-tab-tree-resize-handle"),+ ).toBeInTheDocument();+ expect(screen.getByTestId("files-tab-tree")).toHaveStyle({+ width: "224px",+ });+ });++ it("opens a tab from the file tree when a file is clicked", async () => {+ const user = userEvent.setup();+ renderTab();++ await user.click(screen.getByTestId("file-tree-file-README.md"));++ expect(useFilesTabStore.getState().openPaths).toContain("README.md");+ expect(+ screen.getByTestId("file-quick-row-item-README.md"),+ ).toBeInTheDocument();});it("renders markdown content via MarkdownRenderer in rich mode", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });- // Only expose a markdown file so it is auto-selected as the first- // priority entry.useWorkspaceFilesMock.mockReturnValue({data: ["README.md"],isLoading: false,@@ -365,6 +259,7 @@ describe("FilesTab", () => {isError: false,});+ openFile("README.md");renderTab();await waitFor(() => {@@ -373,26 +268,13 @@ describe("FilesTab", () => {).toBeInTheDocument();});- // react-markdown turns "# Hello" into an <h1>.expect(screen.getByRole("heading", { level: 1, name: "Hello" }),).toBeInTheDocument();expect(screen.getByText("bold").tagName.toLowerCase()).toBe("strong");- // Markdown rendering uses MarkdownRenderer, not an iframe.- expect(- screen.queryByTestId("file-content-viewer-iframe"),- ).not.toBeInTheDocument();- // The rich-rendered markdown container is mounted.- expect(- screen.getByTestId("file-content-viewer-markdown"),- ).toBeInTheDocument();});it("shows highlighted source (not rich markdown) when toggled to plain on a .md", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });useWorkspaceFilesMock.mockReturnValue({data: ["README.md"],isLoading: false,@@ -411,10 +293,9 @@ describe("FilesTab", () => {});const user = userEvent.setup();+ openFile("README.md");renderTab();- // Toggle to plain — markdown source should now be syntax-highlighted- // as `markdown`, not rendered.await user.click(screen.getByTestId("files-tab-content-mode-toggle-option-plain"),);@@ -423,17 +304,12 @@ describe("FilesTab", () => {"file-content-viewer-highlighted",);expect(highlighted.getAttribute("data-language")).toBe("markdown");- // Confirm the rich-rendered <h1> is gone.expect(screen.queryByRole("heading", { level: 1, name: "Hello" }),).not.toBeInTheDocument();});it("uses the workspace fileserver URL as the iframe src for HTML files", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });useWorkspaceFilesMock.mockReturnValue({data: ["index.html"],isLoading: false,@@ -452,31 +328,15 @@ describe("FilesTab", () => {isError: false,});+ openFile("index.html");renderTab();const iframe = await screen.findByTestId("file-content-viewer-iframe");- expect(iframe).toBeInTheDocument();- // The iframe src points at the workspace fileserver so relative- // asset references (`<link href="style.css">` etc.) resolve to- // sibling files. The `?v=<mutation-counter>` suffix is the- // cache-buster appended by the viewer so the browser re-fetches- // after each agent-side edit.expect(iframe).toHaveAttribute("src", `${staticUrl}?v=0`);- // The iframe is sandboxed with `allow-same-origin` only: `<script>` /- // inline event handlers inside the previewed file are inert. We deliberately- // do NOT add `allow-scripts` — a workspace HTML file's scripts must not run- // in the canvas's context.expect(iframe).toHaveAttribute("sandbox", "allow-same-origin");});it("switches between rich and plain content modes", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });- // Only `src/main.ts` is exposed so it auto-selects (otherwise the- // priority sort picks `index.html` first and the assertion below- // would see the markup grammar instead).useWorkspaceFilesMock.mockReturnValue({data: ["src/main.ts"],isLoading: false,@@ -495,15 +355,12 @@ describe("FilesTab", () => {});const user = userEvent.setup();+ openFile("src/main.ts");renderTab();await user.click(screen.getByTestId("files-tab-content-mode-toggle-option-plain"),);- // `src/main.ts` resolves to a Prism grammar (`typescript`), so the- // plain view is a syntax-highlighted source view rather than a raw- // `<pre>`. We assert the highlighted container and its data-language- // attribute as a regression guard.const highlighted = await screen.findByTestId("file-content-viewer-highlighted",);@@ -511,45 +368,101 @@ describe("FilesTab", () => {expect(highlighted.getAttribute("data-language")).toBe("typescript");});- it("shows the refresh button inside the files-tab toolbar and triggers a refetch", async () => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });- const user = userEvent.setup();-+ it("shows refresh on the file quick-row", () => {+ openFile("index.html");renderTab();+ const quickRow = screen.getByTestId("file-quick-row");const refresh = screen.getByTestId("files-tab-refresh");- expect(refresh).toBeInTheDocument();- // The button should describe its *action* (refresh), not the surrounding- // section name ("Files") — the old `COMMON$FILES` aria-label was- // ambiguous for screen-reader users who couldn't see the refresh icon.+ expect(quickRow).toContainElement(refresh);expect(refresh).toHaveAttribute("aria-label", "FILES$REFRESH");- await user.click(refresh);- expect(refetchGitChangesMock).toHaveBeenCalledTimes(1);});- // Regression coverage for issue #1350: a file selected in one conversation- // must not survive into another. The selection is global (Zustand) but- // scoped to its conversation; the files tab ignores a path owned by a- // different conversation so it never tries to open a file that only exists- // in the previous conversation's workspace.- describe("conversation switching", () => {- beforeEach(() => {- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: false,- isLoading: false,- });+ it("persists and restores open files plus tree visibility across remount", async () => {+ const conversationId = "persist-files-conv";+ const user = userEvent.setup();+ const { unmount } = renderTab(conversationId);++ await user.click(screen.getByTestId("file-quick-row-tree-toggle"));+ openFile("README.md", conversationId);+ openFile("src/main.ts", conversationId);++ await waitFor(() => {+ const raw = localStorage.getItem(+ `${LOCAL_STORAGE_KEYS.CONVERSATION_STATE}-${conversationId}`,+ );+ expect(raw).toBeTruthy();+ const stored = JSON.parse(raw as string);+ expect(stored.filesTabTreeVisible).toBe(false);+ expect(stored.filesTabOpenPaths).toEqual(["README.md", "src/main.ts"]);+ expect(stored.filesTabSelectedPath).toBe("src/main.ts");});- it("ignores a stale selection from another conversation and auto-selects this conversation's file", async () => {- // demo.html was opened in conversation A and only exists there.+ // Simulate a full reload: empty in-memory store, remount the tab.+ unmount();+ useFilesTabStore.setState({+ selectedPath: null,+ selectedConversationId: null,+ openPaths: [],+ });+ renderTab(conversationId);++ await waitFor(() => {+ expect(useFilesTabStore.getState().openPaths).toEqual([+ "README.md",+ "src/main.ts",+ ]);+ });+ expect(screen.getByRole("tab", { selected: true })).toHaveTextContent(+ "main.ts",+ );+ expect(screen.queryByTestId("files-tab-tree")).not.toBeInTheDocument();+ });++ it("hydrates open files from conversation localStorage on first mount", async () => {+ const conversationId = "hydrate-files-conv";+ setConversationState(conversationId, {+ filesTabOpenPaths: ["README.md"],+ filesTabSelectedPath: "README.md",+ filesTabTreeVisible: true,+ });++ renderTab(conversationId);++ await waitFor(() => {+ expect(+ screen.getByTestId("file-quick-row-item-README.md"),+ ).toBeInTheDocument();+ });+ expect(screen.getByTestId("files-tab-tree")).toBeInTheDocument();+ });++ it("shows the Rich/Plain toggle only when a file is open", async () => {+ renderTab();++ expect(+ screen.queryByTestId("files-tab-content-mode-toggle"),+ ).not.toBeInTheDocument();++ openFile("index.html");++ const modeToggle = await screen.findByTestId(+ "files-tab-content-mode-toggle",+ );+ const content = screen.getByTestId("files-tab-content");+ expect(content).toContainElement(modeToggle);+ expect(content).toContainElement(+ screen.getByTestId("files-tab-open-in-new-window"),+ );+ });++ describe("conversation switching", () => {+ it("ignores a stale selection from another conversation", async () => {useFilesTabStore.setState({selectedPath: "demo.html",selectedConversationId: "conv-a",+ openPaths: ["demo.html"],});- // Conversation B's workspace does not contain demo.html.useWorkspaceFilesMock.mockReturnValue({data: ["app.html"],isLoading: false,@@ -557,25 +470,18 @@ describe("FilesTab", () => {renderTab("conv-b");- // The stale demo.html is never requested; B auto-selects its own file.await waitFor(() => {- expect(useWorkspaceFileContentMock).toHaveBeenCalledWith("app.html");+ expect(useWorkspaceFileContentMock).toHaveBeenCalledWith(null);});expect(useWorkspaceFileContentMock).not.toHaveBeenCalledWith("demo.html");-- // The store ownership flips to the active conversation.- await waitFor(() => {- const state = useFilesTabStore.getState();- expect(state.selectedPath).toBe("app.html");- expect(state.selectedConversationId).toBe("conv-b");- });+ expect(screen.queryByRole("tab")).not.toBeInTheDocument();});- it("preserves a selection that belongs to the current conversation (explicit navigate_to_file)", async () => {- // canvas_ui navigated this conversation to report.html outside React.+ it("preserves a selection that belongs to the current conversation", async () => {useFilesTabStore.setState({selectedPath: "report.html",selectedConversationId: "conv-b",+ openPaths: ["report.html"],});useWorkspaceFilesMock.mockReturnValue({data: ["report.html", "app.html"],@@ -584,14 +490,17 @@ describe("FilesTab", () => {renderTab("conv-b");- // The explicit selection is honored and auto-select does not override it.await waitFor(() => {expect(useWorkspaceFileContentMock).toHaveBeenCalledWith("report.html");});expect(useFilesTabStore.getState().selectedPath).toBe("report.html");+ expect(+ screen.getByTestId("file-quick-row-item-report.html"),+ ).toBeInTheDocument();});- it("drops the selection when the tab switches to a different conversation", async () => {+ it("clears open tabs when the tab switches to a different conversation", async () => {+ openFile("demo.html", "conv-a");useWorkspaceFilesMock.mockReturnValue({data: ["demo.html"],isLoading: false,@@ -599,13 +508,11 @@ describe("FilesTab", () => {const { rerender } = renderTab("conv-a");- // Conversation A auto-selects and owns demo.html.await waitFor(() => {expect(useFilesTabStore.getState().selectedPath).toBe("demo.html");});- expect(useFilesTabStore.getState().selectedConversationId).toBe("conv-a");+ expect(useFilesTabStore.getState().openPaths).toEqual(["demo.html"]);- // Switch the mounted tab to conversation B, whose workspace has app.html.useWorkspaceFileContentMock.mockClear();useWorkspaceFilesMock.mockReturnValue({data: ["app.html"],@@ -631,102 +538,43 @@ describe("FilesTab", () => {</MemoryRouter>,);- // After the switch the tab follows B and never re-requests demo.html.await waitFor(() => {- expect(useFilesTabStore.getState().selectedPath).toBe("app.html");+ expect(useFilesTabStore.getState().selectedPath).toBeNull();});+ expect(useFilesTabStore.getState().openPaths).toEqual([]);expect(useFilesTabStore.getState().selectedConversationId).toBe("conv-b");expect(useWorkspaceFileContentMock).not.toHaveBeenCalledWith("demo.html");});});+});- describe("commits view", () => {- it("offers the Commits toggle option when the server supports the commits API", () => {- // Arrange — beforeEach default: commits supported.- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });-- // Act- renderTab();-- // Assert- expect(- screen.getByTestId("files-tab-diff-toggle-option-commits"),- ).toBeInTheDocument();- });-- it("hides the Commits toggle option against an older agent server", () => {- // Arrange — the commits endpoint 404'd: server too old.- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });- useUnifiedGitCommitsMock.mockReturnValue({- commits: [],- hasMore: false,- isUnsupported: true,- isLoading: false,- isFetching: false,- isSuccess: true,- isError: false,- });-- // Act- renderTab();-- // Assert- expect(- screen.queryByTestId("files-tab-diff-toggle-option-commits"),- ).not.toBeInTheDocument();- });-- it("renders the Commits option between Diff and Files", () => {- // Arrange — beforeEach default: commits supported.- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });-- // Act- renderTab();-- // Assert — Commits sits beside Diff, ahead of Files: Diff → Commits → Files.- const toggle = screen.getByTestId("files-tab-diff-toggle");- const order = within(toggle)- .getAllByRole("radio")- .map((option) => option.getAttribute("data-testid"));- expect(order).toEqual([- "files-tab-diff-toggle-option-on",- "files-tab-diff-toggle-option-commits",- "files-tab-diff-toggle-option-off",- ]);+describe("useFilesTabStore open tabs", () => {+ beforeEach(() => {+ useFilesTabStore.setState({+ selectedPath: null,+ selectedConversationId: null,+ openPaths: [],});+ });- it("switches the panel to the commits view when the Commits option is selected", async () => {- // Arrange- const user = userEvent.setup();- useHasAttachedSourceMock.mockReturnValue({- hasAttachedSource: true,- isLoading: false,- });- renderTab();-- // Act- await user.click(- screen.getByTestId("files-tab-diff-toggle-option-commits"),- );-- // Assert — the commits view replaces the diff view; the file-browser- // controls (Rich/Plain) stay hidden.- expect(screen.getByTestId("commits-tab-content")).toBeInTheDocument();- expect(- screen.queryByTestId("changes-tab-content"),- ).not.toBeInTheDocument();- expect(- screen.queryByTestId("files-tab-content-mode-toggle"),- ).not.toBeInTheDocument();- });+ it("appends newly opened paths and selects a neighbor on close", () => {+ const { setSelectedPath, closeOpenPath } = useFilesTabStore.getState();++ setSelectedPath("a.ts", "c1");+ setSelectedPath("b.ts", "c1");+ setSelectedPath("c.ts", "c1");+ expect(useFilesTabStore.getState().openPaths).toEqual([+ "a.ts",+ "b.ts",+ "c.ts",+ ]);++ closeOpenPath("b.ts");+ expect(useFilesTabStore.getState().openPaths).toEqual(["a.ts", "c.ts"]);+ // Closing the active middle tab selects the right neighbor.+ expect(useFilesTabStore.getState().selectedPath).toBe("c.ts");++ closeOpenPath("c.ts");+ expect(useFilesTabStore.getState().selectedPath).toBe("a.ts");});});diff --git a/__tests__/utils/conversation-overview-project-scope.test.ts b/__tests__/utils/conversation-overview-project-scope.test.tsnew file mode 100644index 0000000000..87f6888eb6--- /dev/null+++ b/__tests__/utils/conversation-overview-project-scope.test.ts@@ -0,0 +1,130 @@+import { describe, expect, it } from "vitest";+import type { Automation } from "#/types/automation";+import type { SkillInfo } from "#/types/settings";+import {+ CONVERSATION_OVERVIEW_PROJECT_SCOPE,+ countAutomationsForRepository,+ countSkillsForProject,+ filterAutomationsByProjectScope,+ filterSkillsByProjectScope,+ isAutomationForRepository,+ sortAutomationsByProjectRelevance,+ sortSkillsByProjectRelevance,+} from "#/utils/conversation-overview-project-scope";++function buildAutomation(+ overrides: Partial<Automation> & Pick<Automation, "id" | "name">,+): Automation {+ return {+ trigger: { type: "cron", schedule: "0 * * * *" },+ enabled: true,+ created_at: "2026-01-01T00:00:00Z",+ updated_at: "2026-01-01T00:00:00Z",+ prompt: null,+ ...overrides,+ };+}++function buildSkill(+ overrides: Partial<SkillInfo> & Pick<SkillInfo, "name">,+): SkillInfo {+ return {+ type: "knowledge",+ source: "public",+ description: null,+ triggers: [],+ license: null,+ compatibility: null,+ metadata: null,+ allowed_tools: null,+ is_agentskills_format: true,+ disable_model_invocation: false,+ ...overrides,+ };+}++describe("conversation overview project scope", () => {+ it("matches automations to the open repository case-insensitively", () => {+ expect(+ isAutomationForRepository(+ buildAutomation({+ id: "1",+ name: "A",+ repository: "OpenHands/Agent-Canvas.git",+ }),+ "openhands/agent-canvas",+ ),+ ).toBe(true);+ expect(+ isAutomationForRepository(+ buildAutomation({ id: "2", name: "B", repository: "other/repo" }),+ "openhands/agent-canvas",+ ),+ ).toBe(false);+ expect(+ isAutomationForRepository(+ buildAutomation({ id: "3", name: "C" }),+ "openhands/agent-canvas",+ ),+ ).toBe(false);+ });++ it("filters and sorts automations for project vs all scopes", () => {+ const automations = [+ buildAutomation({ id: "1", name: "Zeta", repository: "other/repo" }),+ buildAutomation({+ id: "2",+ name: "Alpha",+ repository: "openhands/agent-canvas",+ }),+ buildAutomation({+ id: "3",+ name: "Beta",+ repository: "openhands/agent-canvas",+ }),+ ];++ expect(+ filterAutomationsByProjectScope(+ automations,+ CONVERSATION_OVERVIEW_PROJECT_SCOPE.project,+ "openhands/agent-canvas",+ ).map((automation) => automation.id),+ ).toEqual(["2", "3"]);++ expect(+ sortAutomationsByProjectRelevance(+ automations,+ "openhands/agent-canvas",+ ).map((automation) => automation.name),+ ).toEqual(["Alpha", "Beta", "Zeta"]);++ expect(+ countAutomationsForRepository(automations, "openhands/agent-canvas"),+ ).toBe(2);+ });++ it("filters and sorts skills with project skills first", () => {+ const skills = [+ buildSkill({ name: "public-z", source: "public" }),+ buildSkill({ name: "project-a", source: "project" }),+ buildSkill({ name: "personal-b", source: "user" }),+ ];++ expect(+ filterSkillsByProjectScope(+ skills,+ CONVERSATION_OVERVIEW_PROJECT_SCOPE.project,+ "/workspace/demo",+ ).map((skill) => skill.name),+ ).toEqual(["project-a"]);++ expect(+ sortSkillsByProjectRelevance(skills, "/workspace/demo").map(+ (skill) => skill.name,+ ),+ ).toEqual(["project-a", "personal-b", "public-z"]);++ expect(countSkillsForProject(skills, "/workspace/demo")).toBe(1);+ });+});diff --git a/scripts/check-translation-completeness.cjs b/scripts/check-translation-completeness.cjsindex 30df95d5b7..0baeba37a0 100755--- a/scripts/check-translation-completeness.cjs+++ b/scripts/check-translation-completeness.cjs@@ -26,6 +26,10 @@ const IDENTICAL_VALUE_ALLOWLIST = new Set(['COMMAND_MENU$SHORTCUT','CONVERSATION$ACP_AGENT_GENERIC','CONVERSATION$BUDGET_USAGE_FORMAT',+ 'CONVERSATION$OVERVIEW_DIFF_ADDITIONS',+ 'CONVERSATION$OVERVIEW_DIFF_DELETIONS',+ 'CONVERSATION$OVERVIEW_GIT',+ 'CONVERSATION$OVERVIEW_UNAVAILABLE','CONVERSATION_PANEL$PREVIEW_GIT','FILES$VSCODE','GITHUB$AUTH_SCOPE',diff --git a/src/api/git-provider-items-service.ts b/src/api/git-provider-items-service.tsnew file mode 100644index 0000000000..9b98af6778--- /dev/null+++ b/src/api/git-provider-items-service.ts@@ -0,0 +1,290 @@+import { SettingsClient } from "@openhands/typescript-client/clients";+import { getAgentServerClientOptions } from "#/api/agent-server-client-options";+import { SecretsService } from "#/api/secrets-service";+import { getActiveBackend } from "#/api/backend-registry/active-store";+import type { Provider } from "#/types/settings";+import { constructPullRequestUrl, getGitProviderBaseUrl } from "#/utils/utils";++export interface GitProviderItem {+ id: number;+ number: number;+ title: string;+ url: string;+ authorLogin: string | null;+ updatedAt: string | null;+}++const PROVIDER_TOKEN_SECRET_CANDIDATES: Partial<Record<Provider, string[]>> = {+ github: ["GITHUB_TOKEN", "GH_TOKEN", "github"],+ gitlab: ["GITLAB_TOKEN", "GL_TOKEN", "gitlab"],+ bitbucket: ["BITBUCKET_TOKEN", "bitbucket"],+ forgejo: ["FORGEJO_TOKEN", "forgejo"],+};++const LIST_LIMIT = 30;++async function resolveProviderToken(+ provider: Provider,+): Promise<string | null> {+ // Cloud backends keep provider tokens server-side; browser-side secret+ // lookup is only meaningful for the local agent-server secrets store.+ if (getActiveBackend().backend.kind !== "local") {+ return null;+ }++ const candidates = PROVIDER_TOKEN_SECRET_CANDIDATES[provider] ?? [];+ if (candidates.length === 0) {+ return null;+ }++ const secrets = await SecretsService.getSecrets();+ const available = new Set(secrets.map((secret) => secret.name));+ const match = candidates.find((name) => available.has(name));+ if (!match) {+ return null;+ }++ try {+ return await new SettingsClient(getAgentServerClientOptions()).getSecret(+ match,+ );+ } catch {+ return null;+ }+}++function constructIssueUrl(+ issueNumber: number,+ provider: Provider,+ repositoryName: string,+): string {+ const baseUrl = getGitProviderBaseUrl(provider);+ switch (provider) {+ case "gitlab":+ return `${baseUrl}/${repositoryName}/-/issues/${issueNumber}`;+ case "bitbucket":+ return `${baseUrl}/${repositoryName}/issues/${issueNumber}`;+ case "forgejo":+ return `${baseUrl}/${repositoryName}/issues/${issueNumber}`;+ case "github":+ default:+ return `${baseUrl}/${repositoryName}/issues/${issueNumber}`;+ }+}++function constructIssuesListUrl(+ provider: Provider,+ repositoryName: string,+): string {+ const baseUrl = getGitProviderBaseUrl(provider);+ switch (provider) {+ case "gitlab":+ return `${baseUrl}/${repositoryName}/-/issues`;+ case "bitbucket":+ return `${baseUrl}/${repositoryName}/issues`;+ case "forgejo":+ return `${baseUrl}/${repositoryName}/issues`;+ case "github":+ default:+ return `${baseUrl}/${repositoryName}/issues`;+ }+}++function constructPullRequestsListUrl(+ provider: Provider,+ repositoryName: string,+): string {+ const baseUrl = getGitProviderBaseUrl(provider);+ switch (provider) {+ case "gitlab":+ return `${baseUrl}/${repositoryName}/-/merge_requests`;+ case "bitbucket":+ return `${baseUrl}/${repositoryName}/pull-requests`;+ case "forgejo":+ return `${baseUrl}/${repositoryName}/pulls`;+ case "github":+ default:+ return `${baseUrl}/${repositoryName}/pulls`;+ }+}++async function fetchGithubJson<T>(+ path: string,+ token: string | null,+): Promise<T> {+ const headers: Record<string, string> = {+ Accept: "application/vnd.github+json",+ "X-GitHub-Api-Version": "2022-11-28",+ };+ if (token) {+ headers.Authorization = `Bearer ${token}`;+ }++ const response = await fetch(`https://api.github.com${path}`, { headers });+ if (!response.ok) {+ throw new Error(`GitHub API ${response.status}`);+ }+ return response.json() as Promise<T>;+}++async function fetchGitlabJson<T>(+ path: string,+ token: string | null,+): Promise<T> {+ const headers: Record<string, string> = {+ Accept: "application/json",+ };+ if (token) {+ headers["PRIVATE-TOKEN"] = token;+ }++ // gitlab.com's public REST API — an external host, not the agent-server+ // `/api` surface the rule guards (its `/api/v4` prefix just trips the+ // substring heuristic; the companion no-direct-agent-server-calls test+ // matches only relative `/api/...` URLs and is not affected).+ // eslint-disable-next-line local/no-direct-agent-server-fetch+ const response = await fetch(`https://gitlab.com/api/v4${path}`, { headers });+ if (!response.ok) {+ throw new Error(`GitLab API ${response.status}`);+ }+ return response.json() as Promise<T>;+}++type GithubIssueOrPr = {+ id: number;+ number: number;+ title: string;+ html_url: string;+ user?: { login?: string } | null;+ updated_at?: string | null;+ pull_request?: unknown;+};++type GitlabMergeRequest = {+ id: number;+ iid: number;+ title: string;+ web_url: string;+ author?: { username?: string } | null;+ updated_at?: string | null;+};++type GitlabIssue = {+ id: number;+ iid: number;+ title: string;+ web_url: string;+ author?: { username?: string } | null;+ updated_at?: string | null;+};++/**+ * Lists open pull requests / merge requests and issues for a connected+ * repository by calling the provider's public REST API from the browser.+ * When a matching token secret exists locally (e.g. `GITHUB_TOKEN`), it is+ * used for auth so private repos work; otherwise public-repo unauthenticated+ * requests are attempted.+ */+export class GitProviderItemsService {+ static constructIssuesListUrl = constructIssuesListUrl;++ static constructPullRequestsListUrl = constructPullRequestsListUrl;++ static async listPullRequests(+ repository: string,+ provider: Provider,+ ): Promise<GitProviderItem[]> {+ const token = await resolveProviderToken(provider);++ if (provider === "gitlab") {+ const encoded = encodeURIComponent(repository);+ const items = await fetchGitlabJson<GitlabMergeRequest[]>(+ `/projects/${encoded}/merge_requests?state=opened&per_page=${LIST_LIMIT}`,+ token,+ );+ return items.map((item) => ({+ id: item.id,+ number: item.iid,+ title: item.title,+ url: item.web_url,+ authorLogin: item.author?.username ?? null,+ updatedAt: item.updated_at ?? null,+ }));+ }++ if (provider !== "github" && provider !== "forgejo") {+ return [];+ }++ const [owner, repo] = repository.split("/");+ if (!owner || !repo) {+ return [];+ }++ const items = await fetchGithubJson<GithubIssueOrPr[]>(+ `/repos/${owner}/${repo}/pulls?state=open&per_page=${LIST_LIMIT}`,+ token,+ );++ return items.map((item) => ({+ id: item.id,+ number: item.number,+ title: item.title,+ url:+ item.html_url ||+ constructPullRequestUrl(item.number, provider, repository),+ authorLogin: item.user?.login ?? null,+ updatedAt: item.updated_at ?? null,+ }));+ }++ static async listIssues(+ repository: string,+ provider: Provider,+ ): Promise<GitProviderItem[]> {+ const token = await resolveProviderToken(provider);++ if (provider === "gitlab") {+ const encoded = encodeURIComponent(repository);+ const items = await fetchGitlabJson<GitlabIssue[]>(+ `/projects/${encoded}/issues?state=opened&per_page=${LIST_LIMIT}`,+ token,+ );+ return items.map((item) => ({+ id: item.id,+ number: item.iid,+ title: item.title,+ url: item.web_url,+ authorLogin: item.author?.username ?? null,+ updatedAt: item.updated_at ?? null,+ }));+ }++ if (provider !== "github" && provider !== "forgejo") {+ return [];+ }++ const [owner, repo] = repository.split("/");+ if (!owner || !repo) {+ return [];+ }++ const items = await fetchGithubJson<GithubIssueOrPr[]>(+ `/repos/${owner}/${repo}/issues?state=open&per_page=${LIST_LIMIT}`,+ token,+ );++ // GitHub's issues endpoint also returns pull requests.+ return items+ .filter((item) => !item.pull_request)+ .map((item) => ({+ id: item.id,+ number: item.number,+ title: item.title,+ url:+ item.html_url || constructIssueUrl(item.number, provider, repository),+ authorLogin: item.user?.login ?? null,+ updatedAt: item.updated_at ?? null,+ }));+ }+}diff --git a/src/components/features/conversation/conversation-git-actions-menu.tsx b/src/components/features/conversation/conversation-git-actions-menu.tsxnew file mode 100644index 0000000000..135f890338--- /dev/null+++ b/src/components/features/conversation/conversation-git-actions-menu.tsx@@ -0,0 +1,166 @@+import React, { useLayoutEffect, useState } from "react";+import ReactDOM from "react-dom";+import { GitCommitHorizontal } from "lucide-react";+import { useTranslation } from "react-i18next";+import ArrowDownIcon from "#/icons/u-arrow-down.svg?react";+import ArrowUpIcon from "#/icons/u-arrow-up.svg?react";+import CodeBranchIcon from "#/icons/u-code-branch.svg?react";+import PrIcon from "#/icons/u-pr.svg?react";+import { useClickOutsideElement } from "#/hooks/use-click-outside-element";+import { useConversationStore } from "#/stores/conversation-store";+import { ContextMenu } from "#/ui/context-menu";+import { ContextMenuListItem } from "#/components/features/context-menu/context-menu-list-item";+import { ToolsContextMenuIconText } from "#/components/features/controls/tools-context-menu-icon-text";+import { I18nKey } from "#/i18n/declaration";+import {+ getCreateNewBranchPrompt,+ getCreatePRPrompt,+ getGitCommitPrompt,+ getGitPullPrompt,+ getGitPushPrompt,+} from "#/utils/utils";+import { Provider } from "#/types/settings";++const GIT_MENU_ITEM_CLASSNAME = "!w-auto whitespace-nowrap";++interface ConversationGitActionsMenuProps {+ anchorRef: React.RefObject<HTMLButtonElement | null>;+ onClose: () => void;+ gitProvider: Provider;+ /** Prefix for menu/item `data-testid` values (suffixes: -menu, -commit, …). */+ testIdPrefix?: string;+}++/**+ * Portaled dropdown of agent-prompt git actions (commit, pull, push, PR, branch).+ * Anchored under a trigger; shared by the overview diffs row and header toggle.+ */+export function ConversationGitActionsMenu({+ anchorRef,+ onClose,+ gitProvider,+ testIdPrefix = "conversation-git-actions",+}: ConversationGitActionsMenuProps) {+ const { t } = useTranslation("openhands");+ const menuRef = useClickOutsideElement<HTMLUListElement>(onClose);+ const setMessageToSend = useConversationStore(+ (state) => state.setMessageToSend,+ );+ const [portalStyle, setPortalStyle] = useState<React.CSSProperties>();++ useLayoutEffect(() => {+ const anchor = anchorRef.current;+ if (!anchor) {+ return undefined;+ }++ const updatePosition = () => {+ const rect = anchor.getBoundingClientRect();+ setPortalStyle({+ position: "fixed",+ top: rect.bottom + 4,+ right: window.innerWidth - rect.right,+ zIndex: 50,+ });+ };++ updatePosition();+ window.addEventListener("resize", updatePosition);+ window.addEventListener("scroll", updatePosition, true);+ return () => {+ window.removeEventListener("resize", updatePosition);+ window.removeEventListener("scroll", updatePosition, true);+ };+ }, [anchorRef]);++ const handleCommit = () => {+ setMessageToSend(getGitCommitPrompt());+ onClose();+ };++ const handlePull = () => {+ setMessageToSend(getGitPullPrompt());+ onClose();+ };++ const handlePush = () => {+ setMessageToSend(getGitPushPrompt(gitProvider));+ onClose();+ };++ const handleCreatePr = () => {+ setMessageToSend(getCreatePRPrompt(gitProvider));+ onClose();+ };++ const handleCreateNewBranch = () => {+ setMessageToSend(getCreateNewBranchPrompt());+ onClose();+ };++ if (!portalStyle) {+ return null;+ }++ return ReactDOM.createPortal(+ <ContextMenu+ ref={menuRef}+ testId={`${testIdPrefix}-menu`}+ theme="popover"+ style={portalStyle}+ className="w-max min-w-[8rem]"+ >+ <ContextMenuListItem+ testId={`${testIdPrefix}-commit`}+ onClick={handleCommit}+ className={GIT_MENU_ITEM_CLASSNAME}+ >+ <ToolsContextMenuIconText+ icon={<GitCommitHorizontal className="size-4" aria-hidden />}+ text={t(I18nKey.DIFF_VIEWER$COMMITS)}+ />+ </ContextMenuListItem>+ <ContextMenuListItem+ testId={`${testIdPrefix}-pull`}+ onClick={handlePull}+ className={GIT_MENU_ITEM_CLASSNAME}+ >+ <ToolsContextMenuIconText+ icon={<ArrowDownIcon width={16} height={16} aria-hidden />}+ text={t(I18nKey.COMMON$PULL)}+ />+ </ContextMenuListItem>+ <ContextMenuListItem+ testId={`${testIdPrefix}-push`}+ onClick={handlePush}+ className={GIT_MENU_ITEM_CLASSNAME}+ >+ <ToolsContextMenuIconText+ icon={<ArrowUpIcon width={16} height={16} aria-hidden />}+ text={t(I18nKey.COMMON$PUSH)}+ />+ </ContextMenuListItem>+ <ContextMenuListItem+ testId={`${testIdPrefix}-create-pr`}+ onClick={handleCreatePr}+ className={GIT_MENU_ITEM_CLASSNAME}+ >+ <ToolsContextMenuIconText+ icon={<PrIcon width={16} height={16} aria-hidden />}+ text={t(I18nKey.COMMON$CREATE_PR)}+ />+ </ContextMenuListItem>+ <ContextMenuListItem+ testId={`${testIdPrefix}-create-new-branch`}+ onClick={handleCreateNewBranch}+ className={GIT_MENU_ITEM_CLASSNAME}+ >+ <ToolsContextMenuIconText+ icon={<CodeBranchIcon width={16} height={16} aria-hidden />}+ text={t(I18nKey.COMMON$CREATE_NEW_BRANCH)}+ />+ </ContextMenuListItem>+ </ContextMenu>,+ document.body,+ );+}diff --git a/src/components/features/conversation/conversation-git-actions-toggle.tsx b/src/components/features/conversation/conversation-git-actions-toggle.tsxnew file mode 100644index 0000000000..04e2f4033f--- /dev/null+++ b/src/components/features/conversation/conversation-git-actions-toggle.tsx@@ -0,0 +1,115 @@+import React, { useEffect, useRef, useState } from "react";+import { GitCommitHorizontal } from "lucide-react";+import { useTranslation } from "react-i18next";+import { useActiveConversation } from "#/hooks/query/use-active-conversation";+import { useIsArchivedConversation } from "#/hooks/use-is-archived-conversation";+import { I18nKey } from "#/i18n/declaration";+import { Provider } from "#/types/settings";+import { cn } from "#/utils/utils";+import {+ formControlBorderClassName,+ formControlMutedHoverClassName,+ formControlTransitionClassName,+} from "#/utils/form-control-classes";+import { ChatActionTooltip } from "../chat/chat-action-tooltip";+import { ConversationGitActionsMenu } from "./conversation-git-actions-menu";++/** Same 28px height as overview / drawer header icon buttons. */+const GIT_ACTIONS_BUTTON_CLASSNAME = cn(+ "inline-flex h-7 min-h-7 w-fit shrink-0 cursor-pointer items-center justify-center gap-1.5 px-2.5",+ "rounded-md text-xs font-normal leading-none",+ formControlBorderClassName,+ formControlTransitionClassName,+ "text-[var(--oh-muted)]",+ formControlMutedHoverClassName,+ "disabled:cursor-not-allowed disabled:opacity-30",+);++interface ConversationGitActionsToggleProps {+ className?: string;+}++/**+ * Header control left of overview: opens the shared git-actions dropdown+ * (commit / pull / push / create PR / new branch) as chat prompts.+ */+export function ConversationGitActionsToggle({+ className,+}: ConversationGitActionsToggleProps) {+ const { t } = useTranslation("openhands");+ const isArchivedConversation = useIsArchivedConversation();+ const { data: conversation } = useActiveConversation();+ const [isGitMenuOpen, setIsGitMenuOpen] = useState(false);+ const buttonRef = useRef<HTMLButtonElement>(null);++ const gitProvider =+ (conversation?.git_provider as Provider | undefined) ?? "github";++ useEffect(() => {+ if (!isGitMenuOpen) {+ return undefined;+ }++ const onKeyDown = (event: KeyboardEvent) => {+ if (event.key === "Escape") {+ setIsGitMenuOpen(false);+ }+ };++ window.addEventListener("keydown", onKeyDown);+ return () => window.removeEventListener("keydown", onKeyDown);+ }, [isGitMenuOpen]);++ const label = t(I18nKey.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS);++ const button = (+ <button+ ref={buttonRef}+ type="button"+ onClick={() => {+ if (isArchivedConversation) {+ return;+ }+ setIsGitMenuOpen((open) => !open);+ }}+ disabled={isArchivedConversation}+ className={cn(+ GIT_ACTIONS_BUTTON_CLASSNAME,+ isGitMenuOpen && "bg-white/10 text-[var(--oh-foreground)]",+ isArchivedConversation &&+ "cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]",+ className,+ )}+ aria-expanded={isGitMenuOpen}+ aria-haspopup="menu"+ aria-disabled={isArchivedConversation}+ data-testid="conversation-git-actions-toggle"+ >+ <GitCommitHorizontal className="size-4 shrink-0" size={16} aria-hidden />+ <span className="whitespace-nowrap">{label}</span>+ </button>+ );++ return (+ <div className="relative inline-flex items-center self-center">+ {/* Label is visible, so a tooltip only adds value for the disabled reason. */}+ {isArchivedConversation ? (+ <ChatActionTooltip+ tooltip={t(I18nKey.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES)}+ ariaLabel={t(I18nKey.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES)}+ >+ {button}+ </ChatActionTooltip>+ ) : (+ button+ )}+ {isGitMenuOpen ? (+ <ConversationGitActionsMenu+ anchorRef={buttonRef}+ gitProvider={gitProvider}+ onClose={() => setIsGitMenuOpen(false)}+ />+ ) : null}+ </div>+ );+}diff --git a/src/components/features/conversation/conversation-main/chat-interface-wrapper.tsx b/src/components/features/conversation/conversation-main/chat-interface-wrapper.tsxindex c88bf1c41d..f1e2c96888 100644--- a/src/components/features/conversation/conversation-main/chat-interface-wrapper.tsx+++ b/src/components/features/conversation/conversation-main/chat-interface-wrapper.tsx@@ -1,17 +1,74 @@+import { useRef } from "react";+import { AnimatePresence, motion, useReducedMotion } from "framer-motion";import { ChatInterface } from "../../chat/chat-interface";+import { ConversationOverviewPanel } from "../conversation-overview-panel";+import { useConversationStore } from "#/stores/conversation-store";+import { useBreakpoint } from "#/hooks/use-breakpoint";+import { useConversationOverviewColumnSpace } from "#/hooks/use-conversation-overview-column-space";+import {+ CONVERSATION_OVERVIEW_COLUMN_WIDTH_PX,+ CONVERSATION_OVERVIEW_PANEL_TRANSITION,+} from "../conversation-overview-panel.constants";interface ChatInterfaceWrapperProps {isRightPanelShown: boolean;}+const THREAD_CLASSNAME =+ "w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0";+export function ChatInterfaceWrapper({isRightPanelShown: _isRightPanelShown,}: ChatInterfaceWrapperProps) {+ const isMobile = useBreakpoint();+ const reduceMotion = useReducedMotion();+ const enableOverviewMotion = !reduceMotion && import.meta.env.MODE !== "test";+ const isOverviewPanelShown = useConversationStore(+ (state) => state.isOverviewPanelShown,+ );+ const containerRef = useRef<HTMLDivElement>(null);+ const wantsOverviewPanel = !isMobile && isOverviewPanelShown;+ const hasOverviewColumnSpace = useConversationOverviewColumnSpace(+ containerRef,+ wantsOverviewPanel,+ );+ const showOverviewPanel = wantsOverviewPanel && hasOverviewColumnSpace;+return (- <div className="flex justify-center w-full h-full">- <div className="w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0 transition-all duration-300 ease-in-out">- <ChatInterface />+ <div+ ref={containerRef}+ className="flex h-full min-h-0 w-full overflow-hidden"+ >+ <div className="flex min-h-0 min-w-0 flex-1 justify-center overflow-hidden">+ <div className={THREAD_CLASSNAME}>+ <ChatInterface />+ </div></div>+ <AnimatePresence>+ {showOverviewPanel ? (+ <motion.div+ key="conversation-overview-column"+ data-testid="conversation-overview-column"+ initial={enableOverviewMotion ? { width: 0, opacity: 0 } : false}+ animate={{+ width: CONVERSATION_OVERVIEW_COLUMN_WIDTH_PX,+ opacity: 1,+ }}+ exit={+ enableOverviewMotion ? { width: 0, opacity: 0 } : { opacity: 0 }+ }+ transition={CONVERSATION_OVERVIEW_PANEL_TRANSITION}+ className="flex shrink-0 flex-col items-start overflow-hidden pt-4 pl-3 pr-4"+ >+ <div+ className="w-full shrink-0"+ style={{ width: CONVERSATION_OVERVIEW_COLUMN_WIDTH_PX }}+ >+ <ConversationOverviewPanel />+ </div>+ </motion.div>+ ) : null}+ </AnimatePresence></div>);}diff --git a/src/components/features/conversation/conversation-main/conversation-main.tsx b/src/components/features/conversation/conversation-main/conversation-main.tsxindex d3fb189351..0b0999e692 100644--- a/src/components/features/conversation/conversation-main/conversation-main.tsx+++ b/src/components/features/conversation/conversation-main/conversation-main.tsx@@ -11,6 +11,8 @@ import {SIDEBAR_RAIL_COLLAPSE_MAX_WIDTH,} from "#/hooks/use-breakpoint";import { SidebarMobileMenuToggle } from "#/components/features/sidebar/sidebar-mobile-menu-toggle";+import { ConversationOverviewDrawer } from "../conversation-overview-drawer";+import { useConversationOverviewDrawerOptional } from "../conversation-overview-drawer-context";function getDesktopTabPanelClass(isRightPanelShown: boolean) {return isRightPanelShown@@ -22,6 +24,8 @@ export function ConversationMain() {const isMobile = useBreakpoint();const isSidebarRailHidden = useBreakpoint(SIDEBAR_RAIL_COLLAPSE_MAX_WIDTH);const { isRightPanelShown } = useConversationStore();+ const overviewDrawer = useConversationOverviewDrawerOptional();+ const isSecondaryDrawerOpen = Boolean(overviewDrawer?.section);const { leftWidth, rightWidth, isDragging, containerRef, handleMouseDown } =useResizablePanels({@@ -58,14 +62,21 @@ export function ConversationMain() {<divclassName={cn("flex flex-col bg-base overflow-hidden",- isMobile ? "flex-1" : "transition-all duration-300 ease-in-out",+ isMobile+ ? "flex-1"+ : cn(+ "min-w-0",+ !isSecondaryDrawerOpen &&+ "transition-[width] duration-300 ease-in-out",+ ),)}// panel width computed at runtime by resize hook; transition toggled by drag statestyle={!isMobile? {width: isRightPanelShown ? `${leftWidth}%` : "100%",- transitionProperty: isDragging ? "none" : "all",+ transitionProperty:+ isDragging || isSecondaryDrawerOpen ? "none" : "width",}: undefined}@@ -121,6 +132,10 @@ export function ConversationMain() {</div></div>)}+ <ConversationOverviewDrawer+ isMobile={isMobile}+ resizeContainerRef={containerRef}+ /></div></div>);diff --git a/src/components/features/conversation/conversation-name-with-status.tsx b/src/components/features/conversation/conversation-name-with-status.tsxindex 8f40127ac4..2ae6c9beeb 100644--- a/src/components/features/conversation/conversation-name-with-status.tsx+++ b/src/components/features/conversation/conversation-name-with-status.tsx@@ -12,6 +12,8 @@ import { AgentState } from "#/types/agent-state";import DebugStackframeDot from "#/icons/debug-stackframe-dot.svg?react";import { ServerStatusContextMenu } from "../controls/server-status-context-menu";import { ConversationName } from "./conversation-name";+import { ConversationGitActionsToggle } from "./conversation-git-actions-toggle";+import { ConversationOverviewToggle } from "./conversation-overview-toggle";import { RightPanelToggle } from "./right-panel-toggle";import {isExecutionActive,@@ -144,7 +146,11 @@ export function ConversationNameWithStatus() {</div><ConversationName /></div>- <RightPanelToggle className="mr-2" />+ <div className="mr-2 flex shrink-0 items-center gap-1">+ <ConversationGitActionsToggle />+ <ConversationOverviewToggle />+ <RightPanelToggle />+ </div></div>);}diff --git a/src/components/features/conversation/conversation-overview-automations-panel.tsx b/src/components/features/conversation/conversation-overview-automations-panel.tsxnew file mode 100644index 0000000000..c1a49d790b--- /dev/null+++ b/src/components/features/conversation/conversation-overview-automations-panel.tsx@@ -0,0 +1,84 @@+import { useEffect, useState } from "react";+import { useTranslation } from "react-i18next";+import { AutomationCardSkeleton } from "#/components/features/automations/automation-card-skeleton";+import { AutomationGroup } from "#/components/features/automations/automation-group";+import { AddAutomationModal } from "#/components/features/automations/add-automation-modal";+import { BackendNotConfigured } from "#/components/features/automations/backend-not-configured";+import { EmptyState } from "#/components/features/automations/empty-state";+import { ErrorState } from "#/components/features/automations/error-state";+import { useAutomations } from "#/hooks/query/use-automations";+import { useAutomationHealth } from "#/hooks/query/use-automation-health";+import { I18nKey } from "#/i18n/declaration";++interface ConversationOverviewAutomationsPanelProps {+ openAdd: boolean;+}++const NOOP = () => undefined;++/** Reuses the existing Automations list and creation guidance in the drawer. */+export function ConversationOverviewAutomationsPanel({+ openAdd,+}: ConversationOverviewAutomationsPanelProps) {+ const { t } = useTranslation("openhands");+ const [isAddModalOpen, setIsAddModalOpen] = useState(openAdd);+ const {+ data: health,+ isLoading: isHealthLoading,+ refetch: refetchHealth,+ } = useAutomationHealth();+ const { data, isLoading, isError, refetch } = useAutomations({+ limit: 50,+ offset: 0,+ enabled: health?.status === "ok",+ });++ useEffect(() => {+ if (openAdd) setIsAddModalOpen(true);+ }, [openAdd]);++ // Every state renders inside the same panel container so the drawer's+ // DOM contract (one `conversation-overview-automations-panel` node) holds+ // regardless of backend health or list contents.+ let body;+ if (isHealthLoading || (health?.status === "ok" && isLoading)) {+ body = <AutomationCardSkeleton />;+ } else if (health?.status !== "ok") {+ body = <BackendNotConfigured onRetry={refetchHealth} />;+ } else if (isError) {+ body = <ErrorState onRetry={refetch} />;+ } else if (!data?.automations.length) {+ body = (+ <>+ <EmptyState />+ <AddAutomationModal+ isOpen={isAddModalOpen}+ onClose={() => setIsAddModalOpen(false)}+ />+ </>+ );+ } else {+ body = (+ <>+ <AutomationGroup+ title={t(I18nKey.CONVERSATION_PANEL$AUTOMATIONS)}+ count={data.automations.length}+ automations={data.automations}+ view="list"+ onToggle={NOOP}+ onRunNow={NOOP}+ onDelete={NOOP}+ onExport={NOOP}+ />+ <AddAutomationModal+ isOpen={isAddModalOpen}+ onClose={() => setIsAddModalOpen(false)}+ />+ </>+ );+ }++ return (+ <div data-testid="conversation-overview-automations-panel">{body}</div>+ );+}diff --git a/src/components/features/conversation/conversation-overview-context-menu.tsx b/src/components/features/conversation/conversation-overview-context-menu.tsxnew file mode 100644index 0000000000..dc927c0260--- /dev/null+++ b/src/components/features/conversation/conversation-overview-context-menu.tsx@@ -0,0 +1,420 @@+import React, { useLayoutEffect, useState } from "react";+import ReactDOM from "react-dom";+import {+ FolderGit2,+ GitBranch,+ GitCommitHorizontal,+ Laptop,+} from "lucide-react";+import { LuFileDiff } from "react-icons/lu";+import { useTranslation } from "react-i18next";+import { ContextMenu } from "#/ui/context-menu";+import { Divider } from "#/ui/divider";+import { useClickOutsideElement } from "#/hooks/use-click-outside-element";+import { useConversationId } from "#/hooks/use-conversation-id";+import { useConversationLocalStorageState } from "#/utils/conversation-local-storage";+import { useSelectConversationTab } from "#/hooks/use-select-conversation-tab";+import { I18nKey } from "#/i18n/declaration";+import PrIcon from "#/icons/u-pr.svg?react";+import PillIcon from "#/icons/pill.svg?react";+import PillFillIcon from "#/icons/pill-fill.svg?react";+import { cn } from "#/utils/utils";+import {+ dropdownInstantColorClassName,+ dropdownMenuRowIconWrapperClassName,+} from "#/utils/dropdown-classes";+import { useConversationOverviewDrawerOptional } from "./conversation-overview-drawer-context";+import {+ CONVERSATION_OVERVIEW_DRAWER_SECTION,+ type ConversationOverviewDrawerSection,+} from "./conversation-overview-drawer.types";+import {+ CONVERSATION_OVERVIEW_GIT_PART,+ CONVERSATION_OVERVIEW_SECTION,+ CONVERSATION_OVERVIEW_SECTION_GROUPS,+ isOverviewGitPartPinned,+ isOverviewSectionPinned,+ type ConversationOverviewGitPart,+ type ConversationOverviewSection,+} from "./conversation-overview-sections";++interface ConversationOverviewContextMenuProps {+ isOpen: boolean;+ onClose: () => void;+ ignoreOutsideClickRef?: React.RefObject<HTMLElement | null>;+ /** Portal anchor so the menu is not clipped by the overview panel. */+ anchorRef?: React.RefObject<HTMLElement | null>;+}++type OverviewMenuItem = {+ section: ConversationOverviewSection;+ icon: React.ComponentType<{ className?: string }>;+ i18nKey: I18nKey;+};++type GitPartMenuItem = {+ part: ConversationOverviewGitPart;+ icon: React.ComponentType<{ className?: string }>;+ i18nKey: I18nKey;+ drawerSection?: ConversationOverviewDrawerSection;+ opensChanges?: boolean;+ opensCommits?: boolean;+};++const OVERVIEW_MENU_ITEMS_BY_SECTION: Record<+ Exclude<ConversationOverviewSection, "git">,+ OverviewMenuItem+> = {+ [CONVERSATION_OVERVIEW_SECTION.workspace]: {+ section: CONVERSATION_OVERVIEW_SECTION.workspace,+ icon: Laptop,+ i18nKey: I18nKey.CONVERSATION$OVERVIEW_WORKSPACE,+ },+};++const GIT_PART_MENU_ITEMS: GitPartMenuItem[] = [+ {+ part: CONVERSATION_OVERVIEW_GIT_PART.changes,+ icon: LuFileDiff,+ i18nKey: I18nKey.COMMON$CHANGES,+ opensChanges: true,+ },+ {+ part: CONVERSATION_OVERVIEW_GIT_PART.repository,+ icon: FolderGit2,+ i18nKey: I18nKey.CONVERSATION$REPOSITORY,+ },+ {+ part: CONVERSATION_OVERVIEW_GIT_PART.branch,+ icon: GitBranch,+ i18nKey: I18nKey.CONVERSATION$BRANCH,+ },+ {+ part: CONVERSATION_OVERVIEW_GIT_PART.commits,+ icon: GitCommitHorizontal,+ i18nKey: I18nKey.DIFF_VIEWER$COMMITS,+ opensCommits: true,+ },+ {+ part: CONVERSATION_OVERVIEW_GIT_PART.pull_requests,+ icon: PrIcon,+ i18nKey: I18nKey.CONVERSATION$OVERVIEW_PULL_REQUESTS,+ drawerSection: CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests,+ },+];++function OverviewPinButton({+ testId,+ pinned,+ pinnedLabel,+ unpinnedLabel,+ onClick,+}: {+ testId: string;+ pinned: boolean;+ pinnedLabel: string;+ unpinnedLabel: string;+ onClick: (event: React.MouseEvent) => void;+}) {+ return (+ <button+ type="button"+ data-testid={testId}+ className={cn(+ "flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white",+ dropdownInstantColorClassName,+ "hover:bg-white/10",+ )}+ aria-pressed={pinned}+ aria-label={pinned ? pinnedLabel : unpinnedLabel}+ onClick={onClick}+ >+ <span+ className={cn(+ "ml-auto overflow-hidden",+ dropdownMenuRowIconWrapperClassName,+ )}+ aria-hidden+ >+ {pinned ? (+ <PillFillIcon className="size-4" width={16} height={16} />+ ) : (+ <PillIcon className="size-4" width={16} height={16} />+ )}+ </span>+ </button>+ );+}++export function ConversationOverviewContextMenu({+ isOpen,+ onClose,+ ignoreOutsideClickRef,+ anchorRef,+}: ConversationOverviewContextMenuProps) {+ const ref = useClickOutsideElement<HTMLUListElement>(+ onClose,+ ignoreOutsideClickRef,+ );+ const [portalStyle, setPortalStyle] = useState<React.CSSProperties>();+ const { t } = useTranslation("openhands");+ const { conversationId } = useConversationId();+ const { state, setUnpinnedOverviewSections, setUnpinnedOverviewGitParts } =+ useConversationLocalStorageState(conversationId);+ const { navigateToChanges, navigateToCommits } = useSelectConversationTab();+ const overviewDrawer = useConversationOverviewDrawerOptional();++ useLayoutEffect(() => {+ if (!isOpen || !anchorRef?.current) {+ setPortalStyle(undefined);+ return undefined;+ }++ const updatePosition = () => {+ const rect = anchorRef.current?.getBoundingClientRect();+ if (!rect) return;++ const gap = 8;+ setPortalStyle({+ position: "fixed",+ zIndex: 9999,+ top: rect.bottom + gap,+ right: window.innerWidth - rect.right,+ });+ };++ updatePosition();+ window.addEventListener("resize", updatePosition);+ window.addEventListener("scroll", updatePosition, true);+ return () => {+ window.removeEventListener("resize", updatePosition);+ window.removeEventListener("scroll", updatePosition, true);+ };+ }, [isOpen, anchorRef]);++ const handleOpenGitPart = (item: GitPartMenuItem) => {+ if (item.opensChanges) {+ overviewDrawer?.closeDrawer();+ navigateToChanges();+ onClose();+ return;+ }++ if (item.opensCommits) {+ overviewDrawer?.closeDrawer();+ navigateToCommits();+ onClose();+ return;+ }++ if (!item.drawerSection) return;+ overviewDrawer?.openSection(item.drawerSection);+ onClose();+ };++ const handlePinToggle = (+ section: ConversationOverviewSection,+ event: React.MouseEvent,+ ) => {+ event.preventDefault();+ event.stopPropagation();++ const unpinnedSections = state.unpinnedOverviewSections ?? [];+ if (unpinnedSections.includes(section)) {+ setUnpinnedOverviewSections?.(+ unpinnedSections.filter((item) => item !== section),+ );+ return;+ }++ setUnpinnedOverviewSections?.([...unpinnedSections, section]);+ };++ const handleGitPartPinToggle = (+ part: ConversationOverviewGitPart,+ event: React.MouseEvent,+ ) => {+ event.preventDefault();+ event.stopPropagation();++ const unpinnedGitParts = state.unpinnedOverviewGitParts ?? [];+ if (unpinnedGitParts.includes(part)) {+ setUnpinnedOverviewGitParts?.(+ unpinnedGitParts.filter((item) => item !== part),+ );+ return;+ }++ setUnpinnedOverviewGitParts?.([...unpinnedGitParts, part]);+ };++ if (!isOpen) return null;++ const isPortaled = Boolean(anchorRef?.current && portalStyle);+ const gitPinned = isOverviewSectionPinned(+ CONVERSATION_OVERVIEW_SECTION.git,+ state.unpinnedOverviewSections ?? [],+ );+ const pinnedLabel = t(I18nKey.CONVERSATION$UNPIN_OVERVIEW_SECTION);+ const unpinnedLabel = t(I18nKey.CONVERSATION$PIN_OVERVIEW_SECTION);++ const renderMenuRow = ({+ key,+ testIdOpen,+ testIdPin,+ icon: Icon,+ label,+ pinned,+ isActionable,+ indent = false,+ onOpen,+ onPinToggle,+ }: {+ key: string;+ testIdOpen: string;+ testIdPin: string;+ icon: React.ComponentType<{ className?: string }>;+ label: string;+ pinned: boolean;+ isActionable: boolean;+ indent?: boolean;+ onOpen?: () => void;+ onPinToggle: (event: React.MouseEvent) => void;+ }) => {+ const labelContent = (+ <>+ <span className={dropdownMenuRowIconWrapperClassName} aria-hidden>+ <Icon className="h-4 w-4" />+ </span>+ <span className="text-sm">{label}</span>+ </>+ );++ return (+ <li key={key} className="list-none">+ <div+ className={cn(+ "group flex h-[30px] w-full min-w-0 items-stretch rounded hover:bg-[var(--oh-interactive-hover)]",+ indent && "pl-4",+ )}+ >+ {isActionable ? (+ <button+ type="button"+ data-testid={testIdOpen}+ className={cn(+ "flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white",+ dropdownInstantColorClassName,+ )}+ onClick={onOpen}+ >+ {labelContent}+ </button>+ ) : (+ <div+ data-testid={testIdOpen}+ className={cn(+ "flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white",+ dropdownInstantColorClassName,+ )}+ >+ {labelContent}+ </div>+ )}+ <OverviewPinButton+ testId={testIdPin}+ pinned={pinned}+ pinnedLabel={pinnedLabel}+ unpinnedLabel={unpinnedLabel}+ onClick={onPinToggle}+ />+ </div>+ </li>+ );+ };++ const renderSectionRow = (section: ConversationOverviewSection) => {+ if (section === CONVERSATION_OVERVIEW_SECTION.git) return null;+ const item = OVERVIEW_MENU_ITEMS_BY_SECTION[section];+ return renderMenuRow({+ key: section,+ testIdOpen: `conversation-overview-menu-open-${section}`,+ testIdPin: `conversation-overview-menu-pin-${section}`,+ icon: item.icon,+ label: t(item.i18nKey),+ pinned: isOverviewSectionPinned(+ section,+ state.unpinnedOverviewSections ?? [],+ ),+ isActionable: false,+ onPinToggle: (event) => handlePinToggle(section, event),+ });+ };++ const menu = (+ <ContextMenu+ ref={ref}+ testId="conversation-overview-context-menu"+ theme={isPortaled ? "popover" : "default"}+ position={isPortaled ? "none" : "bottom"}+ alignment={isPortaled ? "none" : "right"}+ spacing={isPortaled ? "none" : "default"}+ className={cn("z-[9999] w-fit", isPortaled ? "mt-0" : "mt-2")}+ >+ {CONVERSATION_OVERVIEW_SECTION_GROUPS.map((group, groupIndex) => (+ <React.Fragment key={group.sections.join("-")}>+ {groupIndex > 0 ? (+ <Divider+ testId={`conversation-overview-menu-divider-${groupIndex}`}+ inset="menu"+ />+ ) : null}+ {group.sections.map((section) => renderSectionRow(section))}+ </React.Fragment>+ ))}++ <Divider testId="conversation-overview-menu-divider-git" inset="menu" />++ {renderMenuRow({+ key: CONVERSATION_OVERVIEW_SECTION.git,+ testIdOpen: `conversation-overview-menu-open-${CONVERSATION_OVERVIEW_SECTION.git}`,+ testIdPin: `conversation-overview-menu-pin-${CONVERSATION_OVERVIEW_SECTION.git}`,+ icon: GitBranch,+ label: t(I18nKey.CONVERSATION$OVERVIEW_GIT),+ pinned: gitPinned,+ isActionable: false,+ onPinToggle: (event) =>+ handlePinToggle(CONVERSATION_OVERVIEW_SECTION.git, event),+ })}++ {GIT_PART_MENU_ITEMS.map((item) =>+ renderMenuRow({+ key: item.part,+ testIdOpen: `conversation-overview-menu-open-git-${item.part}`,+ testIdPin: `conversation-overview-menu-pin-git-${item.part}`,+ icon: item.icon,+ label: t(item.i18nKey),+ pinned: isOverviewGitPartPinned(+ item.part,+ state.unpinnedOverviewGitParts ?? [],+ ),+ isActionable: Boolean(+ item.drawerSection || item.opensCommits || item.opensChanges,+ ),+ indent: true,+ onOpen: () => handleOpenGitPart(item),+ onPinToggle: (event) => handleGitPartPinToggle(item.part, event),+ }),+ )}+ </ContextMenu>+ );++ if (isPortaled && portalStyle && typeof document !== "undefined") {+ return ReactDOM.createPortal(+ <div style={portalStyle}>{menu}</div>,+ document.body,+ );+ }++ return menu;+}diff --git a/src/components/features/conversation/conversation-overview-diffs-row.tsx b/src/components/features/conversation/conversation-overview-diffs-row.tsxnew file mode 100644index 0000000000..3183268853--- /dev/null+++ b/src/components/features/conversation/conversation-overview-diffs-row.tsx@@ -0,0 +1,158 @@+import React, { useEffect, useRef, useState } from "react";+import { GitCommitHorizontal } from "lucide-react";+import { LuFileDiff } from "react-icons/lu";+import { useTranslation } from "react-i18next";+import { useActiveConversation } from "#/hooks/query/use-active-conversation";+import { useConversationOverviewGitDiffStats } from "#/hooks/use-conversation-overview-git-diff-stats";+import { useSelectConversationTab } from "#/hooks/use-select-conversation-tab";+import { I18nKey } from "#/i18n/declaration";+import {+ OH_STATUS_ERROR_COLOR,+ OH_STATUS_SUCCESS_COLOR,+} from "#/constants/status-colors";+import { cn } from "#/utils/utils";+import { Provider } from "#/types/settings";+import { useConversationOverviewDrawerOptional } from "./conversation-overview-drawer-context";+import { ConversationGitActionsMenu } from "./conversation-git-actions-menu";++const CHANGES_BUTTON_CLASSNAME = cn(+ "flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5",+ "cursor-pointer border-0 bg-transparent text-left",+);++const ROW_ICON_CLASSNAME = "size-4 shrink-0 text-[var(--oh-muted)]";++const GIT_ACTION_HOVER_TARGET_CLASSNAME =+ "conversation-overview-diffs-git-action";++const GIT_ACTION_BUTTON_CLASSNAME = cn(+ GIT_ACTION_HOVER_TARGET_CLASSNAME,+ "absolute inset-0 inline-flex items-center justify-center",+ "rounded-md text-[var(--oh-muted)] transition-opacity",+ "hover:bg-white/10 hover:text-[var(--oh-foreground)]",+);++/** Full-row hover, cleared while the git commit control itself is hovered. */+const DIFFS_ROW_CLASSNAME = cn(+ "flex items-center rounded-md transition-colors",+ "hover:bg-white/5",+ `has-[.${GIT_ACTION_HOVER_TARGET_CLASSNAME}:hover]:bg-transparent`,+);++const GIT_ACTION_OVERLAY_CLASSNAME = cn(+ "pointer-events-none invisible opacity-0",+ "group-hover/diffstats:pointer-events-auto group-hover/diffstats:visible group-hover/diffstats:opacity-100",+ "group-focus-within/diffstats:pointer-events-auto group-focus-within/diffstats:visible group-focus-within/diffstats:opacity-100",+);++export function ConversationOverviewDiffsRow() {+ const { t } = useTranslation("openhands");+ const { navigateToChanges } = useSelectConversationTab();+ const overviewDrawer = useConversationOverviewDrawerOptional();+ const { data: conversation } = useActiveConversation();+ const { additions, deletions, isLoading } =+ useConversationOverviewGitDiffStats();+ const gitProvider =+ (conversation?.git_provider as Provider | undefined) ?? "github";+ const [isGitMenuOpen, setIsGitMenuOpen] = useState(false);+ const gitActionButtonRef = useRef<HTMLButtonElement>(null);++ useEffect(() => {+ if (!isGitMenuOpen) {+ return undefined;+ }++ const onKeyDown = (event: KeyboardEvent) => {+ if (event.key === "Escape") {+ setIsGitMenuOpen(false);+ }+ };++ window.addEventListener("keydown", onKeyDown);+ return () => window.removeEventListener("keydown", onKeyDown);+ }, [isGitMenuOpen]);++ const handleOpenChanges = () => {+ overviewDrawer?.closeDrawer();+ navigateToChanges();+ };++ return (+ <li className={DIFFS_ROW_CLASSNAME}>+ <button+ type="button"+ data-testid="conversation-overview-diffs"+ aria-label={t(I18nKey.CONVERSATION$OVERVIEW_OPEN_CHANGES)}+ onClick={handleOpenChanges}+ className={CHANGES_BUTTON_CLASSNAME}+ >+ <LuFileDiff className={ROW_ICON_CLASSNAME} aria-hidden />+ <span className="min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]">+ {t(I18nKey.COMMON$CHANGES)}+ </span>+ </button>++ <div className="group/diffstats relative mr-2 flex h-6 min-w-6 shrink-0 items-center justify-center">+ {isLoading ? (+ <span className="text-sm tabular-nums text-[var(--oh-muted)]">…</span>+ ) : (+ <>+ <span+ className={cn(+ "flex items-center gap-1.5 text-sm tabular-nums transition-opacity",+ isGitMenuOpen+ ? "opacity-0"+ : "group-hover/diffstats:opacity-0 group-focus-within/diffstats:opacity-0",+ )}+ >+ <span+ data-testid="conversation-overview-diffs-additions"+ style={{ color: OH_STATUS_SUCCESS_COLOR }}+ >+ {t(I18nKey.CONVERSATION$OVERVIEW_DIFF_ADDITIONS, {+ count: additions.toLocaleString(),+ })}+ </span>+ <span+ data-testid="conversation-overview-diffs-deletions"+ style={{ color: OH_STATUS_ERROR_COLOR }}+ >+ {t(I18nKey.CONVERSATION$OVERVIEW_DIFF_DELETIONS, {+ count: deletions.toLocaleString(),+ })}+ </span>+ </span>+ <button+ ref={gitActionButtonRef}+ type="button"+ data-testid="conversation-overview-diffs-git-action"+ aria-label={t(I18nKey.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS)}+ aria-expanded={isGitMenuOpen}+ aria-haspopup="menu"+ onClick={(event) => {+ event.stopPropagation();+ setIsGitMenuOpen((open) => !open);+ }}+ className={cn(+ GIT_ACTION_BUTTON_CLASSNAME,+ !isGitMenuOpen && GIT_ACTION_OVERLAY_CLASSNAME,+ isGitMenuOpen &&+ "pointer-events-auto visible opacity-100 text-[var(--oh-foreground)]",+ )}+ >+ <GitCommitHorizontal className="size-4" aria-hidden />+ </button>+ {isGitMenuOpen ? (+ <ConversationGitActionsMenu+ anchorRef={gitActionButtonRef}+ gitProvider={gitProvider}+ testIdPrefix="conversation-overview-diffs-git"+ onClose={() => setIsGitMenuOpen(false)}+ />+ ) : null}+ </>+ )}+ </div>+ </li>+ );+}diff --git a/src/components/features/conversation/conversation-overview-drawer-content.tsx b/src/components/features/conversation/conversation-overview-drawer-content.tsxnew file mode 100644index 0000000000..f3cd95d7f4--- /dev/null+++ b/src/components/features/conversation/conversation-overview-drawer-content.tsx@@ -0,0 +1,227 @@+import React, { useEffect } from "react";+import { useTranslation } from "react-i18next";+import XMarkIcon from "#/icons/x-mark.svg?react";+import { BrandButton } from "#/components/features/settings/brand-button";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";+import { useConversationOverviewDrawer } from "./conversation-overview-drawer-context";+import {+ CONVERSATION_OVERVIEW_DRAWER_SECTION,+ type ConversationOverviewDrawerSection,+} from "./conversation-overview-drawer.types";+import { ConversationOverviewAutomationsPanel } from "./conversation-overview-automations-panel";+import { ConversationOverviewSkillsPanel } from "./conversation-overview-skills-panel";+import { ConversationOverviewMcpPanel } from "./conversation-overview-mcp-panel";+import { ConversationOverviewSecretsPanel } from "./conversation-overview-secrets-panel";+import {+ ConversationOverviewGitItemsHeaderLink,+ ConversationOverviewGitItemsPanel,+} from "./conversation-overview-git-items-panel";+import { useConversationOverviewStats } from "#/hooks/use-conversation-overview-stats";+import {+ CONVERSATION_SECONDARY_DRAWER_CLOSE_BUTTON_CLASSNAME,+ CONVERSATION_SECONDARY_DRAWER_HEADER_ACTION_CLASSNAME,+ CONVERSATION_SECONDARY_DRAWER_HEADER_CLASSNAME,+} from "./conversation-secondary-drawer.classes";++interface ConversationOverviewDrawerContentProps {+ className?: string;+}++function getSectionTitleKey(section: ConversationOverviewDrawerSection) {+ switch (section) {+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.automations:+ return I18nKey.CONVERSATION_PANEL$AUTOMATIONS;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.skills:+ return I18nKey.SETTINGS$NAV_SKILLS;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.mcp:+ return I18nKey.CONVERSATION$OVERVIEW_MCP;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.secrets:+ return I18nKey.SETTINGS$NAV_SECRETS;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests:+ return I18nKey.CONVERSATION$OVERVIEW_PULL_REQUESTS;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.issues:+ return I18nKey.CONVERSATION$OVERVIEW_ISSUES;+ default: {+ const _exhaustive: never = section;+ return _exhaustive;+ }+ }+}++function ConversationOverviewDrawerHeaderAddAction({+ section,+}: {+ section: ConversationOverviewDrawerSection;+}) {+ const { t } = useTranslation("openhands");+ const { requestAdd } = useConversationOverviewDrawer();++ switch (section) {+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.automations:+ return (+ <BrandButton+ type="button"+ variant="primary"+ testId="conversation-overview-automations-add"+ className={CONVERSATION_SECONDARY_DRAWER_HEADER_ACTION_CLASSNAME}+ onClick={requestAdd}+ >+ {t(I18nKey.AUTOMATIONS$ADD_AUTOMATION)}+ </BrandButton>+ );+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.skills:+ return (+ <BrandButton+ type="button"+ variant="primary"+ testId="conversation-overview-skills-add-skill-button"+ className={CONVERSATION_SECONDARY_DRAWER_HEADER_ACTION_CLASSNAME}+ onClick={requestAdd}+ >+ {t(I18nKey.SETTINGS$SKILLS_ADD_BUTTON)}+ </BrandButton>+ );+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.mcp:+ return (+ <BrandButton+ type="button"+ variant="secondary"+ testId="conversation-overview-mcp-add-server"+ className={CONVERSATION_SECONDARY_DRAWER_HEADER_ACTION_CLASSNAME}+ onClick={requestAdd}+ >+ {t(I18nKey.MCP$ADD_CUSTOM)}+ </BrandButton>+ );+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.secrets:+ return (+ <BrandButton+ type="button"+ variant="primary"+ testId="conversation-overview-secrets-add-button"+ className={CONVERSATION_SECONDARY_DRAWER_HEADER_ACTION_CLASSNAME}+ onClick={requestAdd}+ >+ {t(I18nKey.SECRETS$ADD_NEW_SECRET)}+ </BrandButton>+ );+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests:+ return <ConversationOverviewGitItemsHeaderLink kind="pull_requests" />;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.issues:+ return <ConversationOverviewGitItemsHeaderLink kind="issues" />;+ default:+ return null;+ }+}++function ConversationOverviewDrawerBody({+ section,+ openAdd,+}: {+ section: ConversationOverviewDrawerSection;+ openAdd: boolean;+}) {+ switch (section) {+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.automations:+ return <ConversationOverviewAutomationsPanel openAdd={openAdd} />;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.skills:+ return <ConversationOverviewSkillsPanel openAdd={openAdd} />;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.mcp:+ return <ConversationOverviewMcpPanel openAdd={openAdd} />;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.secrets:+ return <ConversationOverviewSecretsPanel openAdd={openAdd} />;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests:+ return <ConversationOverviewGitItemsPanel kind="pull_requests" />;+ case CONVERSATION_OVERVIEW_DRAWER_SECTION.issues:+ return <ConversationOverviewGitItemsPanel kind="issues" />;+ default: {+ const _exhaustive: never = section;+ return _exhaustive;+ }+ }+}++export function ConversationOverviewDrawerContent({+ className,+}: ConversationOverviewDrawerContentProps) {+ const { t } = useTranslation("openhands");+ const { section, openAdd, closeDrawer } = useConversationOverviewDrawer();+ const { workspaceName } = useConversationOverviewStats();++ useEffect(() => {+ if (!section) {+ return undefined;+ }++ const handleEscape = (event: KeyboardEvent) => {+ if (event.key === "Escape") {+ closeDrawer();+ }+ };++ document.addEventListener("keydown", handleEscape);+ return () => {+ document.removeEventListener("keydown", handleEscape);+ };+ }, [closeDrawer, section]);++ if (!section) {+ return null;+ }++ const isFullBleedBody =+ section === CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests ||+ section === CONVERSATION_OVERVIEW_DRAWER_SECTION.issues ||+ section === CONVERSATION_OVERVIEW_DRAWER_SECTION.secrets;++ return (+ <aside+ data-testid="conversation-overview-drawer-content"+ aria-label={t(getSectionTitleKey(section))}+ className={cn(+ "flex h-full w-full min-h-0 flex-col overflow-hidden bg-base-secondary",+ className,+ )}+ >+ <header className={CONVERSATION_SECONDARY_DRAWER_HEADER_CLASSNAME}>+ <button+ type="button"+ data-testid="conversation-overview-drawer-close"+ aria-label={t(I18nKey.BUTTON$CLOSE)}+ onClick={closeDrawer}+ className={CONVERSATION_SECONDARY_DRAWER_CLOSE_BUTTON_CLASSNAME}+ >+ <XMarkIcon className="size-4" aria-hidden />+ </button>+ <div className="flex min-w-0 flex-1 items-center gap-2">+ <h2 className="truncate text-sm font-medium text-content">+ {t(getSectionTitleKey(section))}+ </h2>+ {workspaceName ? (+ <p+ data-testid="conversation-overview-drawer-workspace"+ className="truncate text-xs text-muted"+ >+ {workspaceName}+ </p>+ ) : null}+ </div>+ <div className="shrink-0">+ <ConversationOverviewDrawerHeaderAddAction section={section} />+ </div>+ </header>++ <div+ className={cn(+ "min-h-0 flex-1 custom-scrollbar-always",+ isFullBleedBody+ ? "flex flex-col overflow-hidden"+ : "overflow-y-auto px-4 py-4",+ )}+ >+ <ConversationOverviewDrawerBody section={section} openAdd={openAdd} />+ </div>+ </aside>+ );+}diff --git a/src/components/features/conversation/conversation-overview-drawer-context.tsx b/src/components/features/conversation/conversation-overview-drawer-context.tsxnew file mode 100644index 0000000000..2330c7d755--- /dev/null+++ b/src/components/features/conversation/conversation-overview-drawer-context.tsx@@ -0,0 +1,92 @@+import React, {+ createContext,+ useCallback,+ useContext,+ useMemo,+ useState,+} from "react";+import type {+ ConversationOverviewDrawerOpenOptions,+ ConversationOverviewDrawerSection,+} from "./conversation-overview-drawer.types";++interface ConversationOverviewDrawerContextValue {+ section: ConversationOverviewDrawerSection | null;+ openAdd: boolean;+ /** Increments when the drawer header Add control is clicked. */+ addRequestKey: number;+ openSection: (+ section: ConversationOverviewDrawerSection,+ options?: ConversationOverviewDrawerOpenOptions,+ ) => void;+ closeDrawer: () => void;+ requestAdd: () => void;+}++const ConversationOverviewDrawerContext =+ createContext<ConversationOverviewDrawerContextValue | null>(null);++export function ConversationOverviewDrawerProvider({+ children,+}: {+ children: React.ReactNode;+}) {+ const [section, setSection] =+ useState<ConversationOverviewDrawerSection | null>(null);+ const [openAdd, setOpenAdd] = useState(false);+ const [addRequestKey, setAddRequestKey] = useState(0);++ const openSection = useCallback(+ (+ nextSection: ConversationOverviewDrawerSection,+ options?: ConversationOverviewDrawerOpenOptions,+ ) => {+ setSection(nextSection);+ setOpenAdd(Boolean(options?.openAdd));+ setAddRequestKey(0);+ },+ [],+ );++ const closeDrawer = useCallback(() => {+ setSection(null);+ setOpenAdd(false);+ setAddRequestKey(0);+ }, []);++ const requestAdd = useCallback(() => {+ setAddRequestKey((previous) => previous + 1);+ }, []);++ const value = useMemo(+ () => ({+ section,+ openAdd,+ addRequestKey,+ openSection,+ closeDrawer,+ requestAdd,+ }),+ [addRequestKey, closeDrawer, openAdd, openSection, requestAdd, section],+ );++ return (+ <ConversationOverviewDrawerContext.Provider value={value}>+ {children}+ </ConversationOverviewDrawerContext.Provider>+ );+}++export function useConversationOverviewDrawer() {+ const context = useContext(ConversationOverviewDrawerContext);+ if (!context) {+ throw new Error(+ "useConversationOverviewDrawer must be used within ConversationOverviewDrawerProvider",+ );+ }+ return context;+}++export function useConversationOverviewDrawerOptional() {+ return useContext(ConversationOverviewDrawerContext);+}diff --git a/src/components/features/conversation/conversation-overview-drawer.constants.ts b/src/components/features/conversation/conversation-overview-drawer.constants.tsnew file mode 100644index 0000000000..5de79e9beb--- /dev/null+++ b/src/components/features/conversation/conversation-overview-drawer.constants.ts@@ -0,0 +1,12 @@+export const CONVERSATION_OVERVIEW_DRAWER_WIDTH_STORAGE_KEY =+ "conversation-overview-drawer-width";++export const CONVERSATION_OVERVIEW_DRAWER_DEFAULT_WIDTH_PX = 420;+export const CONVERSATION_OVERVIEW_DRAWER_MIN_WIDTH_PX = 300;+export const CONVERSATION_OVERVIEW_DRAWER_MAX_WIDTH_PX = 640;++export const CONVERSATION_OVERVIEW_DRAWER_RESIZE_HANDLE_TEST_ID =+ "conversation-overview-drawer-resize-handle";++export const CONVERSATION_OVERVIEW_DRAWER_TEST_ID =+ "conversation-overview-drawer";diff --git a/src/components/features/conversation/conversation-overview-drawer.tsx b/src/components/features/conversation/conversation-overview-drawer.tsxnew file mode 100644index 0000000000..be7152fa54--- /dev/null+++ b/src/components/features/conversation/conversation-overview-drawer.tsx@@ -0,0 +1,92 @@+import type { RefObject } from "react";+import { ResizeHandle } from "#/components/ui/resize-handle";+import { useResizableDrawerWidth } from "#/hooks/use-resizable-drawer-width";+import { cn } from "#/utils/utils";+import { ConversationOverviewDrawerContent } from "./conversation-overview-drawer-content";+import { useConversationOverviewDrawerOptional } from "./conversation-overview-drawer-context";+import {+ CONVERSATION_OVERVIEW_DRAWER_DEFAULT_WIDTH_PX,+ CONVERSATION_OVERVIEW_DRAWER_MAX_WIDTH_PX,+ CONVERSATION_OVERVIEW_DRAWER_MIN_WIDTH_PX,+ CONVERSATION_OVERVIEW_DRAWER_RESIZE_HANDLE_TEST_ID,+ CONVERSATION_OVERVIEW_DRAWER_TEST_ID,+ CONVERSATION_OVERVIEW_DRAWER_WIDTH_STORAGE_KEY,+} from "./conversation-overview-drawer.constants";++function getOverviewDrawerClass(isOpen: boolean) {+ return isOpen+ ? "translate-x-0 opacity-100"+ : "w-0 translate-x-full opacity-0";+}++interface ConversationOverviewDrawerProps {+ isMobile: boolean;+ resizeContainerRef?: RefObject<HTMLElement | null>;+}++export function ConversationOverviewDrawer({+ isMobile,+ resizeContainerRef,+}: ConversationOverviewDrawerProps) {+ const overviewDrawer = useConversationOverviewDrawerOptional();+ const isOpen = Boolean(overviewDrawer?.section);++ const { drawerWidth, isDragging, handleMouseDown } = useResizableDrawerWidth({+ containerRef: resizeContainerRef ?? { current: null },+ defaultWidth: CONVERSATION_OVERVIEW_DRAWER_DEFAULT_WIDTH_PX,+ minWidth: CONVERSATION_OVERVIEW_DRAWER_MIN_WIDTH_PX,+ maxWidth: CONVERSATION_OVERVIEW_DRAWER_MAX_WIDTH_PX,+ storageKey: CONVERSATION_OVERVIEW_DRAWER_WIDTH_STORAGE_KEY,+ enabled: isOpen && !isMobile && resizeContainerRef != null,+ });++ if (!overviewDrawer) {+ return null;+ }++ if (isMobile) {+ if (!isOpen) {+ return null;+ }++ return (+ <ConversationOverviewDrawerContent className="max-h-[min(50vh,420px)] w-full border-t border-[var(--oh-border)]" />+ );+ }++ return (+ <>+ {isOpen && resizeContainerRef ? (+ <div data-testid={CONVERSATION_OVERVIEW_DRAWER_RESIZE_HANDLE_TEST_ID}>+ <ResizeHandle onMouseDown={handleMouseDown} isDragging={isDragging} />+ </div>+ ) : null}+ <div+ data-testid={CONVERSATION_OVERVIEW_DRAWER_TEST_ID}+ aria-hidden={!isOpen}+ className={cn(+ "shrink-0 overflow-hidden ease-in-out",+ isDragging+ ? "transition-[transform,opacity] duration-300"+ : "transition-all duration-300",+ getOverviewDrawerClass(isOpen),+ )}+ style={{+ width: isOpen ? `${drawerWidth}px` : "0px",+ transitionProperty: isDragging+ ? "transform, opacity"+ : "width, transform, opacity",+ }}+ >+ <div+ className="flex h-full flex-col overflow-hidden border-l border-[var(--oh-border)] bg-base-secondary"+ style={{ width: `${drawerWidth}px` }}+ >+ {isOpen ? (+ <ConversationOverviewDrawerContent className="h-full" />+ ) : null}+ </div>+ </div>+ </>+ );+}diff --git a/src/components/features/conversation/conversation-overview-drawer.types.ts b/src/components/features/conversation/conversation-overview-drawer.types.tsnew file mode 100644index 0000000000..396f0394f4--- /dev/null+++ b/src/components/features/conversation/conversation-overview-drawer.types.ts@@ -0,0 +1,15 @@+export const CONVERSATION_OVERVIEW_DRAWER_SECTION = {+ automations: "automations",+ skills: "skills",+ mcp: "mcp",+ secrets: "secrets",+ pull_requests: "pull_requests",+ issues: "issues",+} as const;++export type ConversationOverviewDrawerSection =+ (typeof CONVERSATION_OVERVIEW_DRAWER_SECTION)[keyof typeof CONVERSATION_OVERVIEW_DRAWER_SECTION];++export interface ConversationOverviewDrawerOpenOptions {+ openAdd?: boolean;+}diff --git a/src/components/features/conversation/conversation-overview-git-items-panel.tsx b/src/components/features/conversation/conversation-overview-git-items-panel.tsxnew file mode 100644index 0000000000..43f9e354d3--- /dev/null+++ b/src/components/features/conversation/conversation-overview-git-items-panel.tsx@@ -0,0 +1,158 @@+import React from "react";+import { ExternalLink } from "lucide-react";+import { useTranslation } from "react-i18next";+import { GitProviderItemsService } from "#/api/git-provider-items-service";+import {+ useRepositoryIssues,+ useRepositoryPullRequests,+} from "#/hooks/query/use-repository-git-items";+import { useConversationPrimaryRepository } from "#/hooks/use-conversation-primary-repository";+import { I18nKey } from "#/i18n/declaration";+import { cn, getProviderName } from "#/utils/utils";+import { extensionModuleEmptyStateClassName } from "#/utils/extension-module-card-classes";+import { CONVERSATION_OVERVIEW_DRAWER_SECTION } from "./conversation-overview-drawer.types";++interface ConversationOverviewGitItemsPanelProps {+ kind: "pull_requests" | "issues";+}++const EXTERNAL_LINK_ICON_CLASSNAME = cn(+ "size-3.5 shrink-0 text-[var(--oh-muted)]",+ "opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",+);++function useGitItemsExternalListUrl(kind: "pull_requests" | "issues") {+ const { repository, provider } = useConversationPrimaryRepository();++ if (!repository || !provider) {+ return null;+ }++ return kind === CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests+ ? GitProviderItemsService.constructPullRequestsListUrl(provider, repository)+ : GitProviderItemsService.constructIssuesListUrl(provider, repository);+}++export function ConversationOverviewGitItemsHeaderLink({+ kind,+}: ConversationOverviewGitItemsPanelProps) {+ const { t } = useTranslation("openhands");+ const { provider } = useConversationPrimaryRepository();+ const externalListUrl = useGitItemsExternalListUrl(kind);++ if (!externalListUrl || !provider) {+ return null;+ }++ return (+ <a+ href={externalListUrl}+ target="_blank"+ rel="noreferrer"+ data-testid={`conversation-overview-${kind}-open-external`}+ className={cn(+ "inline-flex h-7 min-h-7 shrink-0 items-center gap-1.5 whitespace-nowrap",+ "px-1 text-xs text-[var(--oh-muted)] transition-colors",+ "hover:text-[var(--oh-foreground)]",+ )}+ >+ {t(I18nKey.CONVERSATION$OVERVIEW_VIEW_ON_PROVIDER, {+ provider: getProviderName(provider),+ })}+ <ExternalLink className="size-3.5" aria-hidden />+ </a>+ );+}++export function ConversationOverviewGitItemsPanel({+ kind,+}: ConversationOverviewGitItemsPanelProps) {+ const { t } = useTranslation("openhands");+ const { repository, provider, isConnected } =+ useConversationPrimaryRepository();++ const pullRequestsQuery = useRepositoryPullRequests(repository, provider);+ const issuesQuery = useRepositoryIssues(repository, provider);++ const query =+ kind === CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests+ ? pullRequestsQuery+ : issuesQuery;++ if (!isConnected || !repository || !provider) {+ return (+ <p+ data-testid="conversation-overview-git-items-unavailable"+ className={cn(+ extensionModuleEmptyStateClassName,+ "px-4 py-6 text-center text-sm",+ )}+ >+ {t(I18nKey.CONVERSATION$OVERVIEW_GIT_UNAVAILABLE)}+ </p>+ );+ }++ return (+ <div+ data-testid={`conversation-overview-${kind}-panel`}+ className="min-h-0 flex-1 overflow-y-auto px-2 py-2"+ >+ {query.isLoading ? (+ <p className="px-2 py-4 text-sm text-[var(--oh-muted)]">+ {t(I18nKey.HOME$LOADING)}+ </p>+ ) : query.isError ? (+ <p+ data-testid={`conversation-overview-${kind}-error`}+ className={cn(+ extensionModuleEmptyStateClassName,+ "px-2 py-6 text-center text-sm",+ )}+ >+ {t(I18nKey.CONVERSATION$OVERVIEW_GIT_ITEMS_ERROR)}+ </p>+ ) : query.data && query.data.length > 0 ? (+ <ul className="flex flex-col gap-0.5">+ {query.data.map((item) => (+ <li key={item.id}>+ <a+ href={item.url}+ target="_blank"+ rel="noreferrer"+ data-testid={`conversation-overview-${kind}-item-${item.number}`}+ className={cn(+ "group flex min-w-0 items-center gap-2 rounded-md px-2 py-2",+ "transition-colors hover:bg-white/5",+ )}+ >+ <span className="shrink-0 text-sm tabular-nums text-[var(--oh-muted)]">+ #{item.number}+ </span>+ <span className="min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]">+ {item.title}+ </span>+ <ExternalLink+ className={EXTERNAL_LINK_ICON_CLASSNAME}+ aria-hidden+ />+ </a>+ </li>+ ))}+ </ul>+ ) : (+ <p+ data-testid={`conversation-overview-${kind}-empty`}+ className={cn(+ extensionModuleEmptyStateClassName,+ "px-2 py-6 text-center text-sm",+ )}+ >+ {kind === CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests+ ? t(I18nKey.CONVERSATION$OVERVIEW_PULL_REQUESTS_EMPTY)+ : t(I18nKey.CONVERSATION$OVERVIEW_ISSUES_EMPTY)}+ </p>+ )}+ </div>+ );+}diff --git a/src/components/features/conversation/conversation-overview-git-section.tsx b/src/components/features/conversation/conversation-overview-git-section.tsxnew file mode 100644index 0000000000..1f688626d5--- /dev/null+++ b/src/components/features/conversation/conversation-overview-git-section.tsx@@ -0,0 +1,258 @@+import React from "react";+import { ExternalLink, GitBranch, GitCommitHorizontal } from "lucide-react";+import { FaCodeBranch } from "react-icons/fa";+import { useTranslation } from "react-i18next";+import PrIcon from "#/icons/u-pr.svg?react";+import { GitProviderIcon } from "#/components/shared/git-provider-icon";+import { useRepositoryPullRequests } from "#/hooks/query/use-repository-git-items";+import { useUnifiedGitCommits } from "#/hooks/query/use-unified-git-commits";+import { useConversationPrimaryRepository } from "#/hooks/use-conversation-primary-repository";+import { useConversationId } from "#/hooks/use-conversation-id";+import { useSelectConversationTab } from "#/hooks/use-select-conversation-tab";+import { useSettings } from "#/hooks/query/use-settings";+import { useConversationLocalStorageState } from "#/utils/conversation-local-storage";+import { I18nKey } from "#/i18n/declaration";+import { cn, constructBranchUrl, constructRepositoryUrl } from "#/utils/utils";+import { useConversationOverviewDrawerOptional } from "./conversation-overview-drawer-context";+import { CONVERSATION_OVERVIEW_DRAWER_SECTION } from "./conversation-overview-drawer.types";+import {+ CONVERSATION_OVERVIEW_GIT_PART,+ isOverviewGitPartPinned,+} from "./conversation-overview-sections";++const ROW_ICON_CLASSNAME = "size-4 shrink-0 text-[var(--oh-muted)]";+const EXTERNAL_LINK_ICON_CLASSNAME = cn(+ "size-3.5 shrink-0 text-[var(--oh-muted)]",+ "opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",+);+// Non-localizable empty-count glyph (zero PRs).++const ZERO_COUNT_LABEL = "-";++/**+ * Repo / branch / commits / PR rows for the overview git block.+ * Changes is rendered by the parent panel ahead of this section.+ */+export function ConversationOverviewGitSection() {+ const { t } = useTranslation("openhands");+ const { conversationId } = useConversationId();+ const { state } = useConversationLocalStorageState(conversationId);+ const { navigateToCommits } = useSelectConversationTab();+ const overviewDrawer = useConversationOverviewDrawerOptional();+ const { data: settings } = useSettings();+ const { repository, provider, branch, isConnected } =+ useConversationPrimaryRepository();++ const showRepository = isOverviewGitPartPinned(+ CONVERSATION_OVERVIEW_GIT_PART.repository,+ state.unpinnedOverviewGitParts ?? [],+ );+ const showBranch = isOverviewGitPartPinned(+ CONVERSATION_OVERVIEW_GIT_PART.branch,+ state.unpinnedOverviewGitParts ?? [],+ );+ const showCommits = isOverviewGitPartPinned(+ CONVERSATION_OVERVIEW_GIT_PART.commits,+ state.unpinnedOverviewGitParts ?? [],+ );+ const showPullRequests = isOverviewGitPartPinned(+ CONVERSATION_OVERVIEW_GIT_PART.pull_requests,+ state.unpinnedOverviewGitParts ?? [],+ );++ const pullRequestsQuery = useRepositoryPullRequests(+ showPullRequests ? repository : null,+ showPullRequests ? provider : null,+ );+ // Same page the Files → Commits drawer uses; no separate total from the+ // API, so we surface the fetched count (and a trailing + when capped).+ const commitsQuery = useUnifiedGitCommits();++ if (!isConnected || !repository || !provider) {+ return null;+ }++ if (!showRepository && !showBranch && !showCommits && !showPullRequests) {+ return null;+ }++ const providerHost = settings?.provider_tokens_set?.[provider] ?? null;+ const repoUrl = constructRepositoryUrl(provider, repository, providerHost);+ const branchUrl = branch+ ? constructBranchUrl(provider, repository, branch, providerHost)+ : null;+ const pullRequestsCount = pullRequestsQuery.data?.length ?? null;+ const commitsCount = commitsQuery.isUnsupported+ ? null+ : commitsQuery.commits.length;+ const commitsCountLabel =+ commitsCount !== null && commitsCount > 0+ ? commitsQuery.hasMore+ ? `${commitsCount}+`+ : String(commitsCount)+ : ZERO_COUNT_LABEL;++ const openPullRequests = () => {+ overviewDrawer?.openSection(+ CONVERSATION_OVERVIEW_DRAWER_SECTION.pull_requests,+ );+ };++ const openCommits = () => {+ overviewDrawer?.closeDrawer();+ navigateToCommits();+ };++ const showHeader = showRepository || showBranch;+ const showList = showCommits || showPullRequests;++ return (+ <div data-testid="conversation-overview-git-section">+ {showHeader ? (+ <div className="px-2 pb-1">+ {showRepository ? (+ <a+ href={repoUrl}+ target="_blank"+ rel="noreferrer"+ data-testid="conversation-overview-git-repo"+ className={cn(+ "group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5",+ "transition-colors hover:bg-white/5",+ )}+ >+ <GitProviderIcon+ gitProvider={provider}+ className={ROW_ICON_CLASSNAME}+ />+ <span className="min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]">+ {repository}+ </span>+ <ExternalLink+ className={EXTERNAL_LINK_ICON_CLASSNAME}+ aria-hidden+ />+ </a>+ ) : null}+ {showBranch ? (+ branch && branchUrl ? (+ <a+ href={branchUrl}+ target="_blank"+ rel="noreferrer"+ data-testid="conversation-overview-git-branch"+ className={cn(+ "group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5",+ "transition-colors hover:bg-white/5",+ )}+ >+ <FaCodeBranch+ size={14}+ className="shrink-0 text-[var(--oh-muted)]"+ aria-hidden+ />+ <span className="min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]">+ {branch}+ </span>+ <ExternalLink+ className={EXTERNAL_LINK_ICON_CLASSNAME}+ aria-hidden+ />+ </a>+ ) : (+ <div+ data-testid="conversation-overview-git-branch"+ className="flex min-w-0 items-center gap-2 px-2 py-1.5"+ >+ <GitBranch+ className="size-3.5 shrink-0 text-[var(--oh-muted)]"+ aria-hidden+ />+ <span+ className={cn(+ "text-sm",+ branch+ ? "text-[var(--oh-foreground)]"+ : "text-[var(--oh-muted)]",+ )}+ >+ {branch || t(I18nKey.CONVERSATION$OVERVIEW_NONE)}+ </span>+ </div>+ )+ ) : null}+ </div>+ ) : null}++ {showList ? (+ <ul className="px-2">+ {showCommits ? (+ <li>+ <button+ type="button"+ data-testid="conversation-overview-commits"+ onClick={openCommits}+ className={cn(+ "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5",+ "cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5",+ )}+ >+ <GitCommitHorizontal+ className={ROW_ICON_CLASSNAME}+ aria-hidden+ />+ <span className="min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]">+ {t(I18nKey.DIFF_VIEWER$COMMITS)}+ </span>+ {commitsQuery.isLoading ? (+ <span className="text-sm tabular-nums text-[var(--oh-muted)]">+ …+ </span>+ ) : (+ <span+ data-testid="conversation-overview-commits-count"+ className="text-sm tabular-nums text-[var(--oh-muted)]"+ >+ {commitsCountLabel}+ </span>+ )}+ </button>+ </li>+ ) : null}+ {showPullRequests ? (+ <li>+ <button+ type="button"+ data-testid="conversation-overview-pull-requests"+ onClick={openPullRequests}+ className={cn(+ "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5",+ "cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5",+ )}+ >+ <PrIcon className={ROW_ICON_CLASSNAME} aria-hidden />+ <span className="min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]">+ {t(I18nKey.CONVERSATION$OVERVIEW_PULL_REQUESTS)}+ </span>+ {pullRequestsQuery.isLoading ? (+ <span className="text-sm tabular-nums text-[var(--oh-muted)]">+ …+ </span>+ ) : (+ <span+ data-testid="conversation-overview-pull-requests-count"+ className="text-sm tabular-nums text-[var(--oh-muted)]"+ >+ {pullRequestsCount !== null && pullRequestsCount > 0+ ? pullRequestsCount+ : ZERO_COUNT_LABEL}+ </span>+ )}+ </button>+ </li>+ ) : null}+ </ul>+ ) : null}+ </div>+ );+}diff --git a/src/components/features/conversation/conversation-overview-mcp-panel.tsx b/src/components/features/conversation/conversation-overview-mcp-panel.tsxnew file mode 100644index 0000000000..3b26e3949f--- /dev/null+++ b/src/components/features/conversation/conversation-overview-mcp-panel.tsx@@ -0,0 +1,183 @@+import React, { useEffect, useState } from "react";+import { AxiosError } from "axios";+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import { ConfirmationModal } from "#/components/shared/modals/confirmation-modal";+import { useSettings } from "#/hooks/query/use-settings";+import { useDeleteMcpServer } from "#/hooks/mutation/use-delete-mcp-server";+import { useUpdateMcpServer } from "#/hooks/mutation/use-update-mcp-server";+import { parseMcpConfig } from "#/utils/mcp-config";+import {+ displayErrorToast,+ displaySuccessToast,+} from "#/utils/custom-toast-handlers";+import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";+import {+ findCatalogEntryForServer,+ getMcpMarketplaceCatalog,+ installedServerMatchesQuery,+} from "#/utils/mcp-marketplace-utils";+import {+ INTEGRATION_CATALOG as MCP_MARKETPLACE,+ type IntegrationCatalogEntry as MarketplaceEntry,+} from "@openhands/extensions/integrations";+import { MCPServerConfig } from "#/types/mcp-server";+import { flattenMcpConfig } from "#/utils/mcp-installed-servers";+import {+ InstalledServersSection,+ CustomServerEditor,+ InstallServerModal,+ MarketplaceSection,+ McpToolbar,+ type McpSectionFilter,+} from "#/components/features/mcp-page";+import { useConversationOverviewDrawerOptional } from "./conversation-overview-drawer-context";++interface ConversationOverviewMcpPanelProps {+ openAdd: boolean;+}++export function ConversationOverviewMcpPanel({+ openAdd,+}: ConversationOverviewMcpPanelProps) {+ const { t } = useTranslation("openhands");+ const { data: settings, isLoading } = useSettings();+ const { mutate: deleteMcpServer, isPending: isDeleting } =+ useDeleteMcpServer();+ const { mutate: updateMcpServer } = useUpdateMcpServer();+ const addRequestKey =+ useConversationOverviewDrawerOptional()?.addRequestKey ?? 0;++ const [installEntry, setInstallEntry] = useState<MarketplaceEntry | null>(+ null,+ );+ const [editingServer, setEditingServer] = useState<MCPServerConfig | null>(+ null,+ );+ const [serverToDelete, setServerToDelete] = useState<MCPServerConfig | null>(+ null,+ );+ const [searchQuery, setSearchQuery] = useState("");+ const [sectionFilter, setSectionFilter] = useState<McpSectionFilter>("all");++ useEffect(() => {+ if (!openAdd) {+ return;+ }+ setEditingServer({ id: "", type: "sse" });+ }, [openAdd]);++ useEffect(() => {+ if (addRequestKey === 0) {+ return;+ }+ setEditingServer({ id: "", type: "sse" });+ }, [addRequestKey]);++ const mcpConfig = parseMcpConfig(settings?.agent_settings?.mcp_config);+ const allServers = flattenMcpConfig(mcpConfig);+ const mcpMarketplace = getMcpMarketplaceCatalog(MCP_MARKETPLACE);+ const filteredInstalledServers = allServers.filter((server) =>+ installedServerMatchesQuery(+ server,+ findCatalogEntryForServer(server, mcpMarketplace),+ searchQuery,+ ),+ );++ const handleToggleEnabled = (server: MCPServerConfig, enabled: boolean) => {+ updateMcpServer({ serverId: server.id, server: { ...server, enabled } });+ };++ const handleConfirmDelete = () => {+ if (!serverToDelete) {+ return;+ }+ deleteMcpServer(serverToDelete, {+ onSuccess: () => {+ displaySuccessToast(t(I18nKey.MCP$REMOVE_SUCCESS));+ setServerToDelete(null);+ },+ onError: (error) => {+ displayErrorToast(+ retrieveAxiosErrorMessage(error as AxiosError) ||+ t(I18nKey.ERROR$GENERIC),+ );+ setServerToDelete(null);+ },+ });+ };++ if (isLoading || !settings) {+ return (+ <div+ data-testid="conversation-overview-mcp-panel"+ className="text-sm text-muted"+ >+ …+ </div>+ );+ }++ return (+ <div+ data-testid="conversation-overview-mcp-panel"+ className="flex flex-col gap-4"+ >+ <McpToolbar+ search={searchQuery}+ onSearchChange={setSearchQuery}+ sectionFilter={sectionFilter}+ onSectionFilterChange={setSectionFilter}+ />++ {sectionFilter !== "library" ? (+ <section className="flex flex-col gap-3">+ <h3 className="text-sm font-semibold text-foreground">+ {t(I18nKey.MCP$INSTALLED_TITLE)}+ </h3>+ <InstalledServersSection+ servers={filteredInstalledServers}+ hasAnyInstalled={allServers.length > 0}+ query={searchQuery}+ onEdit={setEditingServer}+ onToggleEnabled={handleToggleEnabled}+ />+ </section>+ ) : null}++ {sectionFilter !== "installed" ? (+ <MarketplaceSection+ onSelect={setInstallEntry}+ onAdd={setInstallEntry}+ query={searchQuery}+ />+ ) : null}++ {installEntry ? (+ <InstallServerModal+ entry={installEntry}+ existingServers={allServers}+ onClose={() => setInstallEntry(null)}+ />+ ) : null}++ {editingServer ? (+ <CustomServerEditor+ server={editingServer}+ existingServers={allServers}+ onClose={() => setEditingServer(null)}+ />+ ) : null}++ {serverToDelete ? (+ <ConfirmationModal+ text={t(I18nKey.SETTINGS$MCP_CONFIRM_DELETE)}+ onCancel={() => setServerToDelete(null)}+ onConfirm={handleConfirmDelete}+ isConfirming={isDeleting}+ />+ ) : null}+ </div>+ );+}diff --git a/src/components/features/conversation/conversation-overview-panel.constants.ts b/src/components/features/conversation/conversation-overview-panel.constants.tsnew file mode 100644index 0000000000..b153006fcc--- /dev/null+++ b/src/components/features/conversation/conversation-overview-panel.constants.ts@@ -0,0 +1,54 @@+export const CONVERSATION_OVERVIEW_AUTOMATIONS_PATH = "/automations";+export const CONVERSATION_OVERVIEW_SKILLS_PATH = "/skills";+export const CONVERSATION_OVERVIEW_MCP_PATH = "/mcp";++export const CONVERSATION_OVERVIEW_PANEL_WIDTH_PX = 240;+export const CONVERSATION_OVERVIEW_COLUMN_MIN_GAP_PX = 8;+/** Horizontal padding on the overview column (`pl-3` + `pr-4`). */+export const CONVERSATION_OVERVIEW_COLUMN_LEFT_PADDING_PX = 12;+export const CONVERSATION_OVERVIEW_COLUMN_RIGHT_PADDING_PX = 16;+export const CONVERSATION_OVERVIEW_COLUMN_HORIZONTAL_PADDING_PX =+ CONVERSATION_OVERVIEW_COLUMN_LEFT_PADDING_PX ++ CONVERSATION_OVERVIEW_COLUMN_RIGHT_PADDING_PX;+/** Minimum chat-thread width before the overview panel is hidden entirely. */+export const CONVERSATION_OVERVIEW_MIN_THREAD_WIDTH_PX = 320;++export const CONVERSATION_OVERVIEW_PANEL_TRANSITION = {+ duration: 0.2,+ ease: "easeInOut" as const,+};++export const CONVERSATION_OVERVIEW_COLUMN_WIDTH_PX =+ CONVERSATION_OVERVIEW_PANEL_WIDTH_PX ++ CONVERSATION_OVERVIEW_COLUMN_HORIZONTAL_PADDING_PX;++export function hasEnoughOverviewLayoutSpace(containerWidth: number): boolean {+ return (+ containerWidth >=+ CONVERSATION_OVERVIEW_COLUMN_WIDTH_PX ++ CONVERSATION_OVERVIEW_COLUMN_MIN_GAP_PX ++ CONVERSATION_OVERVIEW_MIN_THREAD_WIDTH_PX+ );+}++export const CONVERSATION_OVERVIEW_ADD_QUERY_PARAM = "add";+export const CONVERSATION_OVERVIEW_ADD_QUERY_VALUE = "1";++export const CONVERSATION_OVERVIEW_AUTOMATIONS_ADD_PATH =+ "/automations/dashboard?add=1";+export const CONVERSATION_OVERVIEW_SKILLS_ADD_PATH = "/skills?add=1";+export const CONVERSATION_OVERVIEW_MCP_ADD_PATH = "/mcp?add=1";++export function buildConversationOverviewAddPath(path: string): string {+ const separator = path.includes("?") ? "&" : "?";+ return `${path}${separator}${CONVERSATION_OVERVIEW_ADD_QUERY_PARAM}=${CONVERSATION_OVERVIEW_ADD_QUERY_VALUE}`;+}++export function hasConversationOverviewAddIntent(search: string): boolean {+ const normalized = search.startsWith("?") ? search.slice(1) : search;+ const params = new URLSearchParams(normalized);+ return (+ params.get(CONVERSATION_OVERVIEW_ADD_QUERY_PARAM) ===+ CONVERSATION_OVERVIEW_ADD_QUERY_VALUE+ );+}diff --git a/src/components/features/conversation/conversation-overview-panel.tsx b/src/components/features/conversation/conversation-overview-panel.tsxnew file mode 100644index 0000000000..56e7e5d85a--- /dev/null+++ b/src/components/features/conversation/conversation-overview-panel.tsx@@ -0,0 +1,182 @@+import React, { useRef, useState } from "react";+import { Laptop } from "lucide-react";+import { useTranslation } from "react-i18next";+import { useConversationOverviewStats } from "#/hooks/use-conversation-overview-stats";+import { useConversationId } from "#/hooks/use-conversation-id";+import { useConversationPrimaryRepository } from "#/hooks/use-conversation-primary-repository";+import { useConversationLocalStorageState } from "#/utils/conversation-local-storage";+import { ConversationOverviewDiffsRow } from "./conversation-overview-diffs-row";+import { ConversationOverviewContextMenu } from "./conversation-overview-context-menu";+import { ConversationOverviewGitSection } from "./conversation-overview-git-section";+import { EllipsisButton } from "#/components/features/conversation-panel/ellipsis-button";+import { Divider } from "#/ui/divider";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";+import {+ CONVERSATION_OVERVIEW_GIT_PART,+ CONVERSATION_OVERVIEW_SECTION,+ CONVERSATION_OVERVIEW_SECTION_GROUPS,+ isOverviewGitPartPinned,+ isOverviewSectionPinned,+ type ConversationOverviewSection,+} from "./conversation-overview-sections";++const PANEL_CLASSNAME = cn(+ "w-full max-w-[240px] rounded-xl border border-[var(--oh-border)]",+ "bg-[var(--oh-surface)] pb-1",+);++const ROW_CLASSNAME = cn(+ "flex items-center gap-2 rounded-md px-2 py-1.5",+ "transition-colors hover:bg-white/5",+);++const ROW_ICON_CLASSNAME = "size-4 shrink-0 text-[var(--oh-muted)]";++interface OverviewRowProps {+ icon: React.ReactNode;+ label: string;+ value: React.ReactNode;+ testId: string;+}++function OverviewRow({ icon, label, value, testId }: OverviewRowProps) {+ return (+ <li data-testid={testId} className={ROW_CLASSNAME}>+ {icon}+ <span className="min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]">+ {label}+ </span>+ <span className="max-w-[45%] shrink-0 truncate text-right text-sm text-[var(--oh-muted)]">+ {value}+ </span>+ </li>+ );+}++function OverviewSectionDivider() {+ // Match dropdown/context-menu separators: `px-1` host + `inset="menu"`+ // Divider (12px slot, line bleeds into the horizontal padding).+ return (+ <div className="px-1">+ <Divider inset="menu" />+ </div>+ );+}++type OverviewPanelBlock =+ | {+ kind: "sections";+ key: string;+ sections: ConversationOverviewSection[];+ }+ | { kind: "git"; key: "git" };++export function ConversationOverviewPanel() {+ const { t } = useTranslation("openhands");+ const stats = useConversationOverviewStats();+ const { conversationId } = useConversationId();+ const { state } = useConversationLocalStorageState(conversationId);+ const { isConnected: isGitConnected } = useConversationPrimaryRepository();+ const [isMenuOpen, setIsMenuOpen] = useState(false);+ const menuAnchorRef = useRef<HTMLButtonElement>(null);++ const isPinned = (section: ConversationOverviewSection) =>+ isOverviewSectionPinned(section, state.unpinnedOverviewSections ?? []);++ const showChanges = isOverviewGitPartPinned(+ CONVERSATION_OVERVIEW_GIT_PART.changes,+ state.unpinnedOverviewGitParts ?? [],+ );++ const showGitBlock =+ isPinned(CONVERSATION_OVERVIEW_SECTION.git) &&+ (showChanges || isGitConnected);++ const workspaceSections = CONVERSATION_OVERVIEW_SECTION_GROUPS.flatMap(+ (group) => group.sections.filter((section) => isPinned(section)),+ );++ // Git content first (untitled); Workspace sits below it.+ const panelBlocks: OverviewPanelBlock[] = [];+ if (showGitBlock) {+ panelBlocks.push({ kind: "git", key: "git" });+ }+ if (workspaceSections.length > 0) {+ panelBlocks.push({+ kind: "sections",+ key: workspaceSections.join("-"),+ sections: workspaceSections,+ });+ }++ const renderSection = (section: ConversationOverviewSection) => {+ switch (section) {+ case CONVERSATION_OVERVIEW_SECTION.workspace:+ return (+ <OverviewRow+ key={section}+ testId="conversation-overview-workspace"+ icon={<Laptop className={ROW_ICON_CLASSNAME} />}+ label={t(I18nKey.CONVERSATION$OVERVIEW_WORKSPACE)}+ value={stats.workspaceName ?? t(I18nKey.CONVERSATION$OVERVIEW_NONE)}+ />+ );+ case CONVERSATION_OVERVIEW_SECTION.git:+ // Rendered as its own panel block (not a group row).+ return null;+ default: {+ const _exhaustive: never = section;+ return _exhaustive;+ }+ }+ };++ return (+ <aside+ data-testid="conversation-overview-panel"+ aria-label={t(I18nKey.CONVERSATION$OVERVIEW)}+ className={PANEL_CLASSNAME}+ >+ <div className="flex items-center justify-between px-4 pb-0.5 pt-2.5">+ <span className="text-xs font-medium text-[var(--oh-muted)]">+ {t(I18nKey.CONVERSATION$OVERVIEW)}+ </span>+ <div className="relative shrink-0">+ <EllipsisButton+ ref={menuAnchorRef}+ testId="conversation-overview-ellipsis"+ onClick={() => setIsMenuOpen((open) => !open)}+ ariaLabel={t(I18nKey.COMMON$MORE_OPTIONS)}+ />+ <ConversationOverviewContextMenu+ isOpen={isMenuOpen}+ onClose={() => setIsMenuOpen(false)}+ ignoreOutsideClickRef={menuAnchorRef}+ anchorRef={menuAnchorRef}+ />+ </div>+ </div>++ {panelBlocks.map((block, blockIndex) => (+ <React.Fragment key={block.key}>+ {blockIndex > 0 ? <OverviewSectionDivider /> : null}+ {block.kind === "git" ? (+ <div data-testid="conversation-overview-git-block">+ {showChanges ? (+ <ul className="px-2">+ <ConversationOverviewDiffsRow />+ </ul>+ ) : null}+ {isGitConnected ? <ConversationOverviewGitSection /> : null}+ </div>+ ) : (+ <ul className="px-2">+ {block.sections.map((section) => renderSection(section))}+ </ul>+ )}+ </React.Fragment>+ ))}+ </aside>+ );+}diff --git a/src/components/features/conversation/conversation-overview-project-scope-toggle.tsx b/src/components/features/conversation/conversation-overview-project-scope-toggle.tsxnew file mode 100644index 0000000000..44257fb13f--- /dev/null+++ b/src/components/features/conversation/conversation-overview-project-scope-toggle.tsx@@ -0,0 +1,42 @@+import { useTranslation } from "react-i18next";+import { SegmentedToggle } from "#/components/features/files-tab/segmented-toggle";+import { I18nKey } from "#/i18n/declaration";+import {+ CONVERSATION_OVERVIEW_PROJECT_SCOPE,+ type ConversationOverviewProjectScope,+} from "#/utils/conversation-overview-project-scope";++interface ConversationOverviewProjectScopeToggleProps {+ value: ConversationOverviewProjectScope;+ onChange: (value: ConversationOverviewProjectScope) => void;+ testId: string;+}++export function ConversationOverviewProjectScopeToggle({+ value,+ onChange,+ testId,+}: ConversationOverviewProjectScopeToggleProps) {+ const { t } = useTranslation("openhands");++ return (+ <div className="flex w-full justify-center [&>[role=radiogroup]]:w-full">+ <SegmentedToggle<ConversationOverviewProjectScope>+ value={value}+ onChange={onChange}+ ariaLabel={t(I18nKey.CONVERSATION$OVERVIEW_SCOPE_FILTER)}+ testId={testId}+ options={[+ {+ value: CONVERSATION_OVERVIEW_PROJECT_SCOPE.project,+ label: t(I18nKey.CONVERSATION$OVERVIEW_SCOPE_PROJECT),+ },+ {+ value: CONVERSATION_OVERVIEW_PROJECT_SCOPE.all,+ label: t(I18nKey.CONVERSATION$OVERVIEW_SCOPE_ALL),+ },+ ]}+ />+ </div>+ );+}diff --git a/src/components/features/conversation/conversation-overview-secrets-panel.tsx b/src/components/features/conversation/conversation-overview-secrets-panel.tsxnew file mode 100644index 0000000000..3fbc629cd4--- /dev/null+++ b/src/components/features/conversation/conversation-overview-secrets-panel.tsx@@ -0,0 +1,139 @@+import React, { useEffect, useState } from "react";+import { useQueryClient } from "@tanstack/react-query";+import { Trash2 } from "lucide-react";+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import { useSearchSecrets } from "#/hooks/query/use-get-secrets";+import { useDeleteSecret } from "#/hooks/mutation/use-delete-secret";+import { SecretForm } from "#/components/features/settings/secrets-settings/secret-form";+import { ConfirmationModal } from "#/components/shared/modals/confirmation-modal";+import { cn } from "#/utils/utils";+import { extensionModuleEmptyStateClassName } from "#/utils/extension-module-card-classes";+import { useConversationOverviewDrawerOptional } from "./conversation-overview-drawer-context";++interface ConversationOverviewSecretsPanelProps {+ openAdd: boolean;+}++export function ConversationOverviewSecretsPanel({+ openAdd,+}: ConversationOverviewSecretsPanelProps) {+ const queryClient = useQueryClient();+ const { t } = useTranslation("openhands");+ const addRequestKey =+ useConversationOverviewDrawerOptional()?.addRequestKey ?? 0;++ const { data: secrets, isLoading } = useSearchSecrets();+ const { mutate: deleteSecret, isPending: isDeleting } = useDeleteSecret();++ const [view, setView] = useState<"list" | "add-secret-form">("list");+ const [secretToDelete, setSecretToDelete] = useState<string | null>(null);++ useEffect(() => {+ if (!openAdd) {+ return;+ }+ setView("add-secret-form");+ }, [openAdd]);++ useEffect(() => {+ if (addRequestKey === 0) {+ return;+ }+ setView("add-secret-form");+ }, [addRequestKey]);++ const invalidateSecrets = () => {+ queryClient.invalidateQueries({ queryKey: ["secrets-search"] });+ queryClient.invalidateQueries({ queryKey: ["secrets"] });+ };++ if (view === "add-secret-form") {+ return (+ <div+ data-testid="conversation-overview-secrets-add-form"+ className="flex h-full min-h-0 flex-col overflow-y-auto p-4"+ >+ <SecretForm+ mode="add"+ selectedSecret={null}+ onCancel={() => setView("list")}+ />+ </div>+ );+ }++ return (+ <div+ data-testid="conversation-overview-secrets-panel"+ className="flex h-full min-h-0 flex-col"+ >+ <div className="min-h-0 flex-1 overflow-y-auto px-2 py-2">+ {isLoading ? (+ <p className="px-2 py-4 text-sm text-[var(--oh-muted)]">+ {t(I18nKey.HOME$LOADING)}+ </p>+ ) : secrets && secrets.length > 0 ? (+ <ul className="flex flex-col gap-0.5">+ {secrets.map((secret) => (+ <li+ key={secret.name}+ data-testid="conversation-overview-secret-item"+ className="group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-white/5"+ >+ <div className="min-w-0 flex-1">+ <p className="truncate text-sm text-[var(--oh-foreground)]">+ {secret.name}+ </p>+ {secret.description ? (+ <p className="truncate text-xs text-[var(--oh-muted)]">+ {secret.description}+ </p>+ ) : null}+ </div>+ <button+ type="button"+ data-testid={`conversation-overview-secret-delete-${secret.name}`}+ aria-label={t(I18nKey.BUTTON$DELETE)}+ onClick={() => setSecretToDelete(secret.name)}+ className={cn(+ "shrink-0 rounded-md p-1 text-[var(--oh-muted)]",+ "opacity-0 transition-opacity group-hover:opacity-100",+ "hover:bg-white/10 hover:text-[var(--oh-foreground)]",+ )}+ >+ <Trash2 className="size-3.5" aria-hidden />+ </button>+ </li>+ ))}+ </ul>+ ) : (+ <p+ data-testid="conversation-overview-secrets-empty"+ className={cn(+ extensionModuleEmptyStateClassName,+ "px-2 py-6 text-center text-sm",+ )}+ >+ {t(I18nKey.SECRETS$EMPTY)}+ </p>+ )}+ </div>++ {secretToDelete ? (+ <ConfirmationModal+ text={t(I18nKey.SECRETS$CONFIRM_DELETE_KEY)}+ isConfirming={isDeleting}+ onCancel={() => setSecretToDelete(null)}+ onConfirm={() => {+ deleteSecret(secretToDelete, {+ onSettled: () => setSecretToDelete(null),+ onSuccess: invalidateSecrets,+ onError: invalidateSecrets,+ });+ }}+ />+ ) : null}+ </div>+ );+}diff --git a/src/components/features/conversation/conversation-overview-sections.ts b/src/components/features/conversation/conversation-overview-sections.tsnew file mode 100644index 0000000000..69c7985988--- /dev/null+++ b/src/components/features/conversation/conversation-overview-sections.ts@@ -0,0 +1,83 @@+/**+ * Pinable rows in the conversation overview panel.+ * Persistence uses the inverse denylist `unpinnedOverviewSections`+ * (empty = all pinned), matching drawer tab pin semantics.+ *+ * Git is a pinable parent section with its own sub-part denylist+ * (`unpinnedOverviewGitParts`), including Changes.+ */+export const CONVERSATION_OVERVIEW_SECTION = {+ workspace: "workspace",+ git: "git",+} as const;++export type ConversationOverviewSection =+ (typeof CONVERSATION_OVERVIEW_SECTION)[keyof typeof CONVERSATION_OVERVIEW_SECTION];++export const CONVERSATION_OVERVIEW_SECTIONS: readonly ConversationOverviewSection[] =+ [CONVERSATION_OVERVIEW_SECTION.workspace, CONVERSATION_OVERVIEW_SECTION.git];++export const VALID_CONVERSATION_OVERVIEW_SECTIONS: ReadonlySet<string> =+ new Set(CONVERSATION_OVERVIEW_SECTIONS);++/**+ * Sub-rows inside the git overview block. Controlled independently via+ * `unpinnedOverviewGitParts` when the parent git section is pinned.+ * Changes lives here (not as a top-level overview section).+ */+export const CONVERSATION_OVERVIEW_GIT_PART = {+ changes: "changes",+ repository: "repository",+ branch: "branch",+ commits: "commits",+ pull_requests: "pull_requests",+} as const;++export type ConversationOverviewGitPart =+ (typeof CONVERSATION_OVERVIEW_GIT_PART)[keyof typeof CONVERSATION_OVERVIEW_GIT_PART];++export const CONVERSATION_OVERVIEW_GIT_PARTS: readonly ConversationOverviewGitPart[] =+ [+ CONVERSATION_OVERVIEW_GIT_PART.changes,+ CONVERSATION_OVERVIEW_GIT_PART.repository,+ CONVERSATION_OVERVIEW_GIT_PART.branch,+ CONVERSATION_OVERVIEW_GIT_PART.commits,+ CONVERSATION_OVERVIEW_GIT_PART.pull_requests,+ ];++export const VALID_CONVERSATION_OVERVIEW_GIT_PARTS: ReadonlySet<string> =+ new Set(CONVERSATION_OVERVIEW_GIT_PARTS);++/** No overview sections are hidden by default. */+export const DEFAULT_UNPINNED_OVERVIEW_SECTIONS: readonly ConversationOverviewSection[] =+ [];++export const DEFAULT_UNPINNED_OVERVIEW_GIT_PARTS: readonly ConversationOverviewGitPart[] =+ [];++/**+ * Visual groups in the panel. Dividers render between non-empty groups.+ * Workspace stands alone below the untitled Git block (Changes + metadata)+ * that the panel prepends when pinned.+ */+export const CONVERSATION_OVERVIEW_SECTION_GROUPS: readonly {+ sections: readonly ConversationOverviewSection[];+}[] = [+ {+ sections: [CONVERSATION_OVERVIEW_SECTION.workspace],+ },+];++export function isOverviewSectionPinned(+ section: ConversationOverviewSection,+ unpinnedOverviewSections: readonly string[],+): boolean {+ return !unpinnedOverviewSections.includes(section);+}++export function isOverviewGitPartPinned(+ part: ConversationOverviewGitPart,+ unpinnedOverviewGitParts: readonly string[],+): boolean {+ return !unpinnedOverviewGitParts.includes(part);+}diff --git a/src/components/features/conversation/conversation-overview-skills-panel.tsx b/src/components/features/conversation/conversation-overview-skills-panel.tsxnew file mode 100644index 0000000000..58cb6eda18--- /dev/null+++ b/src/components/features/conversation/conversation-overview-skills-panel.tsx@@ -0,0 +1,259 @@+import React, { useEffect, useMemo, useState } from "react";+import { useTranslation } from "react-i18next";+import { I18nKey } from "#/i18n/declaration";+import { useSaveSettings } from "#/hooks/mutation/use-save-settings";+import { useSettings } from "#/hooks/query/use-settings";+import { useActiveConversation } from "#/hooks/query/use-active-conversation";+import { useConversationSkills } from "#/hooks/query/use-conversation-skills";+import { SkillCard } from "#/components/features/skills/skill-card";+import { SkillDetailModal } from "#/components/features/skills/skill-detail-modal";+import { AddSkillModal } from "#/components/features/skills/add-skill-modal";+import { SkillsToolbar } from "#/components/features/skills/skills-toolbar";+import { SkillFiltersModal } from "#/components/features/skills/skill-filters-modal";+import {+ applySkillFilters,+ buildSkillFacetGroups,+ clearSkillFilterFacets,+ countActiveFilters,+ toggleSkillFilterValue,+ EMPTY_SKILL_FILTER_STATE,+ type SkillFilterState,+} from "#/components/features/skills/skill-filter";+import {+ extensionModuleCardGridClassName,+ extensionModuleCardGridContainerClassName,+ extensionModuleEmptyStateClassName,+} from "#/utils/extension-module-card-classes";+import { displayErrorToast } from "#/utils/custom-toast-handlers";+import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";+import type { SkillInfo } from "#/types/settings";+import { cn } from "#/utils/utils";+import {+ CONVERSATION_OVERVIEW_PROJECT_SCOPE,+ filterSkillsByProjectScope,+ sortSkillsByProjectRelevance,+ type ConversationOverviewProjectScope,+} from "#/utils/conversation-overview-project-scope";+import { useConversationOverviewDrawerOptional } from "./conversation-overview-drawer-context";+import { ConversationOverviewProjectScopeToggle } from "./conversation-overview-project-scope-toggle";++interface ConversationOverviewSkillsPanelProps {+ openAdd: boolean;+}++export function ConversationOverviewSkillsPanel({+ openAdd,+}: ConversationOverviewSkillsPanelProps) {+ const { t } = useTranslation("openhands");+ const { mutate: saveSettings } = useSaveSettings();+ const { data: settings, isLoading: settingsLoading } = useSettings();+ const { data: conversation } = useActiveConversation();+ const { data: skills, isLoading: skillsLoading } = useConversationSkills();+ const addRequestKey =+ useConversationOverviewDrawerOptional()?.addRequestKey ?? 0;+ const projectDir = conversation?.selected_workspace ?? null;++ const [disabledSet, setDisabledSet] = useState<Set<string>>(new Set());+ const [hasHydratedInitialSettings, setHasHydratedInitialSettings] =+ useState(false);+ const [projectScope, setProjectScope] =+ useState<ConversationOverviewProjectScope>(+ CONVERSATION_OVERVIEW_PROJECT_SCOPE.project,+ );+ const [filter, setFilter] = useState<SkillFilterState>(+ EMPTY_SKILL_FILTER_STATE,+ );+ const [isFiltersModalOpen, setIsFiltersModalOpen] = useState(false);+ const [selectedSkill, setSelectedSkill] = useState<SkillInfo | null>(null);+ const [showAddSkillModal, setShowAddSkillModal] = useState(false);++ useEffect(() => {+ if (settingsLoading || !settings) {+ return;+ }+ setDisabledSet(new Set(settings.disabled_skills ?? []));+ setHasHydratedInitialSettings(true);+ }, [settingsLoading, settings?.disabled_skills]);++ useEffect(() => {+ if (!openAdd) {+ return;+ }+ setShowAddSkillModal(true);+ }, [openAdd]);++ useEffect(() => {+ if (addRequestKey === 0) {+ return;+ }+ setShowAddSkillModal(true);+ }, [addRequestKey]);++ useEffect(() => {+ if (!hasHydratedInitialSettings) {+ return;+ }+ saveSettings(+ { disabled_skills: Array.from(disabledSet) },+ {+ onError: (error) => {+ displayErrorToast(+ retrieveAxiosErrorMessage(error) || t(I18nKey.ERROR$GENERIC),+ );+ },+ },+ );+ }, [disabledSet, hasHydratedInitialSettings, saveSettings, t]);++ const scopedSkills = useMemo(() => {+ if (!skills) {+ return [];+ }+ const filtered = filterSkillsByProjectScope(+ skills,+ projectScope,+ projectDir,+ );+ return projectScope === CONVERSATION_OVERVIEW_PROJECT_SCOPE.all+ ? sortSkillsByProjectRelevance(filtered, projectDir)+ : filtered;+ }, [skills, projectScope, projectDir]);++ const filteredSkills = useMemo(+ () => applySkillFilters(scopedSkills, disabledSet, filter),+ [scopedSkills, disabledSet, filter],+ );++ const handleToggle = (skillName: string, enabled: boolean) => {+ setDisabledSet((previous) => {+ const next = new Set(previous);+ if (enabled) {+ next.delete(skillName);+ } else {+ next.add(skillName);+ }+ return next;+ });+ };++ if (skillsLoading || settingsLoading) {+ return (+ <div+ data-testid="conversation-overview-skills-panel"+ className="text-sm text-muted"+ >+ …+ </div>+ );+ }++ if (!skills || skills.length === 0) {+ return (+ <div+ data-testid="conversation-overview-skills-panel"+ className="flex flex-col gap-4"+ >+ <div+ data-testid="conversation-overview-skills-empty"+ className={extensionModuleEmptyStateClassName}+ >+ <p className="text-sm text-tertiary-light">+ {t(I18nKey.SETTINGS$SKILLS_NO_SKILLS)}+ </p>+ </div>+ {showAddSkillModal ? (+ <AddSkillModal onClose={() => setShowAddSkillModal(false)} />+ ) : null}+ </div>+ );+ }++ return (+ <div+ data-testid="conversation-overview-skills-panel"+ className="flex flex-col gap-4"+ >+ <ConversationOverviewProjectScopeToggle+ value={projectScope}+ onChange={setProjectScope}+ testId="conversation-overview-skills-scope"+ />+ <SkillsToolbar+ search={filter.query}+ onSearchChange={(query) =>+ setFilter((previous) => ({ ...previous, query }))+ }+ activeFilterCount={countActiveFilters(filter)}+ onOpenFilters={() => setIsFiltersModalOpen(true)}+ />++ {scopedSkills.length === 0 ? (+ <div+ data-testid="conversation-overview-skills-project-empty"+ className={extensionModuleEmptyStateClassName}+ >+ <p className="text-sm text-tertiary-light">+ {t(I18nKey.CONVERSATION$OVERVIEW_SCOPE_PROJECT_EMPTY_SKILLS)}+ </p>+ </div>+ ) : filteredSkills.length === 0 ? (+ <div+ data-testid="conversation-overview-skills-no-match"+ className={extensionModuleEmptyStateClassName}+ >+ <p className="text-sm text-tertiary-light">+ {t(I18nKey.SETTINGS$SKILLS_NO_MATCH)}+ </p>+ </div>+ ) : (+ <section+ className={cn(+ "flex min-w-0 flex-col gap-3",+ extensionModuleCardGridContainerClassName,+ )}+ >+ <div className={cn(extensionModuleCardGridClassName, "grid-cols-1")}>+ {filteredSkills.map((skill) => (+ <SkillCard+ key={skill.name}+ skill={skill}+ enabled={!disabledSet.has(skill.name)}+ onOpen={() => setSelectedSkill(skill)}+ onToggle={(enabled) => handleToggle(skill.name, enabled)}+ />+ ))}+ </div>+ </section>+ )}++ {selectedSkill ? (+ <SkillDetailModal+ skill={selectedSkill}+ enabled={!disabledSet.has(selectedSkill.name)}+ onToggle={(enabled) => handleToggle(selectedSkill.name, enabled)}+ onClose={() => setSelectedSkill(null)}+ />+ ) : null}++ {showAddSkillModal ? (+ <AddSkillModal onClose={() => setShowAddSkillModal(false)} />+ ) : null}++ {isFiltersModalOpen ? (+ <SkillFiltersModal+ groups={buildSkillFacetGroups(scopedSkills, disabledSet, filter)}+ activeCount={countActiveFilters(filter)}+ onToggle={(groupId, value) =>+ setFilter((previous) =>+ toggleSkillFilterValue(previous, groupId, value),+ )+ }+ onClearAll={() =>+ setFilter((previous) => clearSkillFilterFacets(previous))+ }+ onClose={() => setIsFiltersModalOpen(false)}+ />+ ) : null}+ </div>+ );+}diff --git a/src/components/features/conversation/conversation-overview-toggle.tsx b/src/components/features/conversation/conversation-overview-toggle.tsxnew file mode 100644index 0000000000..a350ebccb0--- /dev/null+++ b/src/components/features/conversation/conversation-overview-toggle.tsx@@ -0,0 +1,183 @@+import { useEffect, useLayoutEffect, useRef, useState } from "react";+import ReactDOM from "react-dom";+import { Info } from "lucide-react";+import { useTranslation } from "react-i18next";+import { useConversationStore } from "#/stores/conversation-store";+import {+ openConversationOverviewPanelPeek,+ scheduleCloseConversationOverviewPanelPeek,+ useSyncConversationOverviewPanelPeek,+} from "#/hooks/use-conversation-overview-panel-peek";+import { I18nKey } from "#/i18n/declaration";+import { cn } from "#/utils/utils";+import { mobileTopBarIconButtonClassName } from "#/utils/mobile-top-bar-icon-button-classes";+import { ChatActionTooltip } from "../chat/chat-action-tooltip";+import { useIsArchivedConversation } from "#/hooks/use-is-archived-conversation";+import { useOptionalConversationId } from "#/hooks/use-conversation-id";+import { setConversationState } from "#/utils/conversation-local-storage";+import { ConversationOverviewPanel } from "./conversation-overview-panel";+import { CONVERSATION_OVERVIEW_PANEL_WIDTH_PX } from "./conversation-overview-panel.constants";++interface ConversationOverviewToggleProps {+ className?: string;+}++/**+ * Info toggle for the session-only overview panel beside the chat thread.+ * Opening overview closes the files/diffs drawer; the panel also auto-hides+ * when that drawer opens from elsewhere. While the drawer is open, hovering+ * this control peeks the overview as a portaled overlay.+ */+export function ConversationOverviewToggle({+ className,+}: ConversationOverviewToggleProps) {+ const { t } = useTranslation("openhands");+ const isArchivedConversation = useIsArchivedConversation();+ const { conversationId } = useOptionalConversationId();+ const triggerRef = useRef<HTMLDivElement>(null);+ const [peekPosition, setPeekPosition] = useState<{+ top: number;+ left: number;+ } | null>(null);+ const {+ isOverviewPanelShown,+ isOverviewPanelPeeked,+ isRightPanelShown,+ setIsOverviewPanelShown,+ setHasRightPanelToggled,+ setIsRightPanelShown,+ } = useConversationStore();++ useSyncConversationOverviewPanelPeek();++ useEffect(() => {+ if (isRightPanelShown && isOverviewPanelShown) {+ setIsOverviewPanelShown(false);+ }+ }, [isOverviewPanelShown, isRightPanelShown, setIsOverviewPanelShown]);++ const canPeekOnHover =+ !isArchivedConversation && isRightPanelShown && !isOverviewPanelShown;+ const showPeek = canPeekOnHover && isOverviewPanelPeeked;++ useLayoutEffect(() => {+ if (!showPeek) {+ setPeekPosition(null);+ return undefined;+ }++ const updatePosition = () => {+ const rect = triggerRef.current?.getBoundingClientRect();+ if (!rect) {+ return;+ }++ setPeekPosition({+ top: rect.bottom + 4,+ left: Math.max(8, rect.right - CONVERSATION_OVERVIEW_PANEL_WIDTH_PX),+ });+ };++ updatePosition();+ window.addEventListener("resize", updatePosition);+ window.addEventListener("scroll", updatePosition, true);+ return () => {+ window.removeEventListener("resize", updatePosition);+ window.removeEventListener("scroll", updatePosition, true);+ };+ }, [showPeek]);++ const handleToggle = () => {+ if (isArchivedConversation) {+ return;+ }++ // Reveal overview by closing the files/diffs drawer first; otherwise the+ // mutual-exclusion effect above would immediately hide overview again.+ if (isRightPanelShown) {+ setHasRightPanelToggled(false);+ setIsRightPanelShown(false);+ if (conversationId) {+ setConversationState(conversationId, { rightPanelShown: false });+ }+ setIsOverviewPanelShown(true);+ return;+ }++ setIsOverviewPanelShown(!isOverviewPanelShown);+ };++ const isOverviewVisible = isOverviewPanelShown || showPeek;++ const tooltipText = isArchivedConversation+ ? t(I18nKey.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES)+ : isOverviewPanelShown+ ? t(I18nKey.CONVERSATION$HIDE_OVERVIEW)+ : t(I18nKey.CONVERSATION$SHOW_OVERVIEW);++ const peek =+ showPeek && peekPosition+ ? ReactDOM.createPortal(+ <div+ data-testid="conversation-overview-peek"+ className="fixed z-50"+ style={{+ top: peekPosition.top,+ left: peekPosition.left,+ width: CONVERSATION_OVERVIEW_PANEL_WIDTH_PX,+ }}+ onMouseEnter={openConversationOverviewPanelPeek}+ onMouseLeave={scheduleCloseConversationOverviewPanelPeek}+ >+ <div className="shadow-lg">+ <ConversationOverviewPanel />+ </div>+ </div>,+ document.body,+ )+ : null;++ return (+ <>+ <div+ ref={triggerRef}+ className="relative inline-flex items-center self-center"+ onMouseEnter={() => {+ if (canPeekOnHover) {+ openConversationOverviewPanelPeek();+ }+ }}+ onMouseLeave={() => {+ if (canPeekOnHover || isOverviewPanelPeeked) {+ scheduleCloseConversationOverviewPanelPeek();+ }+ }}+ >+ <ChatActionTooltip tooltip={tooltipText} ariaLabel={tooltipText}>+ <button+ type="button"+ onClick={handleToggle}+ disabled={isArchivedConversation}+ className={cn(+ // Match RightPanelToggle hit target (p-1 + size-5 = 28px) while+ // keeping the smaller Info glyph.+ mobileTopBarIconButtonClassName,+ "size-7",+ isOverviewVisible && "bg-white/10 text-[var(--oh-foreground)]",+ isArchivedConversation &&+ "cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]",+ className,+ )}+ aria-label={tooltipText}+ aria-pressed={isOverviewPanelShown}+ aria-disabled={isArchivedConversation}+ data-testid="conversation-overview-toggle"+ >+ <Info className="h-4 w-4 shrink-0" size={16} aria-hidden />+ </button>+ </ChatActionTooltip>+ </div>+ {peek}+ </>+ );+}diff --git a/src/components/features/conversation/conversation-secondary-drawer.classes.ts b/src/components/features/conversation/conversation-secondary-drawer.classes.tsnew file mode 100644index 0000000000..c61267496c--- /dev/null+++ b/src/components/features/conversation/conversation-secondary-drawer.classes.ts@@ -0,0 +1,16 @@+import { cn } from "#/utils/utils";++/** Matches conversation tabs chrome height; right inset aligns with drawer body `px-4`. */+export const CONVERSATION_SECONDARY_DRAWER_HEADER_CLASSNAME = cn(+ "flex h-10 min-h-10 shrink-0 items-center gap-1.5",+ "border-b border-[var(--oh-border)] py-1 pl-1 pr-4",+);++export const CONVERSATION_SECONDARY_DRAWER_HEADER_ACTION_CLASSNAME = cn(+ "h-7 min-h-7 shrink-0 whitespace-nowrap px-2.5 text-xs",+);++export const CONVERSATION_SECONDARY_DRAWER_CLOSE_BUTTON_CLASSNAME = cn(+ "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md",+ "text-muted transition-colors hover:bg-white/10 hover:text-white",+);diff --git a/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx b/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsxindex 5b3a47f17f..4f2da30496 100644--- a/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx+++ b/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx@@ -10,6 +10,7 @@ import { useConversationId } from "#/hooks/use-conversation-id";// xterm.css are large enough that we don't want them in the conversation// route's eager graph just because the terminal tab might be selected later.const FilesTab = lazy(() => import("#/routes/files-tab"));+const CommitsTab = lazy(() => import("#/routes/commits-tab"));const BrowserTab = lazy(() => import("#/routes/browser-tab"));const PlannerTab = lazy(() => import("#/routes/planner-tab"));const TaskListTab = lazy(() => import("#/routes/task-list-tab"));@@ -19,6 +20,7 @@ const Terminal = lazy(() => import("#/components/features/terminal/terminal"));const TAB_CONFIG = {tasklist: { component: TaskListTab },files: { component: FilesTab },+ commits: { component: CommitsTab },browser: { component: BrowserTab },terminal: { component: Terminal },planner: { component: PlannerTab },diff --git a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsxindex 66bf11b098..3634050ae9 100644--- a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx+++ b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx@@ -11,6 +11,7 @@ import {} from "#/stores/conversation-store";import { I18nKey } from "#/i18n/declaration";import { Gauge, Globe, ListTodo, SquareChevronRight } from "lucide-react";+import { LuFileDiff } from "react-icons/lu";import DocumentIcon from "#/icons/document.svg?react";import PillIcon from "#/icons/pill.svg?react";import PillFillIcon from "#/icons/pill-fill.svg?react";@@ -96,6 +97,11 @@ export function ConversationTabsContextMenu({i18nKey: I18nKey.COMMON$PLANNER,},{ tab: "files", icon: DocumentIcon, i18nKey: I18nKey.COMMON$FILES },+ {+ tab: "commits",+ icon: LuFileDiff,+ i18nKey: I18nKey.DIFF_VIEWER$COMMITS,+ },{tab: "terminal",icon: SquareChevronRight,diff --git a/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx b/src/components/features/conversation/conversation-tabs/conversation-tabs.tsxindex 9fa2114168..3cee80c953 100644--- a/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx+++ b/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx@@ -2,6 +2,7 @@ import { useEffect, useLayoutEffect, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { LayoutGroup } from "framer-motion";import { Gauge, Globe, ListTodo, SquareChevronRight } from "lucide-react";+import { LuFileDiff } from "react-icons/lu";import DocumentIcon from "#/icons/document.svg?react";import DoubleCheckIcon from "#/icons/double-check.svg?react";import { EllipsisButton } from "#/components/features/conversation-panel/ellipsis-button";@@ -91,6 +92,15 @@ export function ConversationTabs({tooltipAriaLabel: t(I18nKey.COMMON$FILES),label: t(I18nKey.COMMON$FILES),},+ {+ tabValue: "commits",+ isActive: isTabActive("commits"),+ icon: LuFileDiff,+ onClick: () => selectTab("commits"),+ tooltipContent: t(I18nKey.DIFF_VIEWER$COMMITS),+ tooltipAriaLabel: t(I18nKey.DIFF_VIEWER$COMMITS),+ label: t(I18nKey.DIFF_VIEWER$COMMITS),+ },{tabValue: "planner",isActive: isTabActive("planner"),@@ -131,8 +141,8 @@ export function ConversationTabs({];if (hasTaskList) {- // Insert after `files` so the leftmost slot stays Files.- tabs.splice(1, 0, {+ // Insert after the file-related tabs.+ tabs.splice(2, 0, {tabValue: "tasklist",isActive: isTabActive("tasklist"),icon: DoubleCheckIcon,diff --git a/src/components/features/conversation/right-panel-toggle.tsx b/src/components/features/conversation/right-panel-toggle.tsxindex bd59199caa..2c0e2f0744 100644--- a/src/components/features/conversation/right-panel-toggle.tsx+++ b/src/components/features/conversation/right-panel-toggle.tsx@@ -1,6 +1,7 @@import { useNavigate } from "react-router";import { useTranslation } from "react-i18next";import { useConversationStore } from "#/stores/conversation-store";+import { setConversationState } from "#/utils/conversation-local-storage";import { I18nKey } from "#/i18n/declaration";import { cn } from "#/utils/utils";import { mobileTopBarIconButtonClassName } from "#/utils/mobile-top-bar-icon-button-classes";@@ -19,8 +20,9 @@ interface RightPanelToggleProps {** Placed in the chat header so users can always restore the panel,* even when it's hidden. The open/closed state lives in the in-memory- * Zustand store and is intentionally not persisted across full reloads —- * see the comment in `useConversationStore` for the rationale.+ * Zustand store; each toggle is also mirrored into the conversation's+ * localStorage blob (`rightPanelShown`) so other drawer surfaces can+ * coordinate with it.*/export function RightPanelToggle({ className }: RightPanelToggleProps) {const { t } = useTranslation("openhands");@@ -44,6 +46,7 @@ export function RightPanelToggle({ className }: RightPanelToggleProps) {if (!conversationId) return;setHasRightPanelToggled(true);setIsRightPanelShown(true);+ setConversationState(conversationId, { rightPanelShown: true });const { selectedTab } = useConversationStore.getState();if (!selectedTab) {setSelectedTab("files");@@ -55,6 +58,9 @@ export function RightPanelToggle({ className }: RightPanelToggleProps) {const newState = !isRightPanelShown;setHasRightPanelToggled(newState);setIsRightPanelShown(newState);+ if (conversationId) {+ setConversationState(conversationId, { rightPanelShown: newState });+ }if (newState) {const { selectedTab } = useConversationStore.getState();@@ -82,6 +88,7 @@ export function RightPanelToggle({ className }: RightPanelToggleProps) {disabled={isArchivedConversation}className={cn(mobileTopBarIconButtonClassName,+ "size-7 self-center",isArchivedConversation &&"cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]",className,@@ -91,7 +98,7 @@ export function RightPanelToggle({ className }: RightPanelToggleProps) {aria-disabled={isArchivedConversation}data-testid="right-panel-toggle">- <BlockDrawerLeftIcon className="w-5 h-5 -scale-x-100" />+ <BlockDrawerLeftIcon className="size-5 -scale-x-100" /></button></ChatActionTooltip>);diff --git a/src/components/features/diff-viewer/accordion-panel.tsx b/src/components/features/diff-viewer/accordion-panel.tsxnew file mode 100644index 0000000000..c3b11c2e1a--- /dev/null+++ b/src/components/features/diff-viewer/accordion-panel.tsx@@ -0,0 +1,54 @@+import type { ReactNode } from "react";+import { AnimatePresence, motion, useReducedMotion } from "framer-motion";+import { cn } from "#/utils/utils";++const ACCORDION_TRANSITION = {+ duration: 0.2,+ ease: "easeInOut" as const,+};++interface AccordionPanelProps {+ open: boolean;+ children: ReactNode;+ testId?: string;+ className?: string;+}++/**+ * Height/opacity expand-collapse wrapper for Diffs / Commits accordion rows.+ * Honors prefers-reduced-motion by skipping animation.+ */+export function AccordionPanel({+ open,+ children,+ testId,+ className,+}: AccordionPanelProps) {+ const reduceMotion = useReducedMotion();++ if (reduceMotion) {+ return open ? (+ <div data-testid={testId} className={className}>+ {children}+ </div>+ ) : null;+ }++ return (+ <AnimatePresence initial={false}>+ {open ? (+ <motion.div+ key="accordion-panel"+ data-testid={testId}+ initial={{ height: 0, opacity: 0 }}+ animate={{ height: "auto", opacity: 1 }}+ exit={{ height: 0, opacity: 0 }}+ transition={ACCORDION_TRANSITION}+ className={cn("overflow-hidden", className)}+ >+ {children}+ </motion.div>+ ) : null}+ </AnimatePresence>+ );+}diff --git a/src/components/features/diff-viewer/commit-list.tsx b/src/components/features/diff-viewer/commit-list.tsxindex 9822cf0a78..361132965d 100644--- a/src/components/features/diff-viewer/commit-list.tsx+++ b/src/components/features/diff-viewer/commit-list.tsx@@ -3,11 +3,18 @@ import { useTranslation } from "react-i18next";import { GitCommit } from "#/api/open-hands.types";import { I18nKey } from "#/i18n/declaration";import { CommitRow } from "./commit-row";+import { UncommittedChangesRow } from "./uncommitted-changes-row";+import type { DiffChangeListItem } from "./diff-change-list";++const UNCOMMITTED_KEY = "uncommitted";export interface CommitListProps {commits: GitCommit[];/** True when the server capped the page — surfaces the cap notice. */hasMore: boolean;+ uncommittedChanges: DiffChangeListItem[];+ autoExpandUncommitted?: boolean;+ onAutoExpandHandled?: () => void;}/**@@ -16,9 +23,21 @@ export interface CommitListProps {* Empty/loading/waiting states are the host view's job* (see routes/commits-tab.tsx).*/-export function CommitList({ commits, hasMore }: CommitListProps) {+export function CommitList({+ commits,+ hasMore,+ uncommittedChanges,+ autoExpandUncommitted = false,+ onAutoExpandHandled,+}: CommitListProps) {const { t } = useTranslation("openhands");- const [expandedSha, setExpandedSha] = React.useState<string | null>(null);+ const [expandedKey, setExpandedKey] = React.useState<string | null>(null);++ React.useEffect(() => {+ if (!autoExpandUncommitted) return;+ setExpandedKey(UNCOMMITTED_KEY);+ onAutoExpandHandled?.();+ }, [autoExpandUncommitted, onAutoExpandHandled]);// Author is noise when every commit has the same one (the usual// single-agent conversation); show it only when authors differ.@@ -26,14 +45,23 @@ export function CommitList({ commits, hasMore }: CommitListProps) {return (<section data-testid="commit-list" className="w-full flex flex-col">+ <UncommittedChangesRow+ changes={uncommittedChanges}+ isExpanded={expandedKey === UNCOMMITTED_KEY}+ onToggle={() =>+ setExpandedKey((prev) =>+ prev === UNCOMMITTED_KEY ? null : UNCOMMITTED_KEY,+ )+ }+ />{commits.map((commit) => (<CommitRowkey={commit.sha}commit={commit}showAuthor={showAuthor}- isExpanded={expandedSha === commit.sha}+ isExpanded={expandedKey === commit.sha}onToggle={() =>- setExpandedSha((prev) => (prev === commit.sha ? null : commit.sha))+ setExpandedKey((prev) => (prev === commit.sha ? null : commit.sha))}/>))}diff --git a/src/components/features/diff-viewer/commit-row.tsx b/src/components/features/diff-viewer/commit-row.tsxindex 829943e9d0..ee4712dbdd 100644--- a/src/components/features/diff-viewer/commit-row.tsx+++ b/src/components/features/diff-viewer/commit-row.tsx@@ -2,11 +2,11 @@ import React from "react";import { useTranslation } from "react-i18next";import { GitCommit } from "#/api/open-hands.types";import { I18nKey } from "#/i18n/declaration";-import { cn } from "#/utils/utils";import { formatTimeDelta } from "#/utils/format-time-delta";-import ChevronUp from "#/icons/chveron-up.svg?react";+import { ChevronDown, ChevronRight } from "lucide-react";import { useCommitChanges } from "#/hooks/query/use-commit-changes";-import { FileDiffViewer } from "./file-diff-viewer";+import { AccordionPanel } from "./accordion-panel";+import { DiffChangeList } from "./diff-change-list";import { LoadingSpinner } from "./loading-spinner";export interface CommitRowProps {@@ -19,8 +19,7 @@ export interface CommitRowProps {/*** One collapsible commit: header row (short SHA, subject, relative time),- * expanding into the files that commit changed, each rendered with the- * regular FileDiffViewer in per-commit mode.+ * expanding into the files that commit changed as a single-open accordion.*/export function CommitRow({commit,@@ -44,9 +43,9 @@ export function CommitRow({onClick={onToggle}aria-expanded={isExpanded}data-testid="commit-row-toggle"- className="w-full flex items-center gap-2 px-3 py-2.5 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer"+ className="w-full flex h-10 items-center gap-2 px-3 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer">- <code className="font-mono text-xs text-[var(--oh-muted)] flex-shrink-0">+ <code className="w-[7ch] flex-shrink-0 text-center font-mono text-xs text-[var(--oh-muted)]">{commit.shortSha}</code><strong className="flex-1 truncate font-medium">@@ -60,35 +59,33 @@ export function CommitRow({<span className="text-xs text-[var(--oh-muted)] flex-shrink-0">{`${formatTimeDelta(commit.timestamp)} ${t(I18nKey.CONVERSATION$AGO)}`}</span>- <ChevronUp- className={cn(- "w-4 h-4 transition-transform flex-shrink-0",- !isExpanded && "transform rotate-180",- )}- />+ {isExpanded ? (+ <ChevronDown+ className="w-4 h-4 shrink-0 text-[var(--oh-muted)]"+ aria-hidden+ />+ ) : (+ <ChevronRight+ className="w-4 h-4 shrink-0 text-[var(--oh-muted)]"+ aria-hidden+ />+ )}</button>- {isExpanded && (- <div- data-testid="commit-row-content"- className="w-full flex flex-col pl-6"- >- {isLoading && (- <div className="p-3">- <LoadingSpinner className="w-4 h-4" />- </div>- )}- {isSuccess &&- changes?.map((change) => (- <FileDiffViewer- key={change.path}- path={change.path}- type={change.status}- commit={commit.sha}- />- ))}- </div>- )}+ <AccordionPanel+ open={isExpanded}+ testId="commit-row-content"+ className="w-full flex flex-col pl-6"+ >+ {isLoading && (+ <div className="p-3">+ <LoadingSpinner className="w-4 h-4" />+ </div>+ )}+ {isSuccess && changes && changes.length > 0 && (+ <DiffChangeList changes={changes} commit={commit.sha} />+ )}+ </AccordionPanel></div>);}diff --git a/src/components/features/diff-viewer/diff-change-list.tsx b/src/components/features/diff-viewer/diff-change-list.tsxnew file mode 100644index 0000000000..d69bc68585--- /dev/null+++ b/src/components/features/diff-viewer/diff-change-list.tsx@@ -0,0 +1,44 @@+import { useState } from "react";+import type { GitChangeStatus } from "#/api/open-hands.types";+import { FileDiffViewer } from "./file-diff-viewer";++export interface DiffChangeListItem {+ path: string;+ status: GitChangeStatus;+}++export interface DiffChangeListProps {+ changes: DiffChangeListItem[];+ /**+ * When set, each row shows that commit's version of the file instead of+ * the working-tree diff.+ */+ commit?: string;+}++/**+ * Single-open accordion of file diffs. Expanding one path collapses the+ * previously open one (same behavior as the Commits list).+ */+export function DiffChangeList({ changes, commit }: DiffChangeListProps) {+ const [expandedPath, setExpandedPath] = useState<string | null>(null);++ return (+ <div data-testid="diff-change-list" className="w-full flex flex-col">+ {changes.map((change) => (+ <FileDiffViewer+ key={change.path}+ path={change.path}+ type={change.status}+ commit={commit}+ isExpanded={expandedPath === change.path}+ onToggle={() =>+ setExpandedPath((prev) =>+ prev === change.path ? null : change.path,+ )+ }+ />+ ))}+ </div>+ );+}diff --git a/src/components/features/diff-viewer/editor-container.tsx b/src/components/features/diff-viewer/editor-container.tsxindex 955a727a55..7cc7cba28d 100644--- a/src/components/features/diff-viewer/editor-container.tsx+++ b/src/components/features/diff-viewer/editor-container.tsx@@ -1,15 +1,24 @@import React from "react";+import { cn } from "#/utils/utils";interface EditorContainerProps {height: number;children: React.ReactNode;+ className?: string;}-export function EditorContainer({ height, children }: EditorContainerProps) {+export function EditorContainer({+ height,+ children,+ className,+}: EditorContainerProps) {return (<divdata-testid="editor-container"- className="w-full border-b border-[var(--oh-border)] overflow-hidden h-[var(--editor-height)]"+ className={cn(+ "w-full border-b border-[var(--oh-border)] overflow-hidden h-[var(--editor-height)]",+ className,+ )}// CSS custom property plumbed through for h-[var(--editor-height)] abovestyle={{ "--editor-height": `${height}px` } as React.CSSProperties}>diff --git a/src/components/features/diff-viewer/file-diff-viewer.tsx b/src/components/features/diff-viewer/file-diff-viewer.tsxindex c5b3fe1b57..4552f25f33 100644--- a/src/components/features/diff-viewer/file-diff-viewer.tsx+++ b/src/components/features/diff-viewer/file-diff-viewer.tsx@@ -15,12 +15,13 @@ import { GitChangeStatus } from "#/api/open-hands.types";import { I18nKey } from "#/i18n/declaration";import { getLanguageFromPath } from "#/utils/get-language-from-path";import { cn } from "#/utils/utils";-import ChevronUp from "#/icons/chveron-up.svg?react";+import { ChevronDown, ChevronRight } from "lucide-react";import { useUnifiedGitDiff } from "#/hooks/query/use-unified-git-diff";import { MarkdownRenderer } from "#/components/features/markdown/markdown-renderer";import { Typography } from "#/ui/typography";import { LoadingSpinner } from "./loading-spinner";import { EditorContainer } from "./editor-container";+import { AccordionPanel } from "./accordion-panel";type ViewMode = "diff" | "old" | "new";@@ -39,6 +40,13 @@ const SHARED_EDITOR_OPTIONS: editor_t.IEditorOptions = {scrollbar: { alwaysConsumeMouseWheel: false },};+/** Cap opened diff/editor panes so a large file doesn't dominate the drawer. */+export const MAX_DIFF_EDITOR_HEIGHT_PX = 600;++function clampDiffEditorHeight(height: number): number {+ return Math.min(height, MAX_DIFF_EDITOR_HEIGHT_PX);+}+const STATUS_MAP: Record<GitChangeStatus, string | IconType> = {A: LuFilePlus,D: LuFileMinus,@@ -78,12 +86,37 @@ export interface FileDiffViewerProps {* commit mode (both sides come from git objects).*/commit?: string;+ /**+ * Controlled accordion open state. When omitted, the row manages its own+ * expand/collapse (used by unit tests and standalone embeds).+ */+ isExpanded?: boolean;+ /** Required with `isExpanded` for controlled accordion lists. */+ onToggle?: () => void;}-export function FileDiffViewer({ path, type, commit }: FileDiffViewerProps) {+export function FileDiffViewer({+ path,+ type,+ commit,+ isExpanded: controlledExpanded,+ onToggle,+}: FileDiffViewerProps) {const { t } = useTranslation("openhands");- const [isCollapsed, setIsCollapsed] = React.useState(true);- const [editorHeight, setEditorHeight] = React.useState(400);+ const [uncontrolledExpanded, setUncontrolledExpanded] = React.useState(false);+ const isControlled = controlledExpanded !== undefined;+ const isExpanded = isControlled ? controlledExpanded : uncontrolledExpanded;+ const isCollapsed = !isExpanded;+ const handleToggle = () => {+ if (isControlled) {+ onToggle?.();+ return;+ }+ setUncontrolledExpanded((prev) => !prev);+ };+ const [editorHeight, setEditorHeight] = React.useState(0);+ const [hasMeasuredEditorHeight, setHasMeasuredEditorHeight] =+ React.useState(false);const [viewMode, setViewMode] = React.useState<ViewMode>("diff");const diffEditorRef = React.useRef<editor_t.IStandaloneDiffEditor>(null);const singleEditorRef = React.useRef<editor_t.IStandaloneCodeEditor>(null);@@ -117,20 +150,33 @@ export function FileDiffViewer({ path, type, commit }: FileDiffViewerProps) {const modifiedEditor = diffEditorRef.current.getModifiedEditor();if (originalEditor && modifiedEditor) {setEditorHeight(- Math.max(- originalEditor.getContentHeight(),- modifiedEditor.getContentHeight(),- ) + 20,+ clampDiffEditorHeight(+ Math.max(+ originalEditor.getContentHeight(),+ modifiedEditor.getContentHeight(),+ ) + 20,+ ),);+ setHasMeasuredEditorHeight(true);}}, []);const updateSingleEditorHeight = React.useCallback(() => {if (singleEditorRef.current) {- setEditorHeight(singleEditorRef.current.getContentHeight() + 20);+ setEditorHeight(+ clampDiffEditorHeight(singleEditorRef.current.getContentHeight() + 20),+ );+ setHasMeasuredEditorHeight(true);}}, []);+ // Reset measured height when collapsing or switching view modes so the+ // next paint doesn't flash a stale editor size before Monaco remeasures.+ React.useEffect(() => {+ setHasMeasuredEditorHeight(false);+ setEditorHeight(0);+ }, [isCollapsed, viewMode]);+const handleDiffEditorMount = (editor: editor_t.IStandaloneDiffEditor) => {diffEditorRef.current = editor;updateEditorHeight();@@ -149,7 +195,7 @@ export function FileDiffViewer({ path, type, commit }: FileDiffViewerProps) {typeof status === "string" ? (<Typography.Text>{status}</Typography.Text>) : (- React.createElement(status, { className: "w-5 h-5" })+ React.createElement(status, { className: "w-4 h-4 shrink-0" }));const isFetchingData = isLoading || isRefetching;@@ -158,26 +204,49 @@ export function FileDiffViewer({ path, type, commit }: FileDiffViewerProps) {const singleViewContent =viewMode === "old" ? (diff?.original ?? "") : (diff?.modified ?? "");+ const showViewModeToggle = !isDeleted;+ const viewModeControlsVisible = !isCollapsed && showViewModeToggle;++ const renderEditorShell = (editor: React.ReactNode) => (+ <div+ className={cn(+ "relative w-full",+ // Collapse layout space until Monaco reports a real content height so+ // expand doesn't flash a placeholder editor size.+ !hasMeasuredEditorHeight && "h-0 overflow-hidden",+ )}+ >+ <EditorContainer+ height={+ hasMeasuredEditorHeight ? editorHeight : clampDiffEditorHeight(400)+ }+ className={cn(+ !hasMeasuredEditorHeight && "absolute inset-x-0 top-0 invisible",+ )}+ >+ {editor}+ </EditorContainer>+ </div>+ );+const renderContent = () => {if (viewMode === "diff") {- return (- <EditorContainer height={editorHeight}>- <DiffEditor- data-testid="file-diff-viewer"- className="w-full h-full"- language={language}- original={isAdded ? "" : (diff?.original ?? "")}- modified={isDeleted ? "" : (diff?.modified ?? "")}- theme="custom-diff-theme"- onMount={handleDiffEditorMount}- beforeMount={beforeMount}- options={{- ...SHARED_EDITOR_OPTIONS,- renderSideBySide: !isAdded && !isDeleted,- hideUnchangedRegions: { enabled: true },- }}- />- </EditorContainer>+ return renderEditorShell(+ <DiffEditor+ data-testid="file-diff-viewer"+ className="w-full h-full"+ language={language}+ original={isAdded ? "" : (diff?.original ?? "")}+ modified={isDeleted ? "" : (diff?.modified ?? "")}+ theme="custom-diff-theme"+ onMount={handleDiffEditorMount}+ beforeMount={beforeMount}+ options={{+ ...SHARED_EDITOR_OPTIONS,+ renderSideBySide: !isAdded && !isDeleted,+ hideUnchangedRegions: { enabled: true },+ }}+ />,);}@@ -186,6 +255,7 @@ export function FileDiffViewer({ path, type, commit }: FileDiffViewerProps) {<divclassName="w-full border-b border-[var(--oh-border)] overflow-auto p-4 bg-base prose prose-invert max-w-none"data-testid="markdown-preview"+ style={{ maxHeight: MAX_DIFF_EDITOR_HEIGHT_PX }}><MarkdownRenderercontent={singleViewContent}@@ -196,41 +266,52 @@ export function FileDiffViewer({ path, type, commit }: FileDiffViewerProps) {);}- return (- <EditorContainer height={editorHeight}>- <Editor- data-testid="file-single-viewer"- className="w-full h-full"- language={language}- value={singleViewContent}- theme="custom-diff-theme"- beforeMount={beforeMount}- onMount={handleSingleEditorMount}- options={SHARED_EDITOR_OPTIONS}- />- </EditorContainer>+ return renderEditorShell(+ <Editor+ data-testid="file-single-viewer"+ className="w-full h-full"+ language={language}+ value={singleViewContent}+ theme="custom-diff-theme"+ beforeMount={beforeMount}+ onMount={handleSingleEditorMount}+ options={SHARED_EDITOR_OPTIONS}+ />,);};return (<div data-testid="file-diff-viewer-outer" className="w-full flex flex-col"><div- className="flex justify-between items-center px-3 py-2.5 border-b border-[var(--oh-border)] hover:cursor-pointer"- onClick={() => setIsCollapsed((prev) => !prev)}+ className="flex h-10 items-center px-3 border-b border-[var(--oh-border)] hover:cursor-pointer"+ onClick={handleToggle}>- <span className="text-sm w-full text-content flex items-center gap-2">- {isFetchingData ? <LoadingSpinner className="w-4 h-4" /> : statusIcon}- <strong className="w-full truncate font-medium">{filePath}</strong>- {!isCollapsed && !isDeleted && (+ <span className="text-sm w-full text-content flex items-center gap-2 min-w-0">+ <span className="inline-flex w-4 h-4 shrink-0 items-center justify-center">+ {isFetchingData ? (+ <LoadingSpinner className="w-4 h-4" />+ ) : (+ statusIcon+ )}+ </span>+ <strong className="min-w-0 flex-1 truncate font-medium">+ {filePath}+ </strong>+ {showViewModeToggle && (<span- className="flex items-center gap-0.5 shrink-0"+ className={cn(+ "flex items-center gap-0.5 shrink-0",+ !viewModeControlsVisible && "invisible pointer-events-none",+ )}onClick={(e) => e.stopPropagation()}+ aria-hidden={!viewModeControlsVisible}>{VIEW_MODES.map(({ mode, icon: Icon }) => (<buttonkey={mode}data-testid={`view-mode-${mode}`}type="button"+ tabIndex={viewModeControlsVisible ? 0 : -1}aria-pressed={viewMode === mode}onClick={() => setViewMode(mode)}className={cn(@@ -245,27 +326,32 @@ export function FileDiffViewer({ path, type, commit }: FileDiffViewerProps) {))}</span>)}- <button data-testid="collapse" type="button">- <ChevronUp- className={cn(- "w-4 h-4 transition-transform",- isCollapsed && "transform rotate-180",- )}- />+ <button+ data-testid="collapse"+ type="button"+ className="shrink-0 text-[var(--oh-muted)]"+ >+ {isCollapsed ? (+ <ChevronRight className="w-4 h-4" aria-hidden />+ ) : (+ <ChevronDown className="w-4 h-4" aria-hidden />+ )}</button></span></div>- {!isCollapsed && isDeleted && !commit && (- <div- data-testid="file-deleted-message"- className="w-full border-b border-[var(--oh-border)] p-4 bg-base text-[var(--oh-text-dim)] text-sm"- >- {t(I18nKey.DIFF_VIEWER$FILE_DELETED)}- </div>- )}-- {!isCollapsed && (!isDeleted || !!commit) && isSuccess && renderContent()}+ <AccordionPanel open={isExpanded}>+ {isDeleted && !commit ? (+ <div+ data-testid="file-deleted-message"+ className="w-full border-b border-[var(--oh-border)] p-4 bg-base text-[var(--oh-text-dim)] text-sm"+ >+ {t(I18nKey.DIFF_VIEWER$FILE_DELETED)}+ </div>+ ) : (+ isSuccess && renderContent()+ )}+ </AccordionPanel></div>);}diff --git a/src/components/features/diff-viewer/uncommitted-changes-row.tsx b/src/components/features/diff-viewer/uncommitted-changes-row.tsxnew file mode 100644index 0000000000..adadc37a9c--- /dev/null+++ b/src/components/features/diff-viewer/uncommitted-changes-row.tsx@@ -0,0 +1,74 @@+import { useTranslation } from "react-i18next";+import { ChevronDown, ChevronRight } from "lucide-react";+import { I18nKey } from "#/i18n/declaration";+import { AccordionPanel } from "./accordion-panel";+import { DiffChangeList, type DiffChangeListItem } from "./diff-change-list";++const EMPTY_COMMIT_SHA_PLACEHOLDER = "-";+/** Base key for i18next pluralization (`_one` / `_other` suffixes). */+const UNCOMMITTED_FILE_COUNT_I18N_KEY = "DIFF_VIEWER$UNCOMMITTED_FILE_COUNT";++export interface UncommittedChangesRowProps {+ changes: DiffChangeListItem[];+ isExpanded: boolean;+ onToggle: () => void;+}++/**+ * Top accordion row in the Commits pane for working-tree changes that+ * are not yet associated with a commit. Same single-open accordion+ * contract as CommitRow.+ */+export function UncommittedChangesRow({+ changes,+ isExpanded,+ onToggle,+}: UncommittedChangesRowProps) {+ const { t } = useTranslation("openhands");++ return (+ <div data-testid="uncommitted-changes-row" className="w-full flex flex-col">+ <button+ type="button"+ onClick={onToggle}+ aria-expanded={isExpanded}+ data-testid="uncommitted-changes-row-toggle"+ className="w-full flex h-10 items-center gap-2 px-3 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer"+ >+ <code className="w-[7ch] flex-shrink-0 text-center font-mono text-xs text-[var(--oh-muted)]">+ {EMPTY_COMMIT_SHA_PLACEHOLDER}+ </code>+ <strong className="flex-1 truncate font-medium">+ {t(I18nKey.DIFF_VIEWER$UNCOMMITTED)}+ </strong>+ {changes.length > 0 ? (+ <span+ data-testid="uncommitted-changes-count"+ className="text-xs text-[var(--oh-muted)] tabular-nums flex-shrink-0"+ >+ {t(UNCOMMITTED_FILE_COUNT_I18N_KEY, { count: changes.length })}+ </span>+ ) : null}+ {isExpanded ? (+ <ChevronDown+ className="w-4 h-4 shrink-0 text-[var(--oh-muted)]"+ aria-hidden+ />+ ) : (+ <ChevronRight+ className="w-4 h-4 shrink-0 text-[var(--oh-muted)]"+ aria-hidden+ />+ )}+ </button>++ <AccordionPanel+ open={isExpanded}+ testId="uncommitted-changes-row-content"+ className="w-full flex flex-col pl-6"+ >+ {changes.length > 0 ? <DiffChangeList changes={changes} /> : null}+ </AccordionPanel>+ </div>+ );+}diff --git a/src/components/features/files-tab/file-quick-row.tsx b/src/components/features/files-tab/file-quick-row.tsxindex 0f17b57bd5..af2447f4c9 100644--- a/src/components/features/files-tab/file-quick-row.tsx+++ b/src/components/features/files-tab/file-quick-row.tsx@@ -1,41 +1,45 @@import { ListTree } from "lucide-react";-import { useMemo } from "react";+import type { ReactNode } from "react";import { useTranslation } from "react-i18next";+import CloseIcon from "#/icons/u-close.svg?react";import { I18nKey } from "#/i18n/declaration";-import { sortFilesByPriority } from "#/utils/file-priority";import { cn } from "#/utils/utils";interface FileQuickRowProps {- paths: string[];+ /** Open file tabs only (paths the user or agent has opened). */+ openPaths: string[];selectedPath: string | null;onSelectFile: (path: string) => void;+ onCloseFile: (path: string) => void;/** Whether the left-hand file tree is currently visible. */isTreeVisible: boolean;/** Toggle the visibility of the left-hand file tree. */onToggleTree: () => void;+ /** Trailing actions (e.g. refresh), pinned to the right. */+ actions?: ReactNode;}+const HIDDEN_SCROLLBAR_CLASSNAME =+ "[scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden";+/**- * Horizontal "quick access" row of files at the top of the file viewer.- * Important entrypoints (index.html, README.md, package.json, …) appear- * first. A file-tree toggle on the leading edge shows or hides the full- * tree on the left — there is no overflow dropdown, so anything that doesn't fit- * here is reachable by opening the tree.+ * Horizontal strip of open-file tabs. A path only appears after the user or+ * agent opens it. Overflow scrolls horizontally without a visible scrollbar.*/export function FileQuickRow({- paths,+ openPaths,selectedPath,onSelectFile,+ onCloseFile,isTreeVisible,onToggleTree,+ actions,}: FileQuickRowProps) {const { t } = useTranslation("openhands");- const sortedByPriority = useMemo(() => sortFilesByPriority(paths), [paths]);-return (<div- className="flex items-center gap-1.5 border-b border-[var(--oh-border)] px-2 py-1.5 min-h-[34px]"+ className="flex h-[34px] shrink-0 items-stretch gap-1.5 overflow-y-hidden border-b border-[var(--oh-border)] px-2"data-testid="file-quick-row"><button@@ -54,7 +58,7 @@ export function FileQuickRow({: I18nKey.FILES$SHOW_FILE_TREE,)}className={cn(- "shrink-0 inline-flex items-center justify-center w-6 h-6 rounded-md cursor-pointer",+ "shrink-0 self-center inline-flex items-center justify-center w-6 h-6 rounded-md cursor-pointer","text-[var(--oh-text-tertiary)] hover:bg-tertiary",isTreeVisible && "bg-[var(--oh-surface-raised)]",)}@@ -62,30 +66,73 @@ export function FileQuickRow({<ListTree className="w-3 h-3" aria-hidden strokeWidth={2} /></button>- {sortedByPriority.length > 0 && (- <div className="flex flex-nowrap items-center gap-1.5 overflow-hidden flex-1 min-w-0">- {sortedByPriority.map((path) => {+ {openPaths.length > 0 ? (+ <div+ role="tablist"+ aria-label={t(I18nKey.COMMON$FILES)}+ className={cn(+ "flex min-h-0 min-w-0 flex-1 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden overscroll-y-none",+ HIDDEN_SCROLLBAR_CLASSNAME,+ )}+ >+ {openPaths.map((path, index) => {const isSelected = selectedPath === path;+ const fileName = path.split("/").pop() || path;return (- <button+ <divkey={path}- type="button"- onClick={() => onSelectFile(path)}- title={path}- data-testid={`file-quick-row-item-${path}`}className={cn(- "inline-flex items-center px-2 py-0.5 text-xs whitespace-nowrap rounded-md cursor-pointer",+ "group/file-tab relative flex shrink-0 items-stretch",+ // Vertical edges on every tab (left on the first, right on all).+ "border-r border-r-[var(--oh-border)]",+ index === 0 && "border-l border-l-[var(--oh-border)]",+ "border-b-2 -mb-px transition-colors",isSelected- ? "bg-[var(--oh-interactive-hover)] text-white"- : "bg-[var(--oh-surface-raised)] text-[var(--oh-text-tertiary)] hover:bg-tertiary",+ ? "border-b-white text-white"+ : "border-b-transparent text-[var(--oh-muted)] hover:text-white hover:border-b-white/25",)}>- {path}- </button>+ <button+ type="button"+ role="tab"+ aria-selected={isSelected}+ onClick={() => onSelectFile(path)}+ title={path}+ data-testid={`file-quick-row-item-${path}`}+ className="flex min-w-0 max-w-[160px] items-center pl-2.5 pr-1 text-xs cursor-pointer text-inherit"+ >+ <span className="truncate">{fileName}</span>+ </button>+ <button+ type="button"+ data-testid={`file-quick-row-close-${path}`}+ aria-label={t(I18nKey.FILES$CLOSE_TAB, { path })}+ title={t(I18nKey.FILES$CLOSE_TAB, { path })}+ className={cn(+ "inline-flex items-center justify-center size-5 self-center mr-1 rounded-sm shrink-0 cursor-pointer",+ "text-inherit hover:bg-white/10",+ // Always visible on small / touch-first viewports; hover to+ // reveal on fine pointers (desktop).+ "opacity-100 transition-opacity",+ "md:opacity-0 md:group-hover/file-tab:opacity-100 md:group-focus-within/file-tab:opacity-100",+ )}+ onClick={() => onCloseFile(path)}+ >+ <CloseIcon width={10} height={10} aria-hidden />+ </button>+ </div>);})}</div>+ ) : (+ <div className="flex-1 min-w-0" />)}++ {actions ? (+ <div className="ml-auto shrink-0 self-center flex items-center gap-1">+ {actions}+ </div>+ ) : null}</div>);}diff --git a/src/components/features/files-tab/files-tab-tree.constants.ts b/src/components/features/files-tab/files-tab-tree.constants.tsnew file mode 100644index 0000000000..e544a78f3f--- /dev/null+++ b/src/components/features/files-tab/files-tab-tree.constants.ts@@ -0,0 +1,10 @@+/** Persisted pixel width of the Files tab tree sidebar. */+export const FILES_TAB_TREE_WIDTH_STORAGE_KEY = "files-tab-tree-width";++/** Matches the previous fixed `w-56` (14rem) tree width. */+export const FILES_TAB_TREE_DEFAULT_WIDTH_PX = 224;+export const FILES_TAB_TREE_MIN_WIDTH_PX = 160;+export const FILES_TAB_TREE_MAX_WIDTH_PX = 480;++export const FILES_TAB_TREE_RESIZE_HANDLE_TEST_ID =+ "files-tab-tree-resize-handle";diff --git a/src/components/features/files-tab/segmented-toggle.tsx b/src/components/features/files-tab/segmented-toggle.tsxindex 5b871447f7..5bcced6a86 100644--- a/src/components/features/files-tab/segmented-toggle.tsx+++ b/src/components/features/files-tab/segmented-toggle.tsx@@ -13,12 +13,14 @@ interface SegmentedToggleProps<T extends string> {onChange: (value: T) => void;ariaLabel: string;testId?: string;+ className?: string;+ /** Stretch the control and give each option an equal share of the width. */+ equalWidth?: boolean;}/*** Lightweight 2-state segmented control used for the files-tab toggles- * ("Diff view" on/off, "Rich"/"Plain"). Kept local because the existing- * shared switch components are heavier than what we need here.+ * ("Rich"/"Plain") and a few other compact two-way choices.*/export function SegmentedToggle<T extends string>({value,@@ -26,13 +28,19 @@ export function SegmentedToggle<T extends string>({onChange,ariaLabel,testId,+ className,+ equalWidth = false,}: SegmentedToggleProps<T>) {return (<divrole="radiogroup"aria-label={ariaLabel}data-testid={testId}- className="inline-flex items-center rounded-md bg-[var(--oh-surface-raised)] p-0.5 text-xs"+ className={cn(+ equalWidth ? "flex w-full" : "inline-flex",+ "items-center rounded-md bg-[var(--oh-surface-raised)] p-0.5 text-xs",+ className,+ )}>{options.map((option) => {const isActive = option.value === value;@@ -47,17 +55,14 @@ export function SegmentedToggle<T extends string>({}onClick={() => onChange(option.value)}className={cn(- "inline-flex items-center gap-1.5 px-2.5 py-1 rounded cursor-pointer transition-colors",+ "inline-flex items-center gap-1.5 px-2 py-0.5 rounded cursor-pointer transition-colors",+ equalWidth && "flex-1 justify-center text-center",isActive? "bg-[var(--oh-interactive-hover)] text-white": "text-[var(--oh-muted)] hover:text-white",)}>- {option.icon ? (- <span className="inline-flex size-3.5 shrink-0 items-center justify-center [&_svg]:size-3.5">- {option.icon}- </span>- ) : null}+ {option.icon}{option.label}</button>);diff --git a/src/components/features/files-tab/tree-node.tsx b/src/components/features/files-tab/tree-node.tsxindex 2fa8e84e92..881c77778d 100644--- a/src/components/features/files-tab/tree-node.tsx+++ b/src/components/features/files-tab/tree-node.tsx@@ -1,4 +1,5 @@import { useState } from "react";+import { ChevronDown, ChevronRight } from "lucide-react";import FileIcon from "#/icons/file.svg?react";import FolderIcon from "#/icons/folder.svg?react";@@ -38,12 +39,13 @@ export function TreeNode({><spanaria-hidden- className={cn(- "inline-block w-3 text-[10px] text-[var(--oh-muted)] transition-transform",- isOpen ? "rotate-90" : "rotate-0",- )}+ className="inline-flex w-3.5 shrink-0 items-center justify-center text-[var(--oh-muted)]">- ▶+ {isOpen ? (+ <ChevronDown className="w-3.5 h-3.5" />+ ) : (+ <ChevronRight className="w-3.5 h-3.5" />+ )}</span><FolderIcon className="w-3.5 h-3.5 shrink-0" /><span className="truncate">{node.name}</span>diff --git a/src/components/ui/resize-handle.tsx b/src/components/ui/resize-handle.tsxindex 29674a985a..3265b518c5 100644--- a/src/components/ui/resize-handle.tsx+++ b/src/components/ui/resize-handle.tsx@@ -6,18 +6,21 @@ interface ResizeHandleProps {className?: string;/** While the parent panel drag is active, keep the grip line highlighted. */isDragging?: boolean;+ testId?: string;}export function ResizeHandle({onMouseDown,className,isDragging = false,+ testId,}: ResizeHandleProps) {const [isHovering, setIsHovering] = useState(false);const lineActive = isDragging || isHovering;return (<div+ data-testid={testId}className={cn("relative z-10 w-0 shrink-0 self-stretch", className)}aria-hidden>diff --git a/src/hooks/query/use-repository-git-items.ts b/src/hooks/query/use-repository-git-items.tsnew file mode 100644index 0000000000..288a36be9b--- /dev/null+++ b/src/hooks/query/use-repository-git-items.ts@@ -0,0 +1,30 @@+import { useQuery } from "@tanstack/react-query";+import { GitProviderItemsService } from "#/api/git-provider-items-service";+import type { Provider } from "#/types/settings";++export function useRepositoryPullRequests(+ repository: string | null | undefined,+ provider: Provider | null | undefined,+) {+ return useQuery({+ queryKey: ["repository-pull-requests", provider, repository],+ queryFn: () =>+ GitProviderItemsService.listPullRequests(repository!, provider!),+ enabled: Boolean(repository && provider),+ staleTime: 60_000,+ meta: { disableToast: true },+ });+}++export function useRepositoryIssues(+ repository: string | null | undefined,+ provider: Provider | null | undefined,+) {+ return useQuery({+ queryKey: ["repository-issues", provider, repository],+ queryFn: () => GitProviderItemsService.listIssues(repository!, provider!),+ enabled: Boolean(repository && provider),+ staleTime: 60_000,+ meta: { disableToast: true },+ });+}diff --git a/src/hooks/use-conversation-overview-add-intent.ts b/src/hooks/use-conversation-overview-add-intent.tsnew file mode 100644index 0000000000..11bd8d48a6--- /dev/null+++ b/src/hooks/use-conversation-overview-add-intent.ts@@ -0,0 +1,28 @@+import { useEffect, useRef } from "react";+import { useSearchParams } from "react-router";+import {+ CONVERSATION_OVERVIEW_ADD_QUERY_PARAM,+ hasConversationOverviewAddIntent,+} from "#/components/features/conversation/conversation-overview-panel.constants";++export function useConversationOverviewAddIntent(onOpen: () => void): void {+ const [searchParams, setSearchParams] = useSearchParams();+ const onOpenRef = useRef(onOpen);++ useEffect(() => {+ onOpenRef.current = onOpen;+ }, [onOpen]);++ useEffect(() => {+ const search = searchParams.toString();+ if (!hasConversationOverviewAddIntent(search)) {+ return;+ }++ onOpenRef.current();++ const nextParams = new URLSearchParams(searchParams);+ nextParams.delete(CONVERSATION_OVERVIEW_ADD_QUERY_PARAM);+ setSearchParams(nextParams, { replace: true });+ }, [searchParams, setSearchParams]);+}diff --git a/src/hooks/use-conversation-overview-column-space.ts b/src/hooks/use-conversation-overview-column-space.tsnew file mode 100644index 0000000000..ee83e1f348--- /dev/null+++ b/src/hooks/use-conversation-overview-column-space.ts@@ -0,0 +1,40 @@+import { useEffect, useLayoutEffect, useState, type RefObject } from "react";+import { hasEnoughOverviewLayoutSpace } from "#/components/features/conversation/conversation-overview-panel.constants";++const useIsomorphicLayoutEffect =+ typeof window !== "undefined" ? useLayoutEffect : useEffect;++export function useConversationOverviewColumnSpace(+ containerRef: RefObject<HTMLElement | null>,+ enabled: boolean,+): boolean {+ const [hasSpace, setHasSpace] = useState(false);++ useIsomorphicLayoutEffect(() => {+ if (!enabled) {+ setHasSpace(false);+ return undefined;+ }++ const container = containerRef.current;+ if (!container) {+ return undefined;+ }++ const update = () => {+ setHasSpace(hasEnoughOverviewLayoutSpace(container.clientWidth));+ };++ update();++ if (typeof ResizeObserver === "undefined") {+ return undefined;+ }++ const observer = new ResizeObserver(update);+ observer.observe(container);+ return () => observer.disconnect();+ }, [containerRef, enabled]);++ return hasSpace;+}diff --git a/src/hooks/use-conversation-overview-git-diff-stats.ts b/src/hooks/use-conversation-overview-git-diff-stats.tsnew file mode 100644index 0000000000..eece09f72c--- /dev/null+++ b/src/hooks/use-conversation-overview-git-diff-stats.ts@@ -0,0 +1,81 @@+import { useMemo } from "react";+import { useQueries } from "@tanstack/react-query";+import AgentServerGitService from "#/api/git-service/agent-server-git-service.api";+import { useActiveConversation } from "#/hooks/query/use-active-conversation";+import { useUnifiedGetGitChanges } from "#/hooks/query/use-unified-get-git-changes";+import { useConversationId } from "#/hooks/use-conversation-id";+import { useRuntimeIsReady } from "#/hooks/use-runtime-is-ready";+import { getGitPath } from "#/utils/get-git-path";+import {+ countGitChangeDiffStats,+ sumGitDiffLineStats,+} from "#/utils/git-diff-stats";++export function useConversationOverviewGitDiffStats() {+ const { conversationId } = useConversationId();+ const { data: conversation } = useActiveConversation();+ const runtimeIsReady = useRuntimeIsReady();+ const {+ data: gitChanges,+ isLoading: isLoadingChanges,+ isSuccess: isChangesSuccess,+ isError: isChangesError,+ } = useUnifiedGetGitChanges();++ const conversationUrl = conversation?.conversation_url;+ const sessionApiKey = conversation?.session_api_key;+ const gitPath = useMemo(+ () =>+ getGitPath(+ conversation?.selected_repository,+ conversation?.workspace?.working_dir?.trim(),+ ),+ [conversation?.selected_repository, conversation?.workspace?.working_dir],+ );++ const diffCandidates = useMemo(+ () => (gitChanges ?? []).filter((change) => change.status !== "D"),+ [gitChanges],+ );++ const diffQueries = useQueries({+ queries: diffCandidates.map((change) => ({+ queryKey: [+ "conversation_overview_file_diff",+ conversationId,+ conversationUrl,+ sessionApiKey,+ gitPath,+ change.path,+ ],+ queryFn: async () =>+ AgentServerGitService.getGitChangeDiff(+ conversationId!,+ conversationUrl,+ sessionApiKey,+ `${gitPath}/${change.path}`,+ ),+ enabled:+ runtimeIsReady && !!conversationId && isChangesSuccess && !!change.path,+ staleTime: 1000 * 60 * 5,+ meta: {+ disableToast: true,+ },+ })),+ });++ const isLoadingDiffs = diffQueries.some((query) => query.isLoading);+ const totals = sumGitDiffLineStats(+ diffQueries.flatMap((query) =>+ query.data ? [countGitChangeDiffStats(query.data)] : [],+ ),+ );++ return {+ additions: totals.additions,+ deletions: totals.deletions,+ changeCount: gitChanges?.length ?? 0,+ isLoading: isLoadingChanges || isLoadingDiffs,+ isError: isChangesError,+ };+}diff --git a/src/hooks/use-conversation-overview-panel-peek.ts b/src/hooks/use-conversation-overview-panel-peek.tsnew file mode 100644index 0000000000..d9614632f8--- /dev/null+++ b/src/hooks/use-conversation-overview-panel-peek.ts@@ -0,0 +1,60 @@+import { useEffect } from "react";+import { useConversationStore } from "#/stores/conversation-store";++/** Grace period so the pointer can move from the toggle onto the peek panel. */+export const CONVERSATION_OVERVIEW_PEEK_CLOSE_DELAY_MS = 150;++let peekCloseTimer: ReturnType<typeof setTimeout> | null = null;++function clearPeekCloseTimer() {+ if (peekCloseTimer !== null) {+ clearTimeout(peekCloseTimer);+ peekCloseTimer = null;+ }+}++export function openConversationOverviewPanelPeek() {+ const { isRightPanelShown, isOverviewPanelShown, setIsOverviewPanelPeeked } =+ useConversationStore.getState();++ if (!isRightPanelShown || isOverviewPanelShown) {+ return;+ }++ clearPeekCloseTimer();+ setIsOverviewPanelPeeked(true);+}++export function scheduleCloseConversationOverviewPanelPeek() {+ clearPeekCloseTimer();+ peekCloseTimer = setTimeout(() => {+ peekCloseTimer = null;+ useConversationStore.getState().setIsOverviewPanelPeeked(false);+ }, CONVERSATION_OVERVIEW_PEEK_CLOSE_DELAY_MS);+}++export function closeConversationOverviewPanelPeek() {+ clearPeekCloseTimer();+ useConversationStore.getState().setIsOverviewPanelPeeked(false);+}++/**+ * Clears a stale peek when the files drawer closes or overview is pinned open.+ */+export function useSyncConversationOverviewPanelPeek() {+ const isRightPanelShown = useConversationStore(+ (state) => state.isRightPanelShown,+ );+ const isOverviewPanelShown = useConversationStore(+ (state) => state.isOverviewPanelShown,+ );+ const isOverviewPanelPeeked = useConversationStore(+ (state) => state.isOverviewPanelPeeked,+ );++ useEffect(() => {+ if (isOverviewPanelPeeked && (!isRightPanelShown || isOverviewPanelShown)) {+ closeConversationOverviewPanelPeek();+ }+ }, [isOverviewPanelPeeked, isOverviewPanelShown, isRightPanelShown]);+}diff --git a/src/hooks/use-conversation-overview-stats.ts b/src/hooks/use-conversation-overview-stats.tsnew file mode 100644index 0000000000..056f0a2c0f--- /dev/null+++ b/src/hooks/use-conversation-overview-stats.ts@@ -0,0 +1,28 @@+import { getStoredConversationMetadata } from "#/api/conversation-metadata-store";+import { useActiveConversation } from "#/hooks/query/use-active-conversation";+import { useConversationId } from "#/hooks/use-conversation-id";++function workspaceBasename(path: string | null | undefined): string | null {+ if (!path) {+ return null;+ }+ return path.replace(/\/+$/, "").split("/").pop() || path;+}++/** Workspace label for the overview panel (git stats come from other hooks). */+export function useConversationOverviewStats() {+ const { conversationId } = useConversationId();+ const { data: conversation } = useActiveConversation();++ const storedMetadata = conversationId+ ? getStoredConversationMetadata(conversationId)+ : null;+ const workspacePath =+ storedMetadata?.selected_workspace ??+ conversation?.selected_workspace ??+ null;++ return {+ workspaceName: workspaceBasename(workspacePath),+ };+}diff --git a/src/hooks/use-conversation-primary-repository.ts b/src/hooks/use-conversation-primary-repository.tsnew file mode 100644index 0000000000..49509d4ce0--- /dev/null+++ b/src/hooks/use-conversation-primary-repository.ts@@ -0,0 +1,35 @@+import { useActiveConversation } from "#/hooks/query/use-active-conversation";+import { useLocalGitInfo } from "#/hooks/query/use-local-git-info";+import { useTaskPolling } from "#/hooks/query/use-task-polling";+import type { Provider } from "#/types/settings";++/**+ * Resolves the conversation's primary connected git repository using the+ * same priority as the conversation overview git section:+ * conversation metadata → task polling → local workspace probe.+ */+export function useConversationPrimaryRepository() {+ const { data: conversation } = useActiveConversation();+ const { repositoryInfo } = useTaskPolling();+ const { data: localGitInfo } = useLocalGitInfo();++ const conversationRepository =+ conversation?.selected_repository || repositoryInfo?.selectedRepository;+ const conversationProvider = (conversation?.git_provider ||+ repositoryInfo?.gitProvider) as Provider | undefined;+ const conversationBranch =+ conversation?.selected_branch || repositoryInfo?.selectedBranch;++ const repository = conversationRepository || localGitInfo?.repository || null;+ const provider = (conversationProvider ||+ localGitInfo?.provider ||+ null) as Provider | null;+ const branch = conversationBranch || localGitInfo?.branch || null;++ return {+ repository,+ provider,+ branch,+ isConnected: Boolean(repository && provider),+ };+}diff --git a/src/hooks/use-resizable-drawer-width.ts b/src/hooks/use-resizable-drawer-width.tsnew file mode 100644index 0000000000..37bded5d4f--- /dev/null+++ b/src/hooks/use-resizable-drawer-width.ts@@ -0,0 +1,126 @@+import {+ useCallback,+ useLayoutEffect,+ useRef,+ useState,+ type RefObject,+} from "react";+import { useLocalStorage } from "@uidotdev/usehooks";++const PANEL_DRAG_SHIELD_Z_INDEX = 200;++type ResizableDrawerEdge = "left" | "right";++interface UseResizableDrawerWidthOptions {+ containerRef: RefObject<HTMLElement | null>;+ defaultWidth: number;+ minWidth: number;+ maxWidth: number;+ storageKey: string;+ enabled?: boolean;+ /**+ * Which side of the container the panel is anchored to.+ * - `"right"` (default): width grows leftward from the container's right edge+ * - `"left"`: width grows rightward from the container's left edge+ */+ edge?: ResizableDrawerEdge;+}++export function useResizableDrawerWidth({+ containerRef,+ defaultWidth,+ minWidth,+ maxWidth,+ storageKey,+ enabled = true,+ edge = "right",+}: UseResizableDrawerWidthOptions) {+ const [persistedWidth, setPersistedWidth] = useLocalStorage<number>(+ storageKey,+ defaultWidth,+ );++ const clampWidth = useCallback(+ (width: number) => Math.max(minWidth, Math.min(maxWidth, width)),+ [minWidth, maxWidth],+ );++ const [drawerWidth, setDrawerWidth] = useState(() =>+ clampWidth(persistedWidth),+ );+ const [isDragging, setIsDragging] = useState(false);+ const drawerWidthRef = useRef(drawerWidth);++ drawerWidthRef.current = drawerWidth;++ const handleMouseDown = useCallback(+ (event: React.MouseEvent) => {+ if (!enabled) {+ return;+ }+ event.preventDefault();+ setIsDragging(true);+ },+ [enabled],+ );++ const handleMouseMove = useCallback(+ (event: MouseEvent) => {+ if (!isDragging || !containerRef.current) {+ return;+ }++ const containerRect = containerRef.current.getBoundingClientRect();+ const nextWidth =+ edge === "left"+ ? event.clientX - containerRect.left+ : containerRect.right - event.clientX;+ setDrawerWidth(clampWidth(nextWidth));+ },+ [clampWidth, containerRef, edge, isDragging],+ );++ const handleMouseUp = useCallback(() => {+ if (!isDragging) {+ return;+ }+ setIsDragging(false);+ setPersistedWidth(drawerWidthRef.current);+ }, [isDragging, setPersistedWidth]);++ useLayoutEffect(() => {+ if (!isDragging) {+ return undefined;+ }++ const shield = document.createElement("div");+ shield.setAttribute("aria-hidden", "true");+ shield.dataset.panelDragShield = "";+ Object.assign(shield.style, {+ position: "fixed",+ inset: "0",+ zIndex: String(PANEL_DRAG_SHIELD_Z_INDEX),+ cursor: "ew-resize",+ });+ document.body.appendChild(shield);++ document.addEventListener("mousemove", handleMouseMove);+ document.addEventListener("mouseup", handleMouseUp);+ document.body.style.cursor = "ew-resize";+ document.body.style.userSelect = "none";++ return () => {+ document.removeEventListener("mousemove", handleMouseMove);+ document.removeEventListener("mouseup", handleMouseUp);+ document.body.style.cursor = "";+ document.body.style.userSelect = "";+ shield.remove();+ };+ }, [handleMouseMove, handleMouseUp, isDragging]);++ return {+ drawerWidth,+ isDragging,+ handleMouseDown,+ };+}diff --git a/src/hooks/use-select-conversation-tab.ts b/src/hooks/use-select-conversation-tab.tsindex aee6d0b94d..161ca66c7f 100644--- a/src/hooks/use-select-conversation-tab.ts+++ b/src/hooks/use-select-conversation-tab.ts@@ -19,12 +19,21 @@ export function useSelectConversationTab() {selectedTab,isRightPanelShown,setHasRightPanelToggled,+ setIsOverviewPanelShown,+ setIsRightPanelShown,setSelectedTab,+ setCommitsAutoExpandSection,} = useConversationStore();- const { setSelectedTab: setPersistedSelectedTab } =+ const { setSelectedTab: setPersistedSelectedTab, setRightPanelShown } =useConversationLocalStorageState(conversationId ?? "");+ const setPanelOpen = (open: boolean) => {+ setHasRightPanelToggled(open);+ setIsRightPanelShown(open);+ setRightPanelShown?.(open);+ };+const onTabChange = (value: ConversationTab | null) => {setSelectedTab(value);setPersistedSelectedTab(value);@@ -37,12 +46,13 @@ export function useSelectConversationTab() {*/const selectTab = (tab: ConversationTab) => {if (selectedTab === tab && isRightPanelShown) {- setHasRightPanelToggled(false);+ setPanelOpen(false);} else {onTabChange(tab);if (!isRightPanelShown) {- setHasRightPanelToggled(true);+ setPanelOpen(true);}+ setIsOverviewPanelShown(false);}};@@ -53,9 +63,18 @@ export function useSelectConversationTab() {*/const navigateToTab = (tab: ConversationTab) => {onTabChange(tab);- if (!isRightPanelShown) {- setHasRightPanelToggled(true);- }+ setPanelOpen(true);+ setIsOverviewPanelShown(false);+ };++ const navigateToChanges = () => {+ setCommitsAutoExpandSection("uncommitted");+ navigateToTab("commits");+ };++ const navigateToCommits = () => {+ setCommitsAutoExpandSection(null);+ navigateToTab("commits");};/**@@ -67,6 +86,8 @@ export function useSelectConversationTab() {return {selectTab,navigateToTab,+ navigateToChanges,+ navigateToCommits,isTabActive,onTabChange,selectedTab,diff --git a/src/i18n/translation.json b/src/i18n/translation.jsonindex 02b084568c..c9cd066cb7 100644--- a/src/i18n/translation.json+++ b/src/i18n/translation.json@@ -36566,6 +36566,1145 @@"uk": "owner/repo","ca": "owner/repo"},+ "DIFF_VIEWER$UNCOMMITTED": {+ "en": "Uncommitted",+ "ja": "未コミット",+ "zh-CN": "未提交",+ "zh-TW": "未提交",+ "ko-KR": "커밋되지 않음",+ "no": "Ucommitted",+ "it": "Non committati",+ "pt": "Não commitados",+ "es": "Sin commit",+ "ar": "غير مُودَع",+ "fr": "Non commités",+ "tr": "Commit edilmemiş",+ "de": "Uncommitted",+ "uk": "Незакомічені",+ "ca": "Sense commit"+ },+ "DIFF_VIEWER$UNCOMMITTED_FILE_COUNT_one": {+ "en": "{{count}} file",+ "ja": "{{count}}ファイル",+ "zh-CN": "{{count}} 个文件",+ "zh-TW": "{{count}} 個檔案",+ "ko-KR": "{{count}}개 파일",+ "no": "{{count}} fil",+ "it": "{{count}} file",+ "pt": "{{count}} arquivo",+ "es": "{{count}} archivo",+ "ar": "ملف {{count}}",+ "fr": "{{count}} fichier",+ "tr": "{{count}} dosya",+ "de": "{{count}} Datei",+ "uk": "{{count}} файл",+ "ca": "{{count}} fitxer"+ },+ "DIFF_VIEWER$UNCOMMITTED_FILE_COUNT_other": {+ "en": "{{count}} files",+ "ja": "{{count}}ファイル",+ "zh-CN": "{{count}} 个文件",+ "zh-TW": "{{count}} 個檔案",+ "ko-KR": "{{count}}개 파일",+ "no": "{{count}} filer",+ "it": "{{count}} file",+ "pt": "{{count}} arquivos",+ "es": "{{count}} archivos",+ "ar": "{{count}} ملفات",+ "fr": "{{count}} fichiers",+ "tr": "{{count}} dosya",+ "de": "{{count}} Dateien",+ "uk": "{{count}} файлів",+ "ca": "{{count}} fitxers"+ },+ "FILES$CLOSE_TAB": {+ "en": "Close {{path}}",+ "ja": "{{path}} を閉じる",+ "zh-CN": "关闭 {{path}}",+ "zh-TW": "關閉 {{path}}",+ "ko-KR": "{{path}} 닫기",+ "no": "Lukk {{path}}",+ "it": "Chiudi {{path}}",+ "pt": "Fechar {{path}}",+ "es": "Cerrar {{path}}",+ "ar": "إغلاق {{path}}",+ "fr": "Fermer {{path}}",+ "tr": "{{path}} dosyasını kapat",+ "de": "{{path}} schließen",+ "uk": "Закрити {{path}}",+ "ca": "Tanca {{path}}"+ },+ "AUTOMATE$SECTION_TITLE": {+ "en": "Automate",+ "ja": "自動化",+ "zh-CN": "自动化",+ "zh-TW": "自動化",+ "ko-KR": "자동화",+ "no": "Automatiser",+ "it": "Automatizza",+ "pt": "Automatizar",+ "es": "Automatizar",+ "ar": "أتمتة",+ "fr": "Automatiser",+ "tr": "Otomatikleştir",+ "de": "Automatisieren",+ "uk": "Автоматизація",+ "ca": "Automatitza"+ },+ "AUTOMATE$NAV_DASHBOARD": {+ "en": "Dashboard",+ "ja": "ダッシュボード",+ "zh-CN": "仪表板",+ "zh-TW": "儀表板",+ "ko-KR": "대시보드",+ "no": "Dashbord",+ "it": "Dashboard",+ "pt": "Painel",+ "es": "Panel",+ "ar": "لوحة التحكم",+ "fr": "Tableau de bord",+ "tr": "Kontrol paneli",+ "de": "Dashboard",+ "uk": "Панель",+ "ca": "Tauler"+ },+ "AUTOMATE$NAV_WORKFLOWS": {+ "en": "Workflows",+ "ja": "ワークフロー",+ "zh-CN": "工作流",+ "zh-TW": "工作流程",+ "ko-KR": "워크플로",+ "no": "Arbeidsflyter",+ "it": "Workflow",+ "pt": "Fluxos de trabalho",+ "es": "Flujos de trabajo",+ "ar": "سير العمل",+ "fr": "Workflows",+ "tr": "İş akışları",+ "de": "Workflows",+ "uk": "Робочі процеси",+ "ca": "Fluxos de treball"+ },+ "AUTOMATE$NAV_ROUTINES": {+ "en": "Routines",+ "ja": "ルーティン",+ "zh-CN": "例行任务",+ "zh-TW": "例行任務",+ "ko-KR": "루틴",+ "no": "Rutiner",+ "it": "Routine",+ "pt": "Rotinas",+ "es": "Rutinas",+ "ar": "الروتينات",+ "fr": "Routines",+ "tr": "Rutinler",+ "de": "Routinen",+ "uk": "Рутини",+ "ca": "Rutines"+ },+ "AUTOMATE$NAV_RESPONDERS": {+ "en": "Responders",+ "ja": "レスポンダー",+ "zh-CN": "响应器",+ "zh-TW": "回應器",+ "ko-KR": "응답기",+ "no": "Respondere",+ "it": "Responder",+ "pt": "Respondedores",+ "es": "Respondedores",+ "ar": "المستجيبون",+ "fr": "Répondeurs",+ "tr": "Yanıtlayıcılar",+ "de": "Responder",+ "uk": "Відповідачі",+ "ca": "Respondedors"+ },+ "AUTOMATE$NAV_TEMPLATES": {+ "en": "Templates",+ "ja": "テンプレート",+ "zh-CN": "模板",+ "zh-TW": "範本",+ "ko-KR": "템플릿",+ "no": "Maler",+ "it": "Modelli",+ "pt": "Modelos",+ "es": "Plantillas",+ "ar": "القوالب",+ "fr": "Modèles",+ "tr": "Şablonlar",+ "de": "Vorlagen",+ "uk": "Шаблони",+ "ca": "Plantilles"+ },+ "AUTOMATE$PAGE_ROUTINES_SUBTITLE": {+ "en": "View and manage scheduled cron-style automation routines.",+ "ja": "スケジュールされた cron 形式のオートメーションルーティンを表示・管理します。",+ "zh-CN": "查看和管理计划的 cron 式自动化例行任务。",+ "zh-TW": "檢視並管理排程的 cron 式自動化例行任務。",+ "ko-KR": "예약된 cron 형식 자동화 루틴을 보고 관리합니다.",+ "no": "Vis og administrer planlagte cron-baserte automatiseringsrutiner.",+ "it": "Visualizza e gestisci routine di automazione pianificate in stile cron.",+ "pt": "Visualize e gerencie rotinas de automação agendadas no estilo cron.",+ "es": "Vea y administre rutinas de automatización programadas al estilo cron.",+ "ar": "اعرض وأدر روتينات الأتمتة المجدولة على نمط cron.",+ "fr": "Affichez et gérez les routines d'automatisation planifiées de type cron.",+ "tr": "Zamanlanmış cron tarzı otomasyon rutinlerini görüntüleyin ve yönetin.",+ "de": "Geplante Cron-Automatisierungsroutinen anzeigen und verwalten.",+ "uk": "Переглядайте та керуйте запланованими рутинами автоматизації у стилі cron.",+ "ca": "Visualitzeu i gestioneu rutines d'automatització programades en estil cron."+ },+ "AUTOMATE$PAGE_DASHBOARD_SUBTITLE": {+ "en": "Overview of the workflows, routines, and responders supporting your SDLC.",+ "ja": "SDLC を支えるワークフロー、ルーティン、レスポンダーの概要。",+ "zh-CN": "概览支持您 SDLC 的工作流、例行任务和响应器。",+ "zh-TW": "概覽支援您 SDLC 的工作流程、例行任務與回應器。",+ "ko-KR": "SDLC를 지원하는 워크플로, 루틴, 응답기 개요입니다.",+ "no": "Oversikt over arbeidsflyter, rutiner og respondere som støtter SDLC-en din.",+ "it": "Panoramica di workflow, routine e responder che supportano il tuo SDLC.",+ "pt": "Visão geral dos fluxos de trabalho, rotinas e respondedores que apoiam seu SDLC.",+ "es": "Resumen de los flujos de trabajo, rutinas y respondedores que respaldan su SDLC.",+ "ar": "نظرة عامة على سير العمل والروتينات والمستجيبين الذين يدعمون دورة حياة التطوير لديك.",+ "fr": "Aperçu des workflows, routines et répondeurs qui soutiennent votre SDLC.",+ "tr": "SDLC'nizi destekleyen iş akışları, rutinler ve yanıtlayıcıların genel görünümü.",+ "de": "Überblick über die Workflows, Routinen und Responder, die Ihren SDLC unterstützen.",+ "uk": "Огляд робочих процесів, рутин і відповідачів, що підтримують ваш SDLC.",+ "ca": "Visió general dels fluxos de treball, rutines i respondedors que donen suport al vostre SDLC."+ },+ "AUTOMATE$PAGE_WORKFLOWS_SUBTITLE": {+ "en": "Build and manage multi-step workflows triggered by events or schedules.",+ "ja": "イベントまたはスケジュールで起動する多段階ワークフローを作成・管理します。",+ "zh-CN": "构建和管理由事件或计划触发的多步骤工作流。",+ "zh-TW": "建立並管理由事件或排程觸發的多步驟工作流程。",+ "ko-KR": "이벤트 또는 일정으로 실행되는 다단계 워크플로를 구성하고 관리합니다.",+ "no": "Bygg og administrer flertrinns arbeidsflyter utløst av hendelser eller tidsplaner.",+ "it": "Crea e gestisci workflow multi-step attivati da eventi o pianificazioni.",+ "pt": "Crie e gerencie fluxos de trabalho em várias etapas acionados por eventos ou agendas.",+ "es": "Cree y administre flujos de trabajo de varios pasos activados por eventos o programaciones.",+ "ar": "أنشئ وأدر سير عمل متعدد الخطوات يُفعَّل بالأحداث أو الجداول.",+ "fr": "Créez et gérez des workflows en plusieurs étapes déclenchés par des événements ou des plannings.",+ "tr": "Olaylar veya zamanlamalarla tetiklenen çok adımlı iş akışları oluşturun ve yönetin.",+ "de": "Erstellen und verwalten Sie mehrstufige Workflows, die durch Ereignisse oder Zeitpläne ausgelöst werden.",+ "uk": "Створюйте та керуйте багатокроковими робочими процесами, які запускаються подіями або розкладом.",+ "ca": "Creeu i gestioneu fluxos de treball de diversos passos activats per esdeveniments o planificacions."+ },+ "AUTOMATE$PAGE_RESPONDERS_SUBTITLE": {+ "en": "Configure event-driven responders that react to integrations and webhooks.",+ "ja": "連携や Webhook に反応するイベント駆動型レスポンダーを設定します。",+ "zh-CN": "配置响应集成和 Webhook 的事件驱动响应器。",+ "zh-TW": "設定回應整合與 Webhook 的事件驅動回應器。",+ "ko-KR": "통합 및 웹훅에 반응하는 이벤트 기반 응답기를 구성합니다.",+ "no": "Konfigurer hendelsesdrevne respondere som reagerer på integrasjoner og webhooks.",+ "it": "Configura responder guidati da eventi che reagiscono a integrazioni e webhook.",+ "pt": "Configure respondedores orientados a eventos que reagem a integrações e webhooks.",+ "es": "Configure respondedores basados en eventos que reaccionan a integraciones y webhooks.",+ "ar": "اضبط مستجيبين يعتمدون على الأحداث ويتفاعلون مع عمليات التكامل وخطافات الويب.",+ "fr": "Configurez des répondeurs pilotés par événements qui réagissent aux intégrations et webhooks.",+ "tr": "Entegrasyonlara ve webhook'lara tepki veren olay tabanlı yanıtlayıcıları yapılandırın.",+ "de": "Konfigurieren Sie ereignisgesteuerte Responder, die auf Integrationen und Webhooks reagieren.",+ "uk": "Налаштуйте відповідачі на події, які реагують на інтеграції та вебхуки.",+ "ca": "Configureu respondedors basats en esdeveniments que reaccionen a integracions i webhooks."+ },+ "AUTOMATE$PAGE_TEMPLATES_SUBTITLE": {+ "en": "Browse and install automation templates to get started quickly.",+ "ja": "オートメーションテンプレートを参照してインストールし、すぐに始めましょう。",+ "zh-CN": "浏览并安装自动化模板,快速上手。",+ "zh-TW": "瀏覽並安裝自動化範本,快速開始。",+ "ko-KR": "자동화 템플릿을 탐색하고 설치하여 빠르게 시작하세요.",+ "no": "Bla gjennom og installer automatiseringsmaler for å komme raskt i gang.",+ "it": "Sfoglia e installa modelli di automazione per iniziare rapidamente.",+ "pt": "Navegue e instale modelos de automação para começar rapidamente.",+ "es": "Explore e instale plantillas de automatización para empezar rápidamente.",+ "ar": "تصفح قوالب الأتمتة وثبّتها للبدء بسرعة.",+ "fr": "Parcourez et installez des modèles d'automatisation pour démarrer rapidement.",+ "tr": "Hızlı başlamak için otomasyon şablonlarına göz atın ve yükleyin.",+ "de": "Durchsuchen und installieren Sie Automatisierungsvorlagen, um schnell loszulegen.",+ "uk": "Переглядайте та встановлюйте шаблони автоматизації, щоб швидко розпочати.",+ "ca": "Exploreu i instal·leu plantilles d'automatització per començar ràpidament."+ },+ "AUTOMATE$DASHBOARD_STAT_TOTAL": {+ "en": "Total automations",+ "ja": "オートメーション合計",+ "zh-CN": "自动化总数",+ "zh-TW": "自動化總數",+ "ko-KR": "자동화 총계",+ "no": "Totalt antall automatiseringer",+ "it": "Automazioni totali",+ "pt": "Total de automações",+ "es": "Automatizaciones totales",+ "ar": "إجمالي الأتمتة",+ "fr": "Total des automatisations",+ "tr": "Toplam otomasyon",+ "de": "Automatisierungen gesamt",+ "uk": "Усього автоматизацій",+ "ca": "Total d'automatitzacions"+ },+ "AUTOMATE$DASHBOARD_CATEGORY_WORKFLOWS_DESCRIPTION": {+ "en": "Create and manage event-driven SDLC processes with clear when/then behavior.",+ "ja": "明確な when/then 動作を持つイベント駆動型 SDLC プロセスを作成・管理します。",+ "zh-CN": "创建和管理具有清晰 when/then 行为的事件驱动 SDLC 流程。",+ "zh-TW": "建立並管理具有明確 when/then 行為的事件驅動 SDLC 流程。",+ "ko-KR": "명확한 when/then 동작을 갖춘 이벤트 기반 SDLC 프로세스를 생성하고 관리합니다.",+ "no": "Opprett og administrer hendelsesdrevne SDLC-prosesser med tydelig når/så-oppførsel.",+ "it": "Crea e gestisci processi SDLC guidati da eventi con comportamento when/then chiaro.",+ "pt": "Crie e gerencie processos SDLC orientados a eventos com comportamento when/then claro.",+ "es": "Cree y administre procesos SDLC basados en eventos con comportamiento when/then claro.",+ "ar": "أنشئ وأدر عمليات دورة حياة التطوير المدفوعة بالأحداث بسلوك when/then واضح.",+ "fr": "Créez et gérez des processus SDLC pilotés par événements avec un comportement when/then clair.",+ "tr": "Net when/then davranışına sahip olay tabanlı SDLC süreçlerini oluşturun ve yönetin.",+ "de": "Erstellen und verwalten Sie ereignisgesteuerte SDLC-Prozesse mit klarem Wenn/Dann-Verhalten.",+ "uk": "Створюйте та керуйте SDLC-процесами на подіях із чіткою поведінкою when/then.",+ "ca": "Creeu i gestioneu processos SDLC basats en esdeveniments amb un comportament when/then clar."+ },+ "AUTOMATE$DASHBOARD_CATEGORY_ROUTINES_DESCRIPTION": {+ "en": "Create and manage scheduled scans, digests, readiness checks, and recurring reports.",+ "ja": "スケジュールされたスキャン、ダイジェスト、準備状況チェック、定期レポートを作成・管理します。",+ "zh-CN": "创建和管理计划的扫描、摘要、就绪检查和定期报告。",+ "zh-TW": "建立並管理排程掃描、摘要、就緒檢查與定期報告。",+ "ko-KR": "예약된 스캔, 다이제스트, 준비 상태 점검, 반복 보고서를 생성하고 관리합니다.",+ "no": "Opprett og administrer planlagte skanninger, sammendrag, beredskapskontroller og gjentakende rapporter.",+ "it": "Crea e gestisci scansioni pianificate, digest, controlli di prontezza e report ricorrenti.",+ "pt": "Crie e gerencie varreduras agendadas, resumos, verificações de prontidão e relatórios recorrentes.",+ "es": "Cree y administre escaneos programados, resúmenes, comprobaciones de preparación e informes recurrentes.",+ "ar": "أنشئ وأدر عمليات المسح المجدولة والملخصات وفحوصات الجاهزية والتقارير المتكررة.",+ "fr": "Créez et gérez des analyses planifiées, des synthèses, des contrôles de préparation et des rapports récurrents.",+ "tr": "Zamanlanmış taramalar, özetler, hazırlık kontrolleri ve yinelenen raporları oluşturun ve yönetin.",+ "de": "Erstellen und verwalten Sie geplante Scans, Digests, Bereitschaftsprüfungen und wiederkehrende Berichte.",+ "uk": "Створюйте та керуйте запланованими скануваннями, дайджестами, перевірками готовності та регулярними звітами.",+ "ca": "Creeu i gestioneu escanejos programats, resums, comprovacions de preparació i informes recurrents."+ },+ "AUTOMATE$DASHBOARD_CATEGORY_RESPONDERS_DESCRIPTION": {+ "en": "Create always-on chat-like connections that turn messages and mentions into Agent Canvas conversations.",+ "ja": "メッセージやメンションを Agent Canvas の会話に変える常時接続のチャット型コネクションを作成します。",+ "zh-CN": "创建始终在线的类聊天连接,将消息和提及转化为 Agent Canvas 对话。",+ "zh-TW": "建立常駐的類聊天連線,將訊息與提及轉為 Agent Canvas 對話。",+ "ko-KR": "메시지와 멘션을 Agent Canvas 대화로 전환하는 상시 채팅형 연결을 만듭니다.",+ "no": "Opprett alltid-på chat-lignende tilkoblinger som gjør meldinger og omtaler om til Agent Canvas-samtaler.",+ "it": "Crea connessioni sempre attive simili a chat che trasformano messaggi e menzioni in conversazioni Agent Canvas.",+ "pt": "Crie conexões sempre ativas semelhantes a chat que transformam mensagens e menções em conversas do Agent Canvas.",+ "es": "Cree conexiones tipo chat siempre activas que convierten mensajes y menciones en conversaciones de Agent Canvas.",+ "ar": "أنشئ اتصالات شبيهة بالدردشة تعمل دائمًا لتحويل الرسائل والإشارات إلى محادثات Agent Canvas.",+ "fr": "Créez des connexions de type chat toujours actives qui transforment messages et mentions en conversations Agent Canvas.",+ "tr": "Mesajları ve bahsetmeleri Agent Canvas konuşmalarına dönüştüren her zaman açık sohbet benzeri bağlantılar oluşturun.",+ "de": "Erstellen Sie dauerhafte chatähnliche Verbindungen, die Nachrichten und Erwähnungen in Agent-Canvas-Konversationen umwandeln.",+ "uk": "Створюйте постійні чатоподібні з'єднання, що перетворюють повідомлення та згадки на розмови Agent Canvas.",+ "ca": "Creeu connexions tipus xat sempre actives que converteixen missatges i mencions en converses d'Agent Canvas."+ },+ "AUTOMATE$DASHBOARD_CREATE_WORKFLOW": {+ "en": "Create workflow",+ "ja": "ワークフローを作成",+ "zh-CN": "创建工作流",+ "zh-TW": "建立工作流程",+ "ko-KR": "워크플로 만들기",+ "no": "Opprett arbeidsflyt",+ "it": "Crea workflow",+ "pt": "Criar fluxo de trabalho",+ "es": "Crear flujo de trabajo",+ "ar": "إنشاء سير عمل",+ "fr": "Créer un workflow",+ "tr": "İş akışı oluştur",+ "de": "Workflow erstellen",+ "uk": "Створити робочий процес",+ "ca": "Crea flux de treball"+ },+ "AUTOMATE$DASHBOARD_CREATE_ROUTINE": {+ "en": "Create routine",+ "ja": "ルーティンを作成",+ "zh-CN": "创建例行任务",+ "zh-TW": "建立例行任務",+ "ko-KR": "루틴 만들기",+ "no": "Opprett rutine",+ "it": "Crea routine",+ "pt": "Criar rotina",+ "es": "Crear rutina",+ "ar": "إنشاء روتين",+ "fr": "Créer une routine",+ "tr": "Rutin oluştur",+ "de": "Routine erstellen",+ "uk": "Створити рутину",+ "ca": "Crea rutina"+ },+ "AUTOMATE$DASHBOARD_CREATE_RESPONDER": {+ "en": "Create responder",+ "ja": "レスポンダーを作成",+ "zh-CN": "创建响应器",+ "zh-TW": "建立回應器",+ "ko-KR": "응답기 만들기",+ "no": "Opprett responder",+ "it": "Crea responder",+ "pt": "Criar respondedor",+ "es": "Crear respondedor",+ "ar": "إنشاء مستجيب",+ "fr": "Créer un répondeur",+ "tr": "Yanıtlayıcı oluştur",+ "de": "Responder erstellen",+ "uk": "Створити відповідач",+ "ca": "Crea respondedor"+ },+ "AUTOMATE$DASHBOARD_RECENT_ACTIVITY": {+ "en": "Recent activity",+ "ja": "最近のアクティビティ",+ "zh-CN": "最近活动",+ "zh-TW": "最近活動",+ "ko-KR": "최근 활동",+ "no": "Nylig aktivitet",+ "it": "Attività recente",+ "pt": "Atividade recente",+ "es": "Actividad reciente",+ "ar": "النشاط الأخير",+ "fr": "Activité récente",+ "tr": "Son etkinlik",+ "de": "Letzte Aktivität",+ "uk": "Недавня активність",+ "ca": "Activitat recent"+ },+ "AUTOMATE$DASHBOARD_RECENT_ACTIVITY_SUBTITLE": {+ "en": "Runs remain available from each automation detail page.",+ "ja": "実行履歴は各オートメーションの詳細ページから確認できます。",+ "zh-CN": "每次运行的记录仍可从各自动化详情页查看。",+ "zh-TW": "執行紀錄仍可從各自動化詳情頁面查看。",+ "ko-KR": "실행 기록은 각 자동화 상세 페이지에서 계속 확인할 수 있습니다.",+ "no": "Kjøringer er fortsatt tilgjengelige fra hver automatiseringsdetaljside.",+ "it": "Le esecuzioni restano disponibili dalla pagina di dettaglio di ogni automazione.",+ "pt": "As execuções continuam disponíveis na página de detalhes de cada automação.",+ "es": "Las ejecuciones siguen disponibles en la página de detalle de cada automatización.",+ "ar": "تظل عمليات التشغيل متاحة من صفحة تفاصيل كل أتمتة.",+ "fr": "Les exécutions restent accessibles depuis la page de détail de chaque automatisation.",+ "tr": "Çalıştırmalar her otomasyonun ayrıntı sayfasından görüntülenmeye devam eder.",+ "de": "Ausführungen bleiben auf der Detailseite jeder Automatisierung verfügbar.",+ "uk": "Запуски залишаються доступними на сторінці деталей кожної автоматизації.",+ "ca": "Les execucions continuen disponibles des de la pàgina de detall de cada automatització."+ },+ "AUTOMATE$DASHBOARD_RECENT_ACTIVITY_EMPTY": {+ "en": "No automations have run yet.",+ "ja": "まだ実行されたオートメーションはありません。",+ "zh-CN": "尚无自动化运行记录。",+ "zh-TW": "尚無自動化執行紀錄。",+ "ko-KR": "아직 실행된 자동화가 없습니다.",+ "no": "Ingen automatiseringer har kjørt ennå.",+ "it": "Nessuna automazione è stata ancora eseguita.",+ "pt": "Nenhuma automação foi executada ainda.",+ "es": "Aún no se ha ejecutado ninguna automatización.",+ "ar": "لم يتم تشغيل أي أتمتة بعد.",+ "fr": "Aucune automatisation n'a encore été exécutée.",+ "tr": "Henüz hiçbir otomasyon çalıştırılmadı.",+ "de": "Es wurden noch keine Automatisierungen ausgeführt.",+ "uk": "Ще не було запущено жодної автоматизації.",+ "ca": "Encara no s'ha executat cap automatització."+ },+ "AUTOMATE$DASHBOARD_BROWSE_TEMPLATES": {+ "en": "Browse templates",+ "ja": "テンプレートを参照",+ "zh-CN": "浏览模板",+ "zh-TW": "瀏覽範本",+ "ko-KR": "템플릿 둘러보기",+ "no": "Bla gjennom maler",+ "it": "Sfoglia modelli",+ "pt": "Navegar modelos",+ "es": "Explorar plantillas",+ "ar": "تصفح القوالب",+ "fr": "Parcourir les modèles",+ "tr": "Şablonlara göz at",+ "de": "Vorlagen durchsuchen",+ "uk": "Переглянути шаблони",+ "ca": "Explora plantilles"+ },+ "AUTOMATE$DASHBOARD_KIND_WORKFLOW": {+ "en": "Workflow",+ "ja": "ワークフロー",+ "zh-CN": "工作流",+ "zh-TW": "工作流程",+ "ko-KR": "워크플로",+ "no": "Arbeidsflyt",+ "it": "Workflow",+ "pt": "Fluxo de trabalho",+ "es": "Flujo de trabajo",+ "ar": "سير عمل",+ "fr": "Workflow",+ "tr": "İş akışı",+ "de": "Workflow",+ "uk": "Робочий процес",+ "ca": "Flux de treball"+ },+ "AUTOMATE$DASHBOARD_KIND_ROUTINE": {+ "en": "Routine",+ "ja": "ルーティン",+ "zh-CN": "例行任务",+ "zh-TW": "例行任務",+ "ko-KR": "루틴",+ "no": "Rutine",+ "it": "Routine",+ "pt": "Rotina",+ "es": "Rutina",+ "ar": "روتين",+ "fr": "Routine",+ "tr": "Rutin",+ "de": "Routine",+ "uk": "Рутина",+ "ca": "Rutina"+ },+ "AUTOMATE$DASHBOARD_KIND_RESPONDER": {+ "en": "Responder",+ "ja": "レスポンダー",+ "zh-CN": "响应器",+ "zh-TW": "回應器",+ "ko-KR": "응답기",+ "no": "Responder",+ "it": "Responder",+ "pt": "Respondedor",+ "es": "Respondedor",+ "ar": "مستجيب",+ "fr": "Répondeur",+ "tr": "Yanıtlayıcı",+ "de": "Responder",+ "uk": "Відповідач",+ "ca": "Respondedor"+ },+ "AUTOMATE$DASHBOARD_TIME_SECONDS_AGO": {+ "en": "{{count}}s ago",+ "ja": "{{count}}秒前",+ "zh-CN": "{{count}} 秒前",+ "zh-TW": "{{count}} 秒前",+ "ko-KR": "{{count}}초 전",+ "no": "for {{count}} sek siden",+ "it": "{{count}} s fa",+ "pt": "há {{count}} s",+ "es": "hace {{count}} s",+ "ar": "منذ {{count}} ث",+ "fr": "il y a {{count}} s",+ "tr": "{{count}} sn önce",+ "de": "vor {{count}} s",+ "uk": "{{count}} с тому",+ "ca": "fa {{count}} s"+ },+ "AUTOMATE$WORKFLOWS_EMPTY_TITLE": {+ "en": "No workflows configured",+ "ja": "ワークフローが設定されていません",+ "zh-CN": "未配置工作流",+ "zh-TW": "尚未設定工作流程",+ "ko-KR": "구성된 워크플로가 없습니다",+ "no": "Ingen arbeidsflyter er konfigurert",+ "it": "Nessun workflow configurato",+ "pt": "Nenhum fluxo de trabalho configurado",+ "es": "No hay flujos de trabajo configurados",+ "ar": "لم يتم تكوين أي سير عمل",+ "fr": "Aucun workflow configuré",+ "tr": "Yapılandırılmış iş akışı yok",+ "de": "Keine Workflows konfiguriert",+ "uk": "Робочі процеси не налаштовано",+ "ca": "No hi ha fluxos de treball configurats"+ },+ "AUTOMATE$WORKFLOWS_EMPTY_DESCRIPTION": {+ "en": "Create a workflow for event-driven SDLC processes such as PR review, CI failure investigation, ticket planning, or release gate checks.",+ "ja": "PR レビュー、CI 失敗調査、チケット計画、リリースゲートチェックなど、イベント駆動型 SDLC プロセスのワークフローを作成します。",+ "zh-CN": "为 PR 审查、CI 失败调查、工单规划或发布门禁检查等事件驱动 SDLC 流程创建工作流。",+ "zh-TW": "為 PR 審查、CI 失敗調查、工單規劃或發布門禁檢查等事件驅動 SDLC 流程建立工作流程。",+ "ko-KR": "PR 리뷰, CI 실패 조사, 티켓 계획, 릴리스 게이트 점검 등 이벤트 기반 SDLC 프로세스를 위한 워크플로를 만드세요.",+ "no": "Opprett en arbeidsflyt for hendelsesdrevne SDLC-prosesser som PR-gjennomgang, CI-feilundersøkelse, billettplanlegging eller release gate-sjekker.",+ "it": "Crea un workflow per processi SDLC guidati da eventi come revisione PR, indagine su errori CI, pianificazione ticket o controlli di release gate.",+ "pt": "Crie um fluxo de trabalho para processos SDLC orientados a eventos, como revisão de PR, investigação de falhas de CI, planejamento de tickets ou verificações de release gate.",+ "es": "Cree un flujo de trabajo para procesos SDLC basados en eventos, como revisión de PR, investigación de fallos de CI, planificación de tickets o comprobaciones de release gate.",+ "ar": "أنشئ سير عمل لعمليات دورة حياة التطوير المدفوعة بالأحداث مثل مراجعة PR أو التحقيق في فشل CI أو تخطيط التذاكر أو فحوصات بوابة الإصدار.",+ "fr": "Créez un workflow pour des processus SDLC pilotés par événements tels que la revue de PR, l'investigation d'échecs CI, la planification de tickets ou les contrôles de release gate.",+ "tr": "PR incelemesi, CI hata araştırması, bilet planlama veya sürüm kapısı kontrolleri gibi olay tabanlı SDLC süreçleri için bir iş akışı oluşturun.",+ "de": "Erstellen Sie einen Workflow für ereignisgesteuerte SDLC-Prozesse wie PR-Review, CI-Fehleruntersuchung, Ticketplanung oder Release-Gate-Prüfungen.",+ "uk": "Створіть робочий процес для SDLC на подіях, наприклад огляд PR, розслідування збоїв CI, планування тікетів або перевірки release gate.",+ "ca": "Creeu un flux de treball per a processos SDLC basats en esdeveniments com ara revisió de PR, investigació de fallades de CI, planificació de tiquets o comprovacions de release gate."+ },+ "AUTOMATE$ROUTINES_EMPTY_TITLE": {+ "en": "No routines configured",+ "ja": "ルーティンが設定されていません",+ "zh-CN": "未配置例行任务",+ "zh-TW": "尚未設定例行任務",+ "ko-KR": "구성된 루틴이 없습니다",+ "no": "Ingen rutiner er konfigurert",+ "it": "Nessuna routine configurata",+ "pt": "Nenhuma rotina configurada",+ "es": "No hay rutinas configuradas",+ "ar": "لم يتم تكوين أي روتينات",+ "fr": "Aucune routine configurée",+ "tr": "Yapılandırılmış rutin yok",+ "de": "Keine Routinen konfiguriert",+ "uk": "Рутини не налаштовано",+ "ca": "No hi ha rutines configurades"+ },+ "AUTOMATE$ROUTINES_EMPTY_DESCRIPTION": {+ "en": "Create a routine for scheduled scans, digests, readiness checks, or recurring reports.",+ "ja": "スケジュールされたスキャン、ダイジェスト、準備状況チェック、定期レポートのルーティンを作成します。",+ "zh-CN": "为计划的扫描、摘要、就绪检查或定期报告创建例行任务。",+ "zh-TW": "為排程掃描、摘要、就緒檢查或定期報告建立例行任務。",+ "ko-KR": "예약된 스캔, 다이제스트, 준비 상태 점검 또는 반복 보고서를 위한 루틴을 만드세요.",+ "no": "Opprett en rutine for planlagte skanninger, sammendrag, beredskapskontroller eller gjentakende rapporter.",+ "it": "Crea una routine per scansioni pianificate, digest, controlli di prontezza o report ricorrenti.",+ "pt": "Crie uma rotina para varreduras agendadas, resumos, verificações de prontidão ou relatórios recorrentes.",+ "es": "Cree una rutina para escaneos programados, resúmenes, comprobaciones de preparación o informes recurrentes.",+ "ar": "أنشئ روتينًا للمسح المجدول أو الملخصات أو فحوصات الجاهزية أو التقارير المتكررة.",+ "fr": "Créez une routine pour des analyses planifiées, des synthèses, des contrôles de préparation ou des rapports récurrents.",+ "tr": "Zamanlanmış taramalar, özetler, hazırlık kontrolleri veya yinelenen raporlar için bir rutin oluşturun.",+ "de": "Erstellen Sie eine Routine für geplante Scans, Digests, Bereitschaftsprüfungen oder wiederkehrende Berichte.",+ "uk": "Створіть рутину для запланованих сканувань, дайджестів, перевірок готовності або регулярних звітів.",+ "ca": "Creeu una rutina per a escanejos programats, resums, comprovacions de preparació o informes recurrents."+ },+ "CONVERSATION$OVERVIEW": {+ "en": "Overview",+ "ja": "概要",+ "zh-CN": "概览",+ "zh-TW": "概覽",+ "ko-KR": "개요",+ "no": "Oversikt",+ "ar": "نظرة عامة",+ "de": "Übersicht",+ "fr": "Aperçu",+ "it": "Panoramica",+ "pt": "Visão geral",+ "es": "Resumen",+ "tr": "Genel bakış",+ "uk": "Огляд",+ "ca": "Resum"+ },+ "CONVERSATION$SHOW_OVERVIEW": {+ "en": "Show overview",+ "ja": "概要を表示",+ "zh-CN": "显示概览",+ "zh-TW": "顯示概覽",+ "ko-KR": "개요 표시",+ "no": "Vis oversikt",+ "ar": "إظهار النظرة العامة",+ "de": "Übersicht anzeigen",+ "fr": "Afficher l'aperçu",+ "it": "Mostra panoramica",+ "pt": "Mostrar visão geral",+ "es": "Mostrar resumen",+ "tr": "Genel bakışı göster",+ "uk": "Показати огляд",+ "ca": "Mostra el resum"+ },+ "CONVERSATION$HIDE_OVERVIEW": {+ "en": "Hide overview",+ "ja": "概要を非表示",+ "zh-CN": "隐藏概览",+ "zh-TW": "隱藏概覽",+ "ko-KR": "개요 숨기기",+ "no": "Skjul oversikt",+ "ar": "إخفاء النظرة العامة",+ "de": "Übersicht ausblenden",+ "fr": "Masquer l'aperçu",+ "it": "Nascondi panoramica",+ "pt": "Ocultar visão geral",+ "es": "Ocultar resumen",+ "tr": "Genel bakışı gizle",+ "uk": "Приховати огляд",+ "ca": "Amaga el resum"+ },+ "CONVERSATION$OVERVIEW_WORKSPACE": {+ "en": "Workspace",+ "ja": "ワークスペース",+ "zh-CN": "工作区",+ "zh-TW": "工作區",+ "ko-KR": "워크스페이스",+ "no": "Arbeidsområde",+ "ar": "مساحة العمل",+ "de": "Arbeitsbereich",+ "fr": "Espace de travail",+ "it": "Workspace",+ "pt": "Workspace",+ "es": "Espacio de trabajo",+ "tr": "Çalışma alanı",+ "uk": "Робоча область",+ "ca": "Espai de treball"+ },+ "CONVERSATION$OVERVIEW_MODEL": {+ "en": "Model",+ "ja": "モデル",+ "zh-CN": "模型",+ "zh-TW": "模型",+ "ko-KR": "모델",+ "no": "Modell",+ "ar": "النموذج",+ "de": "Modell",+ "fr": "Modèle",+ "it": "Modello",+ "pt": "Modelo",+ "es": "Modelo",+ "tr": "Model",+ "uk": "Модель",+ "ca": "Model"+ },+ "CONVERSATION$OVERVIEW_MODE": {+ "en": "Mode",+ "ja": "モード",+ "zh-CN": "模式",+ "zh-TW": "模式",+ "ko-KR": "모드",+ "no": "Modus",+ "ar": "الوضع",+ "de": "Modus",+ "fr": "Mode",+ "it": "Modalità",+ "pt": "Modo",+ "es": "Modo",+ "tr": "Mod",+ "uk": "Режим",+ "ca": "Mode"+ },+ "CONVERSATION$OVERVIEW_MCP": {+ "en": "MCP servers",+ "ja": "MCPサーバー",+ "zh-CN": "MCP 服务器",+ "zh-TW": "MCP 伺服器",+ "ko-KR": "MCP 서버",+ "no": "MCP-servere",+ "ar": "خوادم MCP",+ "de": "MCP-Server",+ "fr": "Serveurs MCP",+ "it": "Server MCP",+ "pt": "Servidores MCP",+ "es": "Servidores MCP",+ "tr": "MCP sunucuları",+ "uk": "MCP-сервери",+ "ca": "Servidors MCP"+ },+ "CONVERSATION$OVERVIEW_NONE": {+ "en": "None",+ "ja": "なし",+ "zh-CN": "无",+ "zh-TW": "無",+ "ko-KR": "없음",+ "no": "Ingen",+ "ar": "لا يوجد",+ "de": "Keine",+ "fr": "Aucun",+ "it": "Nessuno",+ "pt": "Nenhum",+ "es": "Ninguno",+ "tr": "Yok",+ "uk": "Немає",+ "ca": "Cap"+ },+ "CONVERSATION$OVERVIEW_UNAVAILABLE": {+ "en": "—",+ "ja": "—",+ "zh-CN": "—",+ "zh-TW": "—",+ "ko-KR": "—",+ "no": "—",+ "ar": "—",+ "de": "—",+ "fr": "—",+ "it": "—",+ "pt": "—",+ "es": "—",+ "tr": "—",+ "uk": "—",+ "ca": "—"+ },+ "CONVERSATION$OVERVIEW_ADD_AUTOMATION": {+ "en": "Add automation",+ "ja": "自動化を追加",+ "zh-CN": "添加自动化",+ "zh-TW": "新增自動化",+ "ko-KR": "자동화 추가",+ "no": "Legg til automatisering",+ "ar": "إضافة أتمتة",+ "de": "Automatisierung hinzufügen",+ "fr": "Ajouter une automatisation",+ "it": "Aggiungi automazione",+ "pt": "Adicionar automação",+ "es": "Añadir automatización",+ "tr": "Otomasyon ekle",+ "uk": "Додати автоматизацію",+ "ca": "Afegeix automatització"+ },+ "CONVERSATION$OVERVIEW_ADD_SKILL": {+ "en": "Add skill",+ "ja": "スキルを追加",+ "zh-CN": "添加技能",+ "zh-TW": "新增技能",+ "ko-KR": "스킬 추가",+ "no": "Legg til ferdighet",+ "ar": "إضافة مهارة",+ "de": "Skill hinzufügen",+ "fr": "Ajouter une compétence",+ "it": "Aggiungi abilità",+ "pt": "Adicionar habilidade",+ "es": "Añadir habilidad",+ "tr": "Yetenek ekle",+ "uk": "Додати навичку",+ "ca": "Afegeix habilitat"+ },+ "CONVERSATION$OVERVIEW_ADD_MCP": {+ "en": "Add MCP server",+ "ja": "MCPサーバーを追加",+ "zh-CN": "添加 MCP 服务器",+ "zh-TW": "新增 MCP 伺服器",+ "ko-KR": "MCP 서버 추가",+ "no": "Legg til MCP-server",+ "ar": "إضافة خادم MCP",+ "de": "MCP-Server hinzufügen",+ "fr": "Ajouter un serveur MCP",+ "it": "Aggiungi server MCP",+ "pt": "Adicionar servidor MCP",+ "es": "Añadir servidor MCP",+ "tr": "MCP sunucusu ekle",+ "uk": "Додати MCP-сервер",+ "ca": "Afegeix servidor MCP"+ },+ "CONVERSATION$OVERVIEW_OPEN_CHANGES": {+ "en": "Open changes",+ "ja": "変更を開く",+ "zh-CN": "打开更改",+ "zh-TW": "開啟變更",+ "ko-KR": "변경 사항 열기",+ "no": "Åpne endringer",+ "ar": "فتح التغييرات",+ "de": "Änderungen öffnen",+ "fr": "Ouvrir les modifications",+ "it": "Apri modifiche",+ "pt": "Abrir alterações",+ "es": "Abrir cambios",+ "tr": "Değişiklikleri aç",+ "uk": "Відкрити зміни",+ "ca": "Obre els canvis"+ },+ "CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS": {+ "en": "Git actions",+ "ja": "Git アクション",+ "zh-CN": "Git 操作",+ "zh-TW": "Git 操作",+ "ko-KR": "Git 작업",+ "no": "Git-handlinger",+ "ar": "إجراءات Git",+ "de": "Git-Aktionen",+ "fr": "Actions Git",+ "it": "Azioni Git",+ "pt": "Ações Git",+ "es": "Acciones de Git",+ "tr": "Git eylemleri",+ "uk": "Дії Git",+ "ca": "Accions Git"+ },+ "CONVERSATION$OVERVIEW_DIFF_ADDITIONS": {+ "en": "+{{count}}",+ "ja": "+{{count}}",+ "zh-CN": "+{{count}}",+ "zh-TW": "+{{count}}",+ "ko-KR": "+{{count}}",+ "no": "+{{count}}",+ "ar": "+{{count}}",+ "de": "+{{count}}",+ "fr": "+{{count}}",+ "it": "+{{count}}",+ "pt": "+{{count}}",+ "es": "+{{count}}",+ "tr": "+{{count}}",+ "uk": "+{{count}}",+ "ca": "+{{count}}"+ },+ "CONVERSATION$OVERVIEW_DIFF_DELETIONS": {+ "en": "-{{count}}",+ "ja": "-{{count}}",+ "zh-CN": "-{{count}}",+ "zh-TW": "-{{count}}",+ "ko-KR": "-{{count}}",+ "no": "-{{count}}",+ "ar": "-{{count}}",+ "de": "-{{count}}",+ "fr": "-{{count}}",+ "it": "-{{count}}",+ "pt": "-{{count}}",+ "es": "-{{count}}",+ "tr": "-{{count}}",+ "uk": "-{{count}}",+ "ca": "-{{count}}"+ },+ "CONVERSATION$OVERVIEW_GIT": {+ "en": "Git",+ "ja": "Git",+ "zh-CN": "Git",+ "zh-TW": "Git",+ "ko-KR": "Git",+ "no": "Git",+ "ar": "Git",+ "de": "Git",+ "fr": "Git",+ "it": "Git",+ "pt": "Git",+ "es": "Git",+ "tr": "Git",+ "uk": "Git",+ "ca": "Git"+ },+ "CONVERSATION$OVERVIEW_GLOBAL": {+ "en": "Global",+ "ja": "グローバル",+ "zh-CN": "全局",+ "zh-TW": "全域",+ "ko-KR": "전역",+ "no": "Globalt",+ "ar": "عام",+ "de": "Global",+ "fr": "Global",+ "it": "Globale",+ "pt": "Global",+ "es": "Global",+ "tr": "Genel",+ "uk": "Глобальні",+ "ca": "Global"+ },+ "CONVERSATION$PIN_OVERVIEW_SECTION": {+ "en": "Pin to overview",+ "ja": "概要に固定",+ "zh-CN": "固定到概览",+ "zh-TW": "釘選到概覽",+ "ko-KR": "개요에 고정",+ "no": "Fest til oversikt",+ "ar": "تثبيت في النظرة العامة",+ "de": "An Übersicht anheften",+ "fr": "Épingler à l'aperçu",+ "it": "Fissa nella panoramica",+ "pt": "Fixar na visão geral",+ "es": "Fijar en el resumen",+ "tr": "Genel bakışa sabitle",+ "uk": "Закріпити в огляді",+ "ca": "Fixa al resum"+ },+ "CONVERSATION$UNPIN_OVERVIEW_SECTION": {+ "en": "Unpin from overview",+ "ja": "概要から固定解除",+ "zh-CN": "从概览取消固定",+ "zh-TW": "從概覽取消釘選",+ "ko-KR": "개요에서 고정 해제",+ "no": "Løsne fra oversikt",+ "ar": "إلغاء التثبيت من النظرة العامة",+ "de": "Von Übersicht lösen",+ "fr": "Détacher de l'aperçu",+ "it": "Rimuovi dalla panoramica",+ "pt": "Desafixar da visão geral",+ "es": "Desfijar del resumen",+ "tr": "Genel bakıştan ayır",+ "uk": "Відкріпити з огляду",+ "ca": "Deixa de fixar del resum"+ },+ "CONVERSATION$OVERVIEW_ADD_SECRET": {+ "en": "Add secret",+ "ja": "シークレットを追加",+ "zh-CN": "添加密钥",+ "zh-TW": "新增密鑰",+ "ko-KR": "비밀 추가",+ "no": "Legg til hemmelighet",+ "ar": "إضافة سر",+ "de": "Geheimnis hinzufügen",+ "fr": "Ajouter un secret",+ "it": "Aggiungi segreto",+ "pt": "Adicionar segredo",+ "es": "Añadir secreto",+ "tr": "Gizli bilgi ekle",+ "uk": "Додати секрет",+ "ca": "Afegeix secret"+ },+ "CONVERSATION$OVERVIEW_PULL_REQUESTS": {+ "en": "Pull Requests",+ "ja": "プルリクエスト",+ "zh-CN": "拉取请求",+ "zh-TW": "拉取請求",+ "ko-KR": "풀 리퀘스트",+ "no": "Pull-forespørsler",+ "ar": "طلبات السحب",+ "de": "Pull Requests",+ "fr": "Pull requests",+ "it": "Pull request",+ "pt": "Pull requests",+ "es": "Pull requests",+ "tr": "Pull request'ler",+ "uk": "Pull request'и",+ "ca": "Pull requests"+ },+ "CONVERSATION$OVERVIEW_ISSUES": {+ "en": "Issues",+ "ja": "Issue",+ "zh-CN": "议题",+ "zh-TW": "議題",+ "ko-KR": "이슈",+ "no": "Issues",+ "ar": "المشكلات",+ "de": "Issues",+ "fr": "Issues",+ "it": "Issue",+ "pt": "Issues",+ "es": "Issues",+ "tr": "Issue'lar",+ "uk": "Issues",+ "ca": "Issues"+ },+ "CONVERSATION$OVERVIEW_PULL_REQUESTS_EMPTY": {+ "en": "No open pull requests",+ "ja": "オープンなプルリクエストはありません",+ "zh-CN": "没有未关闭的拉取请求",+ "zh-TW": "沒有未關閉的拉取請求",+ "ko-KR": "열린 풀 리퀘스트가 없습니다",+ "no": "Ingen åpne pull-forespørsler",+ "ar": "لا توجد طلبات سحب مفتوحة",+ "de": "Keine offenen Pull Requests",+ "fr": "Aucune pull request ouverte",+ "it": "Nessuna pull request aperta",+ "pt": "Nenhuma pull request aberta",+ "es": "No hay pull requests abiertas",+ "tr": "Açık pull request yok",+ "uk": "Немає відкритих pull request'ів",+ "ca": "No hi ha pull requests obertes"+ },+ "CONVERSATION$OVERVIEW_ISSUES_EMPTY": {+ "en": "No open issues",+ "ja": "オープンな Issue はありません",+ "zh-CN": "没有未关闭的议题",+ "zh-TW": "沒有未關閉的議題",+ "ko-KR": "열린 이슈가 없습니다",+ "no": "Ingen åpne issues",+ "ar": "لا توجد مشكلات مفتوحة",+ "de": "Keine offenen Issues",+ "fr": "Aucune issue ouverte",+ "it": "Nessuna issue aperta",+ "pt": "Nenhuma issue aberta",+ "es": "No hay issues abiertas",+ "tr": "Açık issue yok",+ "uk": "Немає відкритих issues",+ "ca": "No hi ha issues obertes"+ },+ "CONVERSATION$OVERVIEW_GIT_UNAVAILABLE": {+ "en": "Connect a git repository to view pull requests and issues",+ "ja": "プルリクエストと Issue を表示するには Git リポジトリを接続してください",+ "zh-CN": "连接 Git 仓库以查看拉取请求和议题",+ "zh-TW": "連線 Git 存放庫以檢視拉取請求和議題",+ "ko-KR": "풀 리퀘스트와 이슈를 보려면 Git 저장소를 연결하세요",+ "no": "Koble til et git-repositorium for å se pull-forespørsler og issues",+ "ar": "اربط مستودع Git لعرض طلبات السحب والمشكلات",+ "de": "Verbinden Sie ein Git-Repository, um Pull Requests und Issues anzuzeigen",+ "fr": "Connectez un dépôt git pour voir les pull requests et les issues",+ "it": "Collega un repository git per vedere pull request e issue",+ "pt": "Conecte um repositório git para ver pull requests e issues",+ "es": "Conecta un repositorio git para ver pull requests e issues",+ "tr": "Pull request ve issue'ları görmek için bir git deposu bağlayın",+ "uk": "Підключіть git-репозиторій, щоб переглядати pull request'и та issues",+ "ca": "Connecteu un repositori git per veure pull requests i issues"+ },+ "CONVERSATION$OVERVIEW_GIT_ITEMS_ERROR": {+ "en": "Couldn't load items from the git provider. Check that the repository is public or that a provider token secret is configured.",+ "ja": "Git プロバイダーから項目を読み込めませんでした。リポジトリが公開されているか、プロバイダートークンのシークレットが設定されているか確認してください。",+ "zh-CN": "无法从 Git 提供方加载项目。请确认仓库为公开,或已配置提供方令牌密钥。",+ "zh-TW": "無法從 Git 提供者載入項目。請確認存放庫為公開,或已設定提供者權杖密鑰。",+ "ko-KR": "Git 제공자에서 항목을 불러오지 못했습니다. 저장소가 공개인지, 또는 제공자 토큰 시크릿이 설정되어 있는지 확인하세요.",+ "no": "Kunne ikke laste elementer fra git-leverandøren. Sjekk at repositoriet er offentlig eller at en leverandør-token-hemmelighet er konfigurert.",+ "ar": "تعذر تحميل العناصر من موفر Git. تحقق من أن المستودع عام أو أن سر رمز الموفر مُعد.",+ "de": "Elemente vom Git-Anbieter konnten nicht geladen werden. Prüfen Sie, ob das Repository öffentlich ist oder ein Anbieter-Token-Geheimnis konfiguriert ist.",+ "fr": "Impossible de charger les éléments depuis le fournisseur git. Vérifiez que le dépôt est public ou qu'un secret de jeton fournisseur est configuré.",+ "it": "Impossibile caricare gli elementi dal provider git. Verifica che il repository sia pubblico o che sia configurato un secret del token del provider.",+ "pt": "Não foi possível carregar itens do provedor git. Verifique se o repositório é público ou se um segredo de token do provedor está configurado.",+ "es": "No se pudieron cargar elementos del proveedor git. Comprueba que el repositorio sea público o que haya un secreto de token del proveedor configurado.",+ "tr": "Git sağlayıcısından öğeler yüklenemedi. Deponun herkese açık olduğunu veya bir sağlayıcı token gizli bilgisinin yapılandırıldığını kontrol edin.",+ "uk": "Не вдалося завантажити елементи від git-провайдера. Перевірте, що репозиторій публічний або налаштовано секрет токена провайдера.",+ "ca": "No s'han pogut carregar elements del proveïdor git. Comproveu que el repositori sigui públic o que hi hagi un secret de token del proveïdor configurat."+ },+ "CONVERSATION$OVERVIEW_VIEW_ON_PROVIDER": {+ "en": "View on {{provider}}",+ "ja": "{{provider}} で表示",+ "zh-CN": "在 {{provider}} 查看",+ "zh-TW": "在 {{provider}} 檢視",+ "ko-KR": "{{provider}}에서 보기",+ "no": "Vis på {{provider}}",+ "ar": "عرض على {{provider}}",+ "de": "Auf {{provider}} ansehen",+ "fr": "Voir sur {{provider}}",+ "it": "Visualizza su {{provider}}",+ "pt": "Ver no {{provider}}",+ "es": "Ver en {{provider}}",+ "tr": "{{provider}} üzerinde görüntüle",+ "uk": "Переглянути на {{provider}}",+ "ca": "Mostra a {{provider}}"+ },+ "CONVERSATION$OVERVIEW_SCOPE_FILTER": {+ "en": "Filter by project scope",+ "ja": "プロジェクト範囲で絞り込む",+ "zh-CN": "按项目范围筛选",+ "zh-TW": "依專案範圍篩選",+ "ko-KR": "프로젝트 범위로 필터",+ "no": "Filtrer etter prosjektomfang",+ "ar": "تصفية حسب نطاق المشروع",+ "de": "Nach Projektbereich filtern",+ "fr": "Filtrer par portée du projet",+ "it": "Filtra per ambito del progetto",+ "pt": "Filtrar por escopo do projeto",+ "es": "Filtrar por alcance del proyecto",+ "tr": "Proje kapsamına göre filtrele",+ "uk": "Фільтрувати за областю проєкту",+ "ca": "Filtra per abast del projecte"+ },+ "CONVERSATION$OVERVIEW_SCOPE_PROJECT": {+ "en": "This project",+ "ja": "このプロジェクト",+ "zh-CN": "此项目",+ "zh-TW": "此專案",+ "ko-KR": "이 프로젝트",+ "no": "Dette prosjektet",+ "ar": "هذا المشروع",+ "de": "Dieses Projekt",+ "fr": "Ce projet",+ "it": "Questo progetto",+ "pt": "Este projeto",+ "es": "Este proyecto",+ "tr": "Bu proje",+ "uk": "Цей проєкт",+ "ca": "Aquest projecte"+ },+ "CONVERSATION$OVERVIEW_SCOPE_ALL": {+ "en": "All",+ "ja": "すべて",+ "zh-CN": "全部",+ "zh-TW": "全部",+ "ko-KR": "전체",+ "no": "Alle",+ "ar": "الكل",+ "de": "Alle",+ "fr": "Tous",+ "it": "Tutti",+ "pt": "Todos",+ "es": "Todos",+ "tr": "Tümü",+ "uk": "Усі",+ "ca": "Tots"+ },+ "CONVERSATION$OVERVIEW_SCOPE_PROJECT_EMPTY_AUTOMATIONS": {+ "en": "No automations target this repository. Switch to All to see every automation.",+ "ja": "このリポジトリを対象とする自動化はありません。「すべて」に切り替えて全件を表示してください。",+ "zh-CN": "没有针对此仓库的自动化。切换到“全部”可查看所有自动化。",+ "zh-TW": "沒有以這個存放庫為目標的自動化。切換到「全部」可查看所有自動化。",+ "ko-KR": "이 저장소를 대상으로 하는 자동화가 없습니다. 전체를 보려면 전체로 전환하세요.",+ "no": "Ingen automatiseringer peker på dette repositoriet. Bytt til Alle for å se alle.",+ "ar": "لا توجد أتمتة تستهدف هذا المستودع. بدّل إلى الكل لعرض جميع الأتمتات.",+ "de": "Keine Automatisierungen zielen auf dieses Repository. Wechseln Sie zu Alle, um alle zu sehen.",+ "fr": "Aucune automatisation ne cible ce dépôt. Passez à Tous pour tout afficher.",+ "it": "Nessuna automazione punta a questo repository. Passa a Tutti per vederle tutte.",+ "pt": "Nenhuma automação aponta para este repositório. Mude para Todos para ver todas.",+ "es": "Ninguna automatización apunta a este repositorio. Cambia a Todos para verlas todas.",+ "tr": "Bu depoyu hedefleyen otomasyon yok. Tümünü görmek için Tümü'ne geçin.",+ "uk": "Немає автоматизацій для цього репозиторію. Перейдіть на Усі, щоб побачити всі.",+ "ca": "Cap automatització apunta a aquest repositori. Canvieu a Tots per veure-les totes."+ },+ "CONVERSATION$OVERVIEW_SCOPE_PROJECT_EMPTY_SKILLS": {+ "en": "No project skills found for this workspace. Switch to All to see personal and public skills.",+ "ja": "このワークスペースのプロジェクトスキルはありません。「すべて」に切り替えて個人・公開スキルを表示してください。",+ "zh-CN": "此工作区没有项目技能。切换到“全部”可查看个人与公共技能。",+ "zh-TW": "此工作區沒有專案技能。切換到「全部」可查看個人與公開技能。",+ "ko-KR": "이 워크스페이스에 프로젝트 스킬이 없습니다. 개인 및 공개 스킬을 보려면 전체로 전환하세요.",+ "no": "Ingen prosjektferdigheter funnet for dette arbeidsområdet. Bytt til Alle for å se personlige og offentlige ferdigheter.",+ "ar": "لا توجد مهارات مشروع لمساحة العمل هذه. بدّل إلى الكل لعرض المهارات الشخصية والعامة.",+ "de": "Keine Projekt-Skills für diesen Workspace. Wechseln Sie zu Alle, um persönliche und öffentliche Skills zu sehen.",+ "fr": "Aucune compétence projet pour cet espace de travail. Passez à Tous pour voir les compétences personnelles et publiques.",+ "it": "Nessuna skill di progetto per questo workspace. Passa a Tutti per vedere quelle personali e pubbliche.",+ "pt": "Nenhuma skill de projeto neste workspace. Mude para Todos para ver skills pessoais e públicas.",+ "es": "No hay skills de proyecto en este workspace. Cambia a Todos para ver las personales y públicas.",+ "tr": "Bu çalışma alanı için proje skill'i yok. Kişisel ve genel skill'leri görmek için Tümü'ne geçin.",+ "uk": "У цьому робочому просторі немає проєктних skills. Перейдіть на Усі, щоб побачити особисті та публічні.",+ "ca": "No hi ha skills de projecte en aquest espai de treball. Canvieu a Tots per veure les personals i públiques."+ },"SETUP$REPOSITORY_COUNT": {"en": "{{total}} repositories","ja": "{{total}} 個のリポジトリ",diff --git a/src/routes/changes-tab.tsx b/src/routes/changes-tab.tsxdeleted file mode 100644index 9e699f87e8..0000000000--- a/src/routes/changes-tab.tsx+++ /dev/null@@ -1,121 +0,0 @@-import { useTranslation } from "react-i18next";-import React from "react";-import { FileDiffViewer } from "#/components/features/diff-viewer/file-diff-viewer";-import { EmptyChangesMessage } from "#/components/features/diff-viewer/empty-changes-message";-import { DiffDrawerIcon } from "#/components/features/diff-viewer/diff-drawer-icon";-import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";-import { useUnifiedGetGitChanges } from "#/hooks/query/use-unified-get-git-changes";-import { I18nKey } from "#/i18n/declaration";-import { RUNTIME_INACTIVE_STATES } from "#/types/agent-state";-import { RandomTip } from "#/components/features/tips/random-tip";-import { useAgentState } from "#/hooks/use-agent-state";-import { RuntimeWaitingState } from "#/components/features/conversation-panel/runtime-waiting-state";-import { ConversationTabEmptyState } from "#/components/features/conversation/conversation-tab-empty-state";--// Error message patterns-const GIT_REPO_ERROR_PATTERN = /not a git repository/i;--const RUNTIME_STATUS_KEYS = new Set<I18nKey>([- I18nKey.DIFF_VIEWER$WAITING_FOR_RUNTIME,- I18nKey.DIFF_VIEWER$LOADING,-]);--function ChangesTabStatus({ messages }: { messages: string[] }) {- const { t } = useTranslation("openhands");-- if (- messages.length === 1 &&- RUNTIME_STATUS_KEYS.has(messages[0] as I18nKey)- ) {- return (- <RuntimeWaitingState- testId="changes-tab-status"- messageKey={messages[0] as I18nKey}- />- );- }-- return (- <ConversationTabEmptyState icon={<DiffDrawerIcon />}>- {messages.map((msg) => (- <span key={msg} className="block">- {t(msg)}- </span>- ))}- </ConversationTabEmptyState>- );-}--function GitChanges() {- const {- data: gitChanges,- isSuccess,- isError,- error,- isLoading: loadingGitChanges,- } = useUnifiedGetGitChanges();-- const [statusMessage, setStatusMessage] = React.useState<string[] | null>(- null,- );-- const { curAgentState } = useAgentState();- const runtimeIsActive = !RUNTIME_INACTIVE_STATES.includes(curAgentState);-- const isNotGitRepoError =- error && GIT_REPO_ERROR_PATTERN.test(retrieveAxiosErrorMessage(error));-- React.useEffect(() => {- if (!runtimeIsActive) {- setStatusMessage([I18nKey.DIFF_VIEWER$WAITING_FOR_RUNTIME]);- } else if (error) {- const errorMessage = retrieveAxiosErrorMessage(error);- if (GIT_REPO_ERROR_PATTERN.test(errorMessage)) {- setStatusMessage([- I18nKey.DIFF_VIEWER$NOT_A_GIT_REPO,- I18nKey.DIFF_VIEWER$ASK_OH,- ]);- } else {- setStatusMessage([errorMessage]);- }- } else if (loadingGitChanges) {- setStatusMessage([I18nKey.DIFF_VIEWER$LOADING]);- } else {- setStatusMessage(null);- }- }, [- runtimeIsActive,- isNotGitRepoError,- loadingGitChanges,- error,- setStatusMessage,- ]);-- return (- <main className="h-full w-full flex flex-col items-stretch">- {!isSuccess || !gitChanges.length ? (- <div className="flex flex-col h-full w-full">- <div className="flex-1 flex items-center justify-center">- {statusMessage && <ChangesTabStatus messages={statusMessage} />}- {!statusMessage && isSuccess && gitChanges.length === 0 && (- <EmptyChangesMessage />- )}- </div>- {!isError && isSuccess && gitChanges.length === 0 && <RandomTip />}- </div>- ) : (- <div className="h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always">- {gitChanges.slice(0, 100).map((change) => (- <FileDiffViewer- key={change.path}- path={change.path}- type={change.status}- />- ))}- </div>- )}- </main>- );-}--export default GitChanges;diff --git a/src/routes/commits-tab.tsx b/src/routes/commits-tab.tsxindex a998ee81d8..9cbdf29be0 100644--- a/src/routes/commits-tab.tsx+++ b/src/routes/commits-tab.tsx@@ -1,13 +1,16 @@+import { useCallback } from "react";import { useTranslation } from "react-i18next";import { CommitList } from "#/components/features/diff-viewer/commit-list";import { DiffDrawerIcon } from "#/components/features/diff-viewer/diff-drawer-icon";import { useUnifiedGitCommits } from "#/hooks/query/use-unified-git-commits";+import { useUnifiedGetGitChanges } from "#/hooks/query/use-unified-get-git-changes";import { useConversationId } from "#/hooks/use-conversation-id";import { I18nKey } from "#/i18n/declaration";import { RUNTIME_INACTIVE_STATES } from "#/types/agent-state";import { useAgentState } from "#/hooks/use-agent-state";import { RuntimeWaitingState } from "#/components/features/conversation-panel/runtime-waiting-state";import { ConversationTabEmptyState } from "#/components/features/conversation/conversation-tab-empty-state";+import { useConversationStore } from "#/stores/conversation-store";/*** The Files tab's "Commits" view: the workspace's recent commit history@@ -20,11 +23,30 @@ function GitCommits() {const { conversationId } = useConversationId();const { commits, hasMore, isUnsupported, isLoading, isSuccess } =useUnifiedGitCommits();+ const {+ data: uncommittedChanges,+ isSuccess: uncommittedSuccess,+ isLoading: uncommittedLoading,+ } = useUnifiedGetGitChanges();+ const commitsAutoExpandSection = useConversationStore(+ (state) => state.commitsAutoExpandSection,+ );+ const setCommitsAutoExpandSection = useConversationStore(+ (state) => state.setCommitsAutoExpandSection,+ );+ const handleAutoExpandHandled = useCallback(+ () => setCommitsAutoExpandSection(null),+ [setCommitsAutoExpandSection],+ );const { curAgentState } = useAgentState();const runtimeIsActive = !RUNTIME_INACTIVE_STATES.includes(curAgentState);- const showList = isSuccess && !isUnsupported && commits.length > 0;+ const hasCommits = isSuccess && !isUnsupported && commits.length > 0;+ const hasUncommitted =+ uncommittedSuccess && (uncommittedChanges?.length ?? 0) > 0;+ const showList = hasCommits || hasUncommitted;+ const isListLoading = isLoading || (runtimeIsActive && uncommittedLoading);return (<main className="h-full w-full flex flex-col items-stretch">@@ -34,8 +56,13 @@ function GitCommits() {expanded commit. */}<CommitListkey={conversationId}- commits={commits}- hasMore={hasMore}+ commits={hasCommits ? commits : []}+ hasMore={hasCommits ? hasMore : false}+ uncommittedChanges={+ uncommittedSuccess ? (uncommittedChanges ?? []).slice(0, 100) : []+ }+ autoExpandUncommitted={commitsAutoExpandSection === "uncommitted"}+ onAutoExpandHandled={handleAutoExpandHandled}/></div>) : (@@ -46,13 +73,13 @@ function GitCommits() {messageKey={I18nKey.DIFF_VIEWER$WAITING_FOR_RUNTIME}/>)}- {runtimeIsActive && isLoading && (+ {runtimeIsActive && isListLoading && (<RuntimeWaitingStatetestId="commits-tab-status"messageKey={I18nKey.DIFF_VIEWER$LOADING}/>)}- {runtimeIsActive && !isLoading && (+ {runtimeIsActive && !isListLoading && (<ConversationTabEmptyState icon={<DiffDrawerIcon />}>{t(I18nKey.DIFF_VIEWER$NO_COMMITS)}</ConversationTabEmptyState>diff --git a/src/routes/conversation.tsx b/src/routes/conversation.tsxindex 692e68449d..95bbc65fd2 100644--- a/src/routes/conversation.tsx+++ b/src/routes/conversation.tsx@@ -23,6 +23,7 @@ import { displayErrorToast } from "#/utils/custom-toast-handlers";import { useIsAuthed } from "#/hooks/query/use-is-authed";import { ConversationMain } from "#/components/features/conversation/conversation-main/conversation-main";import { ConversationMobilePanelPage } from "#/components/features/conversation/conversation-main/conversation-mobile-panel-page";+import { ConversationOverviewDrawerProvider } from "#/components/features/conversation/conversation-overview-drawer-context";import { WebSocketProviderWrapper } from "#/contexts/websocket-provider-wrapper";import { useErrorMessageStore } from "#/stores/error-message-store";@@ -192,15 +193,19 @@ function AppContent() {const content = (<EventHandler>- <div data-testid="app-route" className="flex h-full flex-col">- {panelViewMatch ? (- <ConversationMobilePanelPage- onNavigateBack={() => navigate(`/conversations/${conversationId}`)}- />- ) : (- <ConversationMain />- )}- </div>+ <ConversationOverviewDrawerProvider>+ <div data-testid="app-route" className="flex h-full flex-col">+ {panelViewMatch ? (+ <ConversationMobilePanelPage+ onNavigateBack={() =>+ navigate(`/conversations/${conversationId}`)+ }+ />+ ) : (+ <ConversationMain />+ )}+ </div>+ </ConversationOverviewDrawerProvider></EventHandler>);diff --git a/src/routes/files-tab.tsx b/src/routes/files-tab.tsxindex 845ee7b4e7..34b3371eca 100644--- a/src/routes/files-tab.tsx+++ b/src/routes/files-tab.tsx@@ -1,4 +1,4 @@-import { useCallback, useEffect, useMemo, useState } from "react";+import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { useQueryClient } from "@tanstack/react-query";@@ -7,84 +7,74 @@ import { I18nKey } from "#/i18n/declaration";import { useFilesTabStore } from "#/stores/files-tab-store";import { useWorkspaceFiles } from "#/hooks/query/use-workspace-files";import { useWorkspaceFileContent } from "#/hooks/query/use-workspace-file-content";-import { useHasAttachedSource } from "#/hooks/use-has-attached-source";-import { useHasGitCommits } from "#/hooks/query/use-has-git-commits";import { useAutoRefreshFilesOnEdit } from "#/hooks/use-auto-refresh-files-on-edit";-import { useUnifiedGetGitChanges } from "#/hooks/query/use-unified-get-git-changes";import { useOptionalConversationId } from "#/hooks/use-conversation-id";-import { useConversationLocalStorageState } from "#/utils/conversation-local-storage";+import { useResizableDrawerWidth } from "#/hooks/use-resizable-drawer-width";+import {+ getConversationState,+ useConversationLocalStorageState,+} from "#/utils/conversation-local-storage";import {useWorkspaceMutationCounter,withWorkspaceCacheBuster,} from "#/stores/use-workspace-mutation-counter";-import { sortFilesByPriority } from "#/utils/file-priority";import { FileQuickRow } from "#/components/features/files-tab/file-quick-row";import { FileTreeView } from "#/components/features/files-tab/file-tree-view";import { FileContentViewer } from "#/components/features/files-tab/file-content-viewer";import { SegmentedToggle } from "#/components/features/files-tab/segmented-toggle";import { WorkspacePath } from "#/components/features/files-tab/workspace-path";import type { ViewMode } from "#/components/features/files-tab/view-mode";+import {+ FILES_TAB_TREE_DEFAULT_WIDTH_PX,+ FILES_TAB_TREE_MAX_WIDTH_PX,+ FILES_TAB_TREE_MIN_WIDTH_PX,+ FILES_TAB_TREE_RESIZE_HANDLE_TEST_ID,+ FILES_TAB_TREE_WIDTH_STORAGE_KEY,+} from "#/components/features/files-tab/files-tab-tree.constants";+import { ResizeHandle } from "#/components/ui/resize-handle";import RefreshIcon from "#/icons/u-refresh.svg?react";import LinkExternalIcon from "#/icons/link-external.svg?react";import { useActiveConversation } from "#/hooks/query/use-active-conversation";-import { useUnifiedGitCommits } from "#/hooks/query/use-unified-git-commits";-import GitChanges from "./changes-tab";-import GitCommits from "./commits-tab";+/**+ * Workspace file browser. Diff/Commits live in the sibling Commits+ * conversation tab — this surface is only the file tree / content viewer.+ */function FilesTab() {const { t } = useTranslation("openhands");- // Keep the list / content / diff caches fresh as the agent writes files.+ // Keep the list / content caches fresh as the agent writes files.useAutoRefreshFilesOnEdit();const { data: activeConversation } = useActiveConversation();const workspacePath = activeConversation?.workspace?.working_dir;- const { hasAttachedSource, isLoading: isAttachedSourceLoading } =- useHasAttachedSource();- // A workspace with zero commits has no diff base to compare against, so- // the diff view would just be empty / misleading. Only probe when we- // already believe the user attached a source — saves a workspace round- // trip on every plain (no-attachment) conversation.- const { hasCommits } = useHasGitCommits({ enabled: hasAttachedSource });-- // Diff view defaults to ON when the user attached a source (repo or- // local workspace) *and* there's at least one commit, OFF otherwise- // (no attachment, or attachment with no commits yet).- //- // While the attachment / commit probes are still resolving we stay- // optimistic — most attached conversations live in a real repo, so- // defaulting to diff during the brief loading window avoids a- // "files → diff" flash on initial load. We only flip to files-view- // once `hasAttachedSource` *or* `hasCommits` definitively resolves- // false. The user's persisted choice always wins.const { conversationId } = useOptionalConversationId();const {state: persistedState,- setFilesTabDiffView,setFilesTabContentViewMode,+ setFilesTabTreeVisible,} = useConversationLocalStorageState(conversationId ?? "");-- const diffViewDefault =- (hasAttachedSource || isAttachedSourceLoading) && hasCommits !== false;- const diffViewEnabled = persistedState.filesTabDiffView ?? diffViewDefault;const contentViewMode = persistedState.filesTabContentViewMode;+ const isTreeVisible = persistedState.filesTabTreeVisible ?? true;+ const toggleTreeVisible = useCallback(() => {+ setFilesTabTreeVisible?.(!isTreeVisible);+ }, [isTreeVisible, setFilesTabTreeVisible]);- // Commit history gets a third toggle segment, offered only when the- // agent server supports the commits API (older servers 404 → the toggle- // stays two-way and the tab looks exactly as it did before). The- // selection is session-local; the persisted diff/files preference is- // untouched so falling out of the commits view restores it.- const { isSuccess: commitsIsSuccess, isUnsupported: commitsUnsupported } =- useUnifiedGitCommits();- const showCommitsOption = commitsIsSuccess && !commitsUnsupported;- const [commitsViewSelected, setCommitsViewSelected] = useState(false);- let activeView: "on" | "off" | "commits" = diffViewEnabled ? "on" : "off";- if (commitsViewSelected && showCommitsOption) activeView = "commits";-- // Collapsed by default — the quick-access pill row at the top is usually- // enough; the user can expand the tree on demand.- const [isTreeVisible, setIsTreeVisible] = useState(false);+ const treeLayoutRef = useRef<HTMLDivElement>(null);+ const {+ drawerWidth: treeWidth,+ isDragging: isTreeResizing,+ handleMouseDown: handleTreeResizeMouseDown,+ } = useResizableDrawerWidth({+ containerRef: treeLayoutRef,+ defaultWidth: FILES_TAB_TREE_DEFAULT_WIDTH_PX,+ minWidth: FILES_TAB_TREE_MIN_WIDTH_PX,+ maxWidth: FILES_TAB_TREE_MAX_WIDTH_PX,+ storageKey: FILES_TAB_TREE_WIDTH_STORAGE_KEY,+ enabled: isTreeVisible,+ edge: "left",+ });const filesQuery = useWorkspaceFiles();const paths = useMemo(() => filesQuery.data ?? [], [filesQuery.data]);@@ -93,17 +83,23 @@ function FilesTab() {const selectedConversationId = useFilesTabStore((s) => s.selectedConversationId,);+ const openPaths = useFilesTabStore((s) => s.openPaths);const setSelectedPath = useFilesTabStore((s) => s.setSelectedPath);+ const closeOpenPath = useFilesTabStore((s) => s.closeOpenPath);+ const hydrateForConversation = useFilesTabStore(+ (s) => s.hydrateForConversation,+ );// A selection is scoped to the conversation it was made in. Ignore a path// that belongs to a different conversation so we never try to open a file// that only exists in the previous conversation's workspace (issue #1350).- // The auto-select effect below then picks this conversation's top file.const selectedPath =selectedConversationId === conversationId ? storedSelectedPath : null;+ const conversationOpenPaths =+ selectedConversationId === conversationId ? openPaths : [];// Tag every selection with the active conversation so it can't leak into- // the next one. FileQuickRow / FileTreeView call this with just the path.+ // the next one. Opening a path also appends it to the tab strip.const handleSelectFile = useCallback((path: string) => setSelectedPath(path, conversationId),[conversationId, setSelectedPath],@@ -120,172 +116,138 @@ function FilesTab() {mutationCounter,);+ // Restore open tabs / selection from conversation-scoped localStorage on+ // mount and when switching conversations (survives a full page refresh).+ // Read localStorage directly — the React hook mirror can briefly hold the+ // previous conversation's state until its sync effect runs.useEffect(() => {+ if (!conversationId) return;if (selectedConversationId === conversationId) return;- setSelectedPath(null, conversationId);- }, [selectedConversationId, conversationId, setSelectedPath]);+ const persisted = getConversationState(conversationId);+ hydrateForConversation(+ conversationId,+ persisted.filesTabOpenPaths ?? [],+ persisted.filesTabSelectedPath ?? null,+ );+ }, [conversationId, selectedConversationId, hydrateForConversation]);- // Auto-select the highest-priority file the first time we load the list,- // so users see something useful immediately.- useEffect(() => {- if (selectedPath || paths.length === 0) return;- const [first] = sortFilesByPriority(paths);- if (first) setSelectedPath(first, conversationId);- }, [paths, selectedPath, conversationId, setSelectedPath]);-- // Refresh button: covers the diff view (git changes) and the file viewer- // (workspace listing + cached file contents). Lives in this toolbar — not- // in the outer ConversationTabs bar — so it sits with the other- // files-tab-local controls.const queryClient = useQueryClient();- const { refetch: refetchGitChanges, isFetching: isFetchingGitChanges } =- useUnifiedGetGitChanges();- const refreshFiles = () => {- refetchGitChanges();- queryClient.invalidateQueries({ queryKey: ["workspace-files"] });- queryClient.invalidateQueries({ queryKey: ["workspace-file-content"] });- queryClient.invalidateQueries({ queryKey: ["git_commits"] });+ const [isRefreshing, setIsRefreshing] = useState(false);+ const refreshFiles = async () => {+ setIsRefreshing(true);+ try {+ await Promise.all([+ queryClient.invalidateQueries({ queryKey: ["workspace-files"] }),+ queryClient.invalidateQueries({ queryKey: ["workspace-file-content"] }),+ ]);+ } finally {+ setIsRefreshing(false);+ }};+ const quickRowActions = (+ <button+ type="button"+ onClick={refreshFiles}+ disabled={isRefreshing}+ aria-label={t(I18nKey.FILES$REFRESH)}+ title={t(I18nKey.FILES$REFRESH)}+ data-testid="files-tab-refresh"+ className="flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"+ >+ <RefreshIcon+ width={12.75}+ height={15}+ color="#ffffff"+ className={isRefreshing ? "animate-spin" : ""}+ />+ </button>+ );+return (<mainclassName="h-full w-full flex flex-col items-stretch"data-testid="files-tab">- {/* Top toolbar: diff/files + rich/plain toggles (left-aligned) plus- the refresh button on the right. */}- <div className="flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]">- <SegmentedToggle<"on" | "off" | "commits">- ariaLabel={t(I18nKey.FILES$DIFF_VIEW)}- testId="files-tab-diff-toggle"- value={activeView}- options={[- { value: "on", label: t(I18nKey.FILES$DIFF_VIEW) },- ...(showCommitsOption- ? [- {- value: "commits" as const,- label: t(I18nKey.DIFF_VIEWER$COMMITS),- },- ]- : []),- { value: "off", label: t(I18nKey.COMMON$FILES) },- ]}- onChange={(value) => {- if (value === "commits") {- setCommitsViewSelected(true);- } else {- setCommitsViewSelected(false);- setFilesTabDiffView(value === "on");- }- }}- />-- {activeView === "off" && (- <SegmentedToggle<ViewMode>- ariaLabel={t(I18nKey.FILES$RICH)}- testId="files-tab-content-mode-toggle"- value={contentViewMode}- options={[- { value: "rich", label: t(I18nKey.FILES$RICH) },- { value: "plain", label: t(I18nKey.FILES$PLAIN) },- ]}- onChange={setFilesTabContentViewMode}- />- )}-- <div className="ml-auto flex items-center gap-1">- {/* Open the currently-selected file in a new browser tab. Only- meaningful while we're showing a file (not the diff view) and- we've resolved its staticUrl from the workspace fileserver. */}- {activeView === "off" && selectedFileStaticUrl && (- <a- href={selectedFileStaticUrl}- target="_blank"- rel="noopener noreferrer"- aria-label={t(I18nKey.FILES$OPEN_IN_NEW_WINDOW)}- title={t(I18nKey.FILES$OPEN_IN_NEW_WINDOW)}- data-testid="files-tab-open-in-new-window"- className="flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white"- >- <LinkExternalIcon width={14} height={14} />- </a>- )}- <button- type="button"- onClick={refreshFiles}- disabled={isFetchingGitChanges}- aria-label={t(I18nKey.FILES$REFRESH)}- title={t(I18nKey.FILES$REFRESH)}- data-testid="files-tab-refresh"- className="flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"- >- <RefreshIcon- width={12.75}- height={15}- color="#ffffff"- className={isFetchingGitChanges ? "animate-spin" : ""}- />- </button>- </div>- </div>-- {activeView === "on" && (- <div className="flex-1 min-h-0">- <GitChanges />- </div>- )}- {activeView === "commits" && (- <div className="flex-1 min-h-0">- <GitCommits />+ <WorkspacePath path={workspacePath} />+ {filesQuery.isLoading ? (+ <div className="flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]">+ {t(I18nKey.FILES$LOADING_FILES)}</div>- )}- {activeView === "off" && (- <div className="flex flex-1 flex-col min-h-0">- <WorkspacePath path={workspacePath} />- {filesQuery.isLoading ? (- <div className="flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]">- {t(I18nKey.FILES$LOADING_FILES)}- </div>- ) : (- <>- <FileQuickRow- paths={paths}- selectedPath={selectedPath}- onSelectFile={handleSelectFile}- isTreeVisible={isTreeVisible}- onToggleTree={() => setIsTreeVisible((prev) => !prev)}- />- <div className="flex h-full min-h-0 flex-1">- {isTreeVisible && (- <aside- className="w-56 shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always"- data-testid="files-tab-tree"- >- <FileTreeView- paths={paths}- selectedPath={selectedPath}- onSelectFile={handleSelectFile}- />- </aside>- )}- <section- className="flex h-full min-h-0 min-w-0 flex-1 flex-col"- data-testid="files-tab-content"+ ) : (+ <>+ <FileQuickRow+ openPaths={conversationOpenPaths}+ selectedPath={selectedPath}+ onSelectFile={handleSelectFile}+ onCloseFile={closeOpenPath}+ isTreeVisible={isTreeVisible}+ onToggleTree={toggleTreeVisible}+ actions={quickRowActions}+ />+ <div ref={treeLayoutRef} className="flex h-full min-h-0 flex-1">+ {isTreeVisible && (+ <>+ <aside+ className="shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always"+ data-testid="files-tab-tree"+ style={{ width: `${treeWidth}px` }}>- {selectedPath ? (- <FileContentViewer- path={selectedPath}- viewMode={contentViewMode}+ <FileTreeView+ paths={paths}+ selectedPath={selectedPath}+ onSelectFile={handleSelectFile}+ />+ </aside>+ <ResizeHandle+ testId={FILES_TAB_TREE_RESIZE_HANDLE_TEST_ID}+ onMouseDown={handleTreeResizeMouseDown}+ isDragging={isTreeResizing}+ />+ </>+ )}+ <section+ className="flex h-full min-h-0 min-w-0 flex-1 flex-col"+ data-testid="files-tab-content"+ >+ {selectedPath ? (+ <>+ <div className="flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]">+ <SegmentedToggle<ViewMode>+ ariaLabel={t(I18nKey.FILES$RICH)}+ testId="files-tab-content-mode-toggle"+ value={contentViewMode}+ options={[+ { value: "rich", label: t(I18nKey.FILES$RICH) },+ { value: "plain", label: t(I18nKey.FILES$PLAIN) },+ ]}+ onChange={setFilesTabContentViewMode}/>- ) : (- <NoFileSelectedMessage />- )}- </section>- </div>- </>- )}- </div>+ {selectedFileStaticUrl ? (+ <a+ href={selectedFileStaticUrl}+ target="_blank"+ rel="noopener noreferrer"+ aria-label={t(I18nKey.FILES$OPEN_IN_NEW_WINDOW)}+ title={t(I18nKey.FILES$OPEN_IN_NEW_WINDOW)}+ data-testid="files-tab-open-in-new-window"+ className="ml-auto flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white"+ >+ <LinkExternalIcon width={14} height={14} />+ </a>+ ) : null}+ </div>+ <FileContentViewer+ path={selectedPath}+ viewMode={contentViewMode}+ />+ </>+ ) : (+ <NoFileSelectedMessage />+ )}+ </section>+ </div>+ </>)}</main>);diff --git a/src/stores/conversation-store.ts b/src/stores/conversation-store.tsindex 09e0ecd58c..91967e42e4 100644--- a/src/stores/conversation-store.ts+++ b/src/stores/conversation-store.ts@@ -7,6 +7,7 @@ import {export type ConversationTab =| "files"+ | "commits"| "browser"| "terminal"| "planner"@@ -15,6 +16,8 @@ export type ConversationTab =export type ConversationMode = "code" | "plan";+export type CommitsPaneSection = "uncommitted";+export interface IMessageToSend {text: string;timestamp: number;@@ -22,7 +25,10 @@ export interface IMessageToSend {interface ConversationState {isRightPanelShown: boolean;+ isOverviewPanelShown: boolean;+ isOverviewPanelPeeked: boolean;selectedTab: ConversationTab | null;+ commitsAutoExpandSection: CommitsPaneSection | null;images: File[];files: File[];/** Image file names (e.g. pasted screenshots) to send via file upload instead of vision embed. */@@ -45,7 +51,12 @@ interface ConversationState {interface ConversationActions {setIsRightPanelShown: (isRightPanelShown: boolean) => void;+ setIsOverviewPanelShown: (isOverviewPanelShown: boolean) => void;+ setIsOverviewPanelPeeked: (isOverviewPanelPeeked: boolean) => void;setSelectedTab: (selectedTab: ConversationTab | null) => void;+ setCommitsAutoExpandSection: (+ commitsAutoExpandSection: CommitsPaneSection | null,+ ) => void;setShouldShownAgentLoading: (shouldShownAgentLoading: boolean) => void;setShouldHideSuggestions: (shouldHideSuggestions: boolean) => void;addImages: (images: File[]) => void;@@ -114,7 +125,10 @@ export const useConversationStore = create<ConversationStore>()(// when they come back to the app and only want the panel back when// they themselves opened it during the current session.isRightPanelShown: false,+ isOverviewPanelShown: false,+ isOverviewPanelPeeked: false,selectedTab: "files" as ConversationTab,+ commitsAutoExpandSection: null,images: [],files: [],imagesMarkedUploadAsFile: [],@@ -135,9 +149,22 @@ export const useConversationStore = create<ConversationStore>()(setIsRightPanelShown: (isRightPanelShown) =>set({ isRightPanelShown }, false, "setIsRightPanelShown"),+ setIsOverviewPanelShown: (isOverviewPanelShown) =>+ set(+ { isOverviewPanelShown, isOverviewPanelPeeked: false },+ false,+ "setIsOverviewPanelShown",+ ),++ setIsOverviewPanelPeeked: (isOverviewPanelPeeked) =>+ set({ isOverviewPanelPeeked }, false, "setIsOverviewPanelPeeked"),+setSelectedTab: (selectedTab) =>set({ selectedTab }, false, "setSelectedTab"),+ setCommitsAutoExpandSection: (commitsAutoExpandSection) =>+ set({ commitsAutoExpandSection }, false, "setCommitsAutoExpandSection"),+setShouldShownAgentLoading: (shouldShownAgentLoading) =>set({ shouldShownAgentLoading }, false, "setShouldShownAgentLoading"),diff --git a/src/stores/files-tab-store.ts b/src/stores/files-tab-store.tsindex 55cb1383e0..b4472e8632 100644--- a/src/stores/files-tab-store.ts+++ b/src/stores/files-tab-store.ts@@ -1,4 +1,5 @@import { create } from "zustand";+import { setConversationState } from "#/utils/conversation-local-storage";interface FilesTabState {selectedPath: string | null;@@ -8,10 +9,70 @@ interface FilesTabState {// tagged with its conversation and the files tab ignores a path owned by a// different conversation.selectedConversationId: string | null;+ /**+ * Ordered list of files the user or agent has opened in the current+ * conversation. The quick-row tab strip renders only these paths.+ */+ openPaths: string[];setSelectedPath: (path: string | null,conversationId?: string | null,) => void;+ /** Remove a path from the open-tab strip; selects a neighbor when needed. */+ closeOpenPath: (path: string) => void;+ /**+ * Replace in-memory open-tab state for a conversation (used when mounting+ * / switching conversations so a refresh can restore localStorage).+ * Does not write back to localStorage.+ */+ hydrateForConversation: (+ conversationId: string,+ openPaths: string[],+ selectedPath: string | null,+ ) => void;+}++function withOpenedPath(+ openPaths: string[],+ path: string,+ sameConversation: boolean,+): string[] {+ if (!sameConversation) return [path];+ if (openPaths.includes(path)) return openPaths;+ return [...openPaths, path];+}++function selectNeighborAfterClose(+ openPaths: string[],+ closedPath: string,+ selectedPath: string | null,+): string | null {+ if (selectedPath !== closedPath) return selectedPath;+ const closedIndex = openPaths.indexOf(closedPath);+ const remaining = openPaths.filter((path) => path !== closedPath);+ if (remaining.length === 0) return null;+ // Prefer the tab that slides into the closed slot (right neighbor), else left.+ return remaining[Math.min(closedIndex, remaining.length - 1)] ?? null;+}++function resolveSelectedPath(+ openPaths: string[],+ selectedPath: string | null,+): string | null {+ if (selectedPath && openPaths.includes(selectedPath)) return selectedPath;+ return null;+}++function persistOpenState(+ conversationId: string | null | undefined,+ openPaths: string[],+ selectedPath: string | null,+) {+ if (!conversationId) return;+ setConversationState(conversationId, {+ filesTabOpenPaths: openPaths,+ filesTabSelectedPath: selectedPath,+ });}// Hoisted out of files-tab.tsx local state so non-React callers (e.g. the@@ -19,6 +80,61 @@ interface FilesTabState {export const useFilesTabStore = create<FilesTabState>((set) => ({selectedPath: null,selectedConversationId: null,+ openPaths: [],setSelectedPath: (selectedPath, conversationId = null) =>- set({ selectedPath, selectedConversationId: conversationId }),+ set((state) => {+ if (selectedPath === null) {+ const switchedConversation =+ conversationId !== state.selectedConversationId;+ const next = {+ selectedPath: null as string | null,+ selectedConversationId: conversationId,+ // Drop open tabs when the active conversation changes so paths+ // from conversation A never appear as tabs in conversation B.+ // Callers that switch conversations should prefer+ // `hydrateForConversation` so persisted tabs can be restored.+ openPaths: switchedConversation ? [] : state.openPaths,+ };+ persistOpenState(conversationId, next.openPaths, next.selectedPath);+ return next;+ }++ const sameConversation = state.selectedConversationId === conversationId;+ const next = {+ selectedPath,+ selectedConversationId: conversationId,+ openPaths: withOpenedPath(+ state.openPaths,+ selectedPath,+ sameConversation,+ ),+ };+ persistOpenState(conversationId, next.openPaths, next.selectedPath);+ return next;+ }),+ closeOpenPath: (path) =>+ set((state) => {+ if (!state.openPaths.includes(path)) return state;+ const selectedPath = selectNeighborAfterClose(+ state.openPaths,+ path,+ state.selectedPath,+ );+ const next = {+ openPaths: state.openPaths.filter((openPath) => openPath !== path),+ selectedPath,+ };+ persistOpenState(+ state.selectedConversationId,+ next.openPaths,+ next.selectedPath,+ );+ return next;+ }),+ hydrateForConversation: (conversationId, openPaths, selectedPath) =>+ set({+ selectedConversationId: conversationId,+ openPaths,+ selectedPath: resolveSelectedPath(openPaths, selectedPath),+ }),}));diff --git a/src/utils/conversation-local-storage.ts b/src/utils/conversation-local-storage.tsindex 5697666aeb..379e12cc9c 100644--- a/src/utils/conversation-local-storage.ts+++ b/src/utils/conversation-local-storage.ts@@ -4,6 +4,12 @@ import type {ConversationMode,} from "#/stores/conversation-store";import type { ViewMode } from "#/components/features/files-tab/view-mode";+import {+ DEFAULT_UNPINNED_OVERVIEW_GIT_PARTS,+ DEFAULT_UNPINNED_OVERVIEW_SECTIONS,+ VALID_CONVERSATION_OVERVIEW_GIT_PARTS,+ VALID_CONVERSATION_OVERVIEW_SECTIONS,+} from "#/components/features/conversation/conversation-overview-sections";export const LOCAL_STORAGE_KEYS = {CONVERSATION_STATE: "conversation-state",@@ -31,32 +37,47 @@ type ConversationStateUpdatedDetail = {export interface ConversationState {selectedTab: ConversationTab | null;unpinnedTabs: string[];+ unpinnedOverviewSections?: string[];+ unpinnedOverviewGitParts?: string[];conversationMode: ConversationMode;subConversationTaskId: string | null;draftMessage: string | null;+ rightPanelShown?: boolean;/**- * User's persisted choice for the Files tab diff-vs-files toggle.- * `null` means "no explicit choice yet" — the Files tab then falls back- * to its repo-aware default (diff inside a git repo with commits, files- * otherwise).+ * Legacy Files-tab Diff/Files toggle preference. Kept for blob+ * compatibility; the Files surface no longer hosts Diff/Commits+ * (those live in the sibling Commits conversation tab).*/filesTabDiffView: boolean | null;/** User's persisted choice for the Files tab Rich/Plain content toggle. */filesTabContentViewMode: ViewMode;+ /** Whether the left-hand file tree is visible in the Files tab. */+ filesTabTreeVisible?: boolean;+ /** Open file tabs in the Files quick-row (basenames, closable). */+ filesTabOpenPaths?: string[];+ /** Currently selected path among `filesTabOpenPaths`, if any. */+ filesTabSelectedPath?: string | null;}const DEFAULT_CONVERSATION_STATE: ConversationState = {selectedTab: "files",unpinnedTabs: [],+ unpinnedOverviewSections: [...DEFAULT_UNPINNED_OVERVIEW_SECTIONS],+ unpinnedOverviewGitParts: [...DEFAULT_UNPINNED_OVERVIEW_GIT_PARTS],conversationMode: "code",subConversationTaskId: null,draftMessage: null,+ rightPanelShown: false,filesTabDiffView: null,filesTabContentViewMode: "rich",+ filesTabTreeVisible: true,+ filesTabOpenPaths: [],+ filesTabSelectedPath: null,};const VALID_CONVERSATION_TABS: ReadonlySet<ConversationTab> = new Set(["files",+ "commits","browser","terminal","planner",@@ -76,7 +97,6 @@ const VALID_CONVERSATION_TABS: ReadonlySet<ConversationTab> = new Set([const REMOVED_CONVERSATION_TABS: ReadonlySet<string> = new Set(["editor","served",- "changes","app","vscode",]);@@ -86,33 +106,50 @@ const VALID_VIEW_MODES: ReadonlySet<ViewMode> = new Set(["rich", "plain"]);function sanitizeStoredState(stored: Record<string, unknown>,): Partial<ConversationState> {- // `rightPanelShown` is no longer part of the schema (the drawer's- // open state is session-only) but old persisted blobs still carry it.- // We just drop it on the way in — keeping it in `result` here would- // pollute the merged `ConversationState` shape that consumers receive.- const { rightPanelShown: _ignoredRightPanelShown, ...rest } = stored as {- rightPanelShown?: unknown;- } & Record<string, unknown>;- let result: Partial<ConversationState> = rest as Partial<ConversationState>;+ let result: Partial<ConversationState> = stored as Partial<ConversationState>;if (result.selectedTab != null &&(REMOVED_CONVERSATION_TABS.has(result.selectedTab) ||+ (result.selectedTab as string) === "changes" ||!VALID_CONVERSATION_TABS.has(result.selectedTab as ConversationTab))) {+ const selectedTab = result.selectedTab as string;result = { ...result };- delete result.selectedTab;+ if (selectedTab === "changes") {+ result.selectedTab = "commits";+ } else {+ delete result.selectedTab;+ }}if (result.unpinnedTabs) {const filtered = result.unpinnedTabs.filter(- (tab) => !REMOVED_CONVERSATION_TABS.has(tab),+ (tab) => tab !== "changes" && !REMOVED_CONVERSATION_TABS.has(tab),);if (filtered.length !== result.unpinnedTabs.length) {result = { ...result, unpinnedTabs: filtered };}}+ if (result.unpinnedOverviewSections) {+ const filtered = result.unpinnedOverviewSections.filter((section) =>+ VALID_CONVERSATION_OVERVIEW_SECTIONS.has(section),+ );+ if (filtered.length !== result.unpinnedOverviewSections.length) {+ result = { ...result, unpinnedOverviewSections: filtered };+ }+ }++ if (result.unpinnedOverviewGitParts) {+ const filtered = result.unpinnedOverviewGitParts.filter((part) =>+ VALID_CONVERSATION_OVERVIEW_GIT_PARTS.has(part),+ );+ if (filtered.length !== result.unpinnedOverviewGitParts.length) {+ result = { ...result, unpinnedOverviewGitParts: filtered };+ }+ }+// Drop a corrupt/manually-edited `filesTabContentViewMode` so it falls// back to the typed default ("rich") instead of leaking a junk string// into ViewMode-typed consumers. TypeScript can't help us here — the@@ -126,6 +163,44 @@ function sanitizeStoredState(delete result.filesTabContentViewMode;}+ if (+ result.rightPanelShown != null &&+ typeof result.rightPanelShown !== "boolean"+ ) {+ result = { ...result };+ delete result.rightPanelShown;+ }++ if (+ result.filesTabTreeVisible != null &&+ typeof result.filesTabTreeVisible !== "boolean"+ ) {+ result = { ...result };+ delete result.filesTabTreeVisible;+ }++ if (result.filesTabOpenPaths != null) {+ if (!Array.isArray(result.filesTabOpenPaths)) {+ result = { ...result };+ delete result.filesTabOpenPaths;+ } else {+ const filtered = result.filesTabOpenPaths.filter(+ (path): path is string => typeof path === "string" && path.length > 0,+ );+ if (filtered.length !== result.filesTabOpenPaths.length) {+ result = { ...result, filesTabOpenPaths: filtered };+ }+ }+ }++ if (+ result.filesTabSelectedPath != null &&+ typeof result.filesTabSelectedPath !== "string"+ ) {+ result = { ...result };+ delete result.filesTabSelectedPath;+ }+return result;}@@ -265,10 +340,18 @@ export function useConversationLocalStorageState(conversationId: string): {state: ConversationState;setSelectedTab: (tab: ConversationTab | null) => void;setUnpinnedTabs: (tabs: string[]) => void;+ setUnpinnedOverviewSections?: (sections: string[]) => void;+ setUnpinnedOverviewGitParts?: (parts: string[]) => void;setConversationMode: (mode: ConversationMode) => void;setDraftMessage: (message: string | null) => void;+ setRightPanelShown?: (shown: boolean) => void;setFilesTabDiffView: (diffView: boolean | null) => void;setFilesTabContentViewMode: (mode: ViewMode) => void;+ setFilesTabTreeVisible?: (visible: boolean) => void;+ setFilesTabOpenState?: (+ openPaths: string[],+ selectedPath: string | null,+ ) => void;} {const [state, setState] = useState<ConversationState>(() =>getConversationState(conversationId),@@ -332,11 +415,23 @@ export function useConversationLocalStorageState(conversationId: string): {state,setSelectedTab: (tab) => updateState({ selectedTab: tab }),setUnpinnedTabs: (tabs) => updateState({ unpinnedTabs: tabs }),+ setUnpinnedOverviewSections: (sections) =>+ updateState({ unpinnedOverviewSections: sections }),+ setUnpinnedOverviewGitParts: (parts) =>+ updateState({ unpinnedOverviewGitParts: parts }),setConversationMode: (mode) => updateState({ conversationMode: mode }),setDraftMessage: (message) => updateState({ draftMessage: message }),+ setRightPanelShown: (shown) => updateState({ rightPanelShown: shown }),setFilesTabDiffView: (diffView) =>updateState({ filesTabDiffView: diffView }),setFilesTabContentViewMode: (mode) =>updateState({ filesTabContentViewMode: mode }),+ setFilesTabTreeVisible: (visible) =>+ updateState({ filesTabTreeVisible: visible }),+ setFilesTabOpenState: (openPaths, selectedPath) =>+ updateState({+ filesTabOpenPaths: openPaths,+ filesTabSelectedPath: selectedPath,+ }),};}diff --git a/src/utils/conversation-overview-project-scope.ts b/src/utils/conversation-overview-project-scope.tsnew file mode 100644index 0000000000..d0a1aa8205--- /dev/null+++ b/src/utils/conversation-overview-project-scope.ts@@ -0,0 +1,116 @@+import type { Automation } from "#/types/automation";+import type { SkillInfo } from "#/types/settings";+import {+ getSkillScope,+ SKILL_SCOPE_ORDER,+ type SkillScope,+} from "#/utils/skill-scope";++export const CONVERSATION_OVERVIEW_PROJECT_SCOPE = {+ project: "project",+ all: "all",+} as const;++export type ConversationOverviewProjectScope =+ (typeof CONVERSATION_OVERVIEW_PROJECT_SCOPE)[keyof typeof CONVERSATION_OVERVIEW_PROJECT_SCOPE];++export function normalizeRepositoryName(+ repository: string | null | undefined,+): string | null {+ if (!repository?.trim()) {+ return null;+ }+ return repository+ .trim()+ .toLowerCase()+ .replace(/\.git$/, "");+}++export function isAutomationForRepository(+ automation: Pick<Automation, "repository">,+ repository: string | null | undefined,+): boolean {+ const target = normalizeRepositoryName(repository);+ const automationRepo = normalizeRepositoryName(automation.repository);+ if (!target || !automationRepo) {+ return false;+ }+ return automationRepo === target;+}++export function isSkillForProject(+ skill: SkillInfo,+ projectDir?: string | null,+): boolean {+ return getSkillScope(skill, projectDir) === "project";+}++export function filterAutomationsByProjectScope(+ automations: Automation[],+ scope: ConversationOverviewProjectScope,+ repository: string | null | undefined,+): Automation[] {+ if (scope === CONVERSATION_OVERVIEW_PROJECT_SCOPE.all) {+ return automations;+ }+ return automations.filter((automation) =>+ isAutomationForRepository(automation, repository),+ );+}++export function filterSkillsByProjectScope(+ skills: SkillInfo[],+ scope: ConversationOverviewProjectScope,+ projectDir?: string | null,+): SkillInfo[] {+ if (scope === CONVERSATION_OVERVIEW_PROJECT_SCOPE.all) {+ return skills;+ }+ return skills.filter((skill) => isSkillForProject(skill, projectDir));+}++export function sortAutomationsByProjectRelevance(+ automations: Automation[],+ repository: string | null | undefined,+): Automation[] {+ return [...automations].sort((left, right) => {+ const leftMatch = isAutomationForRepository(left, repository) ? 0 : 1;+ const rightMatch = isAutomationForRepository(right, repository) ? 0 : 1;+ if (leftMatch !== rightMatch) {+ return leftMatch - rightMatch;+ }+ return left.name.localeCompare(right.name);+ });+}++export function sortSkillsByProjectRelevance(+ skills: SkillInfo[],+ projectDir?: string | null,+): SkillInfo[] {+ return [...skills].sort((left, right) => {+ const leftScope = getSkillScope(left, projectDir);+ const rightScope = getSkillScope(right, projectDir);+ const leftOrder = SKILL_SCOPE_ORDER.indexOf(leftScope as SkillScope);+ const rightOrder = SKILL_SCOPE_ORDER.indexOf(rightScope as SkillScope);+ if (leftOrder !== rightOrder) {+ return leftOrder - rightOrder;+ }+ return left.name.localeCompare(right.name);+ });+}++export function countAutomationsForRepository(+ automations: readonly Automation[],+ repository: string | null | undefined,+): number {+ return automations.filter((automation) =>+ isAutomationForRepository(automation, repository),+ ).length;+}++export function countSkillsForProject(+ skills: readonly SkillInfo[],+ projectDir?: string | null,+): number {+ return skills.filter((skill) => isSkillForProject(skill, projectDir)).length;+}diff --git a/src/utils/git-diff-stats.ts b/src/utils/git-diff-stats.tsnew file mode 100644index 0000000000..705ba79dae--- /dev/null+++ b/src/utils/git-diff-stats.ts@@ -0,0 +1,106 @@+import type { GitChangeDiff } from "#/api/open-hands.types";++export interface GitDiffLineStats {+ additions: number;+ deletions: number;+}++function countUnifiedDiffStats(diff: string): GitDiffLineStats {+ let additions = 0;+ let deletions = 0;++ for (const line of diff.split("\n")) {+ if (+ line.startsWith("+++") ||+ line.startsWith("---") ||+ line.startsWith("@@")+ ) {+ continue;+ }+ if (line.startsWith("+")) {+ additions += 1;+ } else if (line.startsWith("-")) {+ deletions += 1;+ }+ }++ return { additions, deletions };+}++function countTextDiffStats(+ original: string,+ modified: string,+): GitDiffLineStats {+ const originalLines = original.length === 0 ? [] : original.split("\n");+ const modifiedLines = modified.length === 0 ? [] : modified.split("\n");++ if (originalLines.length === 0) {+ return { additions: modifiedLines.length, deletions: 0 };+ }++ if (modifiedLines.length === 0) {+ return { additions: 0, deletions: originalLines.length };+ }++ let additions = 0;+ let deletions = 0;+ let originalIndex = 0;+ let modifiedIndex = 0;++ while (+ originalIndex < originalLines.length ||+ modifiedIndex < modifiedLines.length+ ) {+ const originalLine = originalLines[originalIndex];+ const modifiedLine = modifiedLines[modifiedIndex];++ if (+ originalIndex < originalLines.length &&+ modifiedIndex < modifiedLines.length &&+ originalLine === modifiedLine+ ) {+ originalIndex += 1;+ modifiedIndex += 1;+ continue;+ }++ if (+ modifiedIndex < modifiedLines.length &&+ (originalIndex >= originalLines.length ||+ !originalLines.slice(originalIndex).includes(modifiedLine))+ ) {+ additions += 1;+ modifiedIndex += 1;+ continue;+ }++ if (originalIndex < originalLines.length) {+ deletions += 1;+ originalIndex += 1;+ }+ }++ return { additions, deletions };+}++export function countGitChangeDiffStats(+ diff: GitChangeDiff & { diff?: string },+): GitDiffLineStats {+ if (typeof diff.diff === "string" && diff.diff.length > 0) {+ return countUnifiedDiffStats(diff.diff);+ }++ return countTextDiffStats(diff.original ?? "", diff.modified ?? "");+}++export function sumGitDiffLineStats(+ stats: GitDiffLineStats[],+): GitDiffLineStats {+ return stats.reduce(+ (totals, stat) => ({+ additions: totals.additions + stat.additions,+ deletions: totals.deletions + stat.deletions,+ }),+ { additions: 0, deletions: 0 },+ );+}diff --git a/src/utils/utils.ts b/src/utils/utils.tsindex e31215f415..4ba2087c36 100644--- a/src/utils/utils.ts+++ b/src/utils/utils.ts@@ -388,6 +388,11 @@ export const constructBranchUrl = (// Git Action Prompts+const GIT_COMMIT_PROMPT =+ "Please review the current changes and create a git commit with a concise, descriptive message.";++export const getGitCommitPrompt = (): string => GIT_COMMIT_PROMPT;+/*** Generate a git pull prompt* @returns The git pull promptdiff --git a/tests/e2e/mock-llm/files/mock-llm-files-and-git.spec.ts b/tests/e2e/mock-llm/files/mock-llm-files-and-git.spec.tsindex 65637718c7..c947377825 100644--- a/tests/e2e/mock-llm/files/mock-llm-files-and-git.spec.ts+++ b/tests/e2e/mock-llm/files/mock-llm-files-and-git.spec.ts@@ -1,12 +1,12 @@/**- * Mock-LLM E2E tests: Files tab, Git control bar, and Browser tab.+ * Mock-LLM E2E tests: Files tab, conversation overview git, and Browser tab.** Exercises conversation-panel tabs and git integration against the real* agent-server with a scripted mock LLM backend.** Coverage (issue #511):* - Files tab diff view can be enabled when a workspace is attached- * - Git control bar shows workspace-name pill for folder-attached conversations+ * - Conversation overview shows workspace / git identity (composer rail removed)* - Browser tab renders empty state when no page has been browsed* - Files tab defaults to file-tree view when NO workspace is attached*/@@ -31,7 +31,7 @@ import {const USER_MESSAGE = "Hello, please respond.";const WORKSPACE_PATH = "/tmp/e2e-test-project/my-app";// The git remote the step-2 trajectory configures for the workspace. Kept as a-// shared constant so the `git remote add` command and the control-bar pill+// shared constant so the `git remote add` command and the overview git// assertion below can never drift apart.const EXPECTED_REPO_SLUG = "test-org/test-repo";@@ -67,7 +67,7 @@ async function seedWorkspaceMetadata(test.describe.configure({ mode: "serial" });-test.describe("files tab, git control bar, and browser tab", () => {+test.describe("files tab, conversation overview git, and browser tab", () => {const conversationIds = new Set<string>();/** Conversation ID from the workspace-attached test, reused across steps. */let attachedConversationId: string | null = null;@@ -188,9 +188,9 @@ test.describe("files tab, git control bar, and browser tab", () => {await waitForTestId(page, "chat-interface", 30_000);});- // ── Step 3: Verify git control bar shows workspace name pill ────────+ // ── Step 3: Verify overview shows workspace / git identity ─────────- test("step 3: git control bar shows workspace pill and git actions", async ({+ test("step 3: conversation overview shows workspace and git identity", async ({page,}) => {test.skip(!attachedConversationId, "step 2 must complete first");@@ -206,52 +206,47 @@ test.describe("files tab, git control bar, and browser tab", () => {const workspaceName = WORKSPACE_PATH.replace(/\/+$/, "").split("/").pop()!;- // The git control bar renders below the chat input and shows the- // conversation's workspace/repo identity. Either state is valid and the- // bar flips between them as the local `git remote get-url origin` probe- // resolves: it shows the folder basename ("my-app") until the remote- // (added by step 2) is detected, then the repo slug ("test-org/test-repo").- // Accept either so the assertion doesn't race that probe (the source of a- // pre-existing flake — see GitControlBarRepoButton: selectedRepository ||- // workspaceName).- const escapeRegExp = (s: string) =>- s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");- const pillText = new RegExp(- `${escapeRegExp(workspaceName)}|${escapeRegExp(EXPECTED_REPO_SLUG)}`,- );- await test.step("verify workspace/repo pill is visible", async () => {- await expect(page.getByText(pillText).first()).toBeVisible({- timeout: 15_000,- });+ // Composer no longer hosts the git rail; identity lives in overview.+ await test.step("composer has no git control rail", async () => {+ await expect(+ page.getByTestId("interactive-chat-box").getByRole("button", {+ name: /^(Pull|Push|Create PR|Connect Repo)$/i,+ }),+ ).toHaveCount(0);+ });++ await test.step("open conversation overview", async () => {+ const toggle = page.getByTestId("conversation-overview-toggle");+ await expect(toggle).toBeVisible({ timeout: 10_000 });+ await toggle.click();+ await waitForTestId(page, "conversation-overview-panel", 10_000);+ });++ await test.step("verify workspace row shows folder basename", async () => {+ const workspaceRow = page.getByTestId("conversation-overview-workspace");+ await expect(workspaceRow).toBeVisible({ timeout: 10_000 });+ await expect(workspaceRow).toContainText(workspaceName);});// When useLocalGitInfo detects a remote (trajectory ran git init +- // remote add in step 2), Pull/Push buttons appear. In the npm path- // this happens reliably; in Docker the bash WebSocket probe may be- // slower. Use a soft check so Docker CI isn't blocked.- await test.step("check for Pull/Push buttons (git detection)", async () => {- const pullButton = page.getByRole("button", { name: /Pull/i }).first();+ // remote add in step 2), the overview git section surfaces the repo+ // slug. In Docker the bash WebSocket probe may be slower — soft-check.+ await test.step("check for overview git repo (git detection)", async () => {+ const repoRow = page.getByTestId("conversation-overview-git-repo");try {- await expect(pullButton).toBeVisible({ timeout: 20_000 });- // If Pull is visible, Push should be too- await expect(- page.getByRole("button", { name: /Push/i }).first(),- ).toBeVisible({ timeout: 5_000 });+ await expect(repoRow).toBeVisible({ timeout: 20_000 });+ await expect(repoRow).toContainText(EXPECTED_REPO_SLUG);} catch {- // Soft-fail: git probe may not have completed in time (Docker).- // The workspace pill assertion above is the primary gate.console.log(- "Pull/Push buttons not visible — git probe likely still pending",+ "Overview git repo not visible — git probe likely still pending",);}});});- // ── Step 4: Verify Files tab diff toggle can be enabled ─────────────+ // ── Step 4: Verify Commits tab is available for attached workspace ─- test("step 4: files tab can enable diff view for attached workspace", async ({- page,- }) => {+ test("step 4: commits tab opens for attached workspace", async ({ page }) => {test.skip(!attachedConversationId, "step 2 must complete first");test.setTimeout(60_000);@@ -263,9 +258,7 @@ test.describe("files tab, git control bar, and browser tab", () => {await dismissAnalyticsModal(page);await waitForTestId(page, "chat-interface", 30_000);- // Open the right panel, switch to Files tab, and verify diff toggle- await test.step("open files tab and verify diff toggle", async () => {- // Open the right panel+ await test.step("open right panel and Commits tab", async () => {const toggle = page.getByTestId("right-panel-toggle");await expect(toggle).toBeVisible({ timeout: 10_000 });await toggle.click({ force: true });@@ -273,23 +266,18 @@ test.describe("files tab, git control bar, and browser tab", () => {timeout: 10_000,});- // Wait for at least one tab to be visible (panel animation done)const anyTab = page.locator('[data-testid^="conversation-tab-"]').first();await expect(anyTab).toBeVisible({ timeout: 10_000 });- // Click the Files tab- const filesTab = page.getByTestId("conversation-tab-files");- await filesTab.click();-- // Wait for the diff toggle radio group to be visible (both option- // buttons render together, so target the parent container rather than- // using .or() which hits Playwright strict-mode when both resolve).- const diffToggle = page.getByTestId("files-tab-diff-toggle");- await expect(diffToggle).toBeVisible({ timeout: 15_000 });-- const diffOnOption = page.getByTestId("files-tab-diff-toggle-option-on");- await diffOnOption.click({ force: true });- await expect(diffOnOption).toHaveAttribute("aria-checked", "true", {+ // Commits may be overflowed into the ⋯ menu on narrow viewports.+ const commitsTab = page.getByTestId("conversation-tab-commits");+ if (await commitsTab.isVisible().catch(() => false)) {+ await commitsTab.click();+ } else {+ await page.getByTestId("ellipsis-button").click();+ await page.getByTestId("conversation-tabs-menu-open-commits").click();+ }+ await expect(page.getByTestId("conversation-tab-commits")).toBeVisible({timeout: 15_000,});});@@ -384,27 +372,36 @@ test.describe("files tab, git control bar, and browser tab", () => {await page.waitForTimeout(500);});- // Click the Files tab- await test.step("click files tab", async () => {+ // Ensure the Files surface is showing. Opening the drawer already+ // defaults the selection to Files, and clicking the active tab again+ // deliberately closes the drawer (see useSelectConversationTab), so only+ // click when the Files panel is not already visible.+ await test.step("ensure files tab is active", async () => {const filesTab = page.getByTestId("conversation-tab-files");await expect(filesTab).toBeVisible({ timeout: 10_000 });- await filesTab.click();- await page.waitForTimeout(300);+ if (!(await page.getByTestId("files-tab").isVisible())) {+ await filesTab.click();+ await page.waitForTimeout(300);+ }});- await test.step("verify diff toggle defaults to off (files view)", async () => {- // Wait for the diff toggle radio group inside the files tab content.- // The parent `files-tab` container can report "hidden" while the- // right-panel drawer animation runs, so target the toggle directly.- const diffToggle = page.getByTestId("files-tab-diff-toggle");- await expect(diffToggle).toBeVisible({ timeout: 15_000 });-- // Without an attached workspace, the "off" (Files) option should be active- const diffOffOption = page.getByTestId(- "files-tab-diff-toggle-option-off",- );- await expect(diffOffOption).toBeVisible({ timeout: 10_000 });- await expect(diffOffOption).toHaveAttribute("aria-checked", "true");+ await test.step("verify files tab shows file browser (not diff)", async () => {+ await expect(page.getByTestId("files-tab")).toBeVisible({+ timeout: 15_000,+ });+ // The file browser's tab strip renders once loading settles; the+ // content mode toggle only appears after a file is opened, and the+ // legacy Diff/Commits toggle is gone from the Files surface.+ await expect(page.getByTestId("file-quick-row")).toBeVisible({+ timeout: 10_000,+ });+ await expect(page.getByTestId("files-tab-content")).toBeVisible({+ timeout: 10_000,+ });+ await expect(+ page.getByTestId("files-tab-content-mode-toggle"),+ ).toHaveCount(0);+ await expect(page.getByTestId("files-tab-diff-toggle")).toHaveCount(0);});});});