Skip to content

Commit 973e07c

Browse files
committed
merge: worker/2fb623c3 - fix circular import dependencies
2 parents b04c63d + 12bcdd1 commit 973e07c

11 files changed

Lines changed: 63 additions & 47 deletions

src/components/cortex/CortexChatMessageBubble.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import { Component, JSX, Show, For, createSignal, createResource } from "solid-js";
1313
import { CortexIcon } from "./primitives";
14-
import type { ChatMessage } from "./CortexChatPanel";
14+
import type { ChatMessage } from "./cortexChatTypes";
1515

1616
export interface ChatMessageBubbleProps {
1717
message: ChatMessage;

src/components/cortex/CortexChatPanel.tsx

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,18 @@ import { Component, JSX, splitProps, Show, For } from "solid-js";
1313
import { CortexPromptInput } from "./primitives";
1414
import { ChatMessageBubble } from "./CortexChatMessageBubble";
1515

16-
export type ChatPanelState = "home" | "minimized" | "expanded";
17-
18-
export interface ChatMessage {
19-
id: string;
20-
type: "user" | "agent";
21-
content: string;
22-
timestamp?: Date;
23-
actions?: ChatAction[];
24-
isThinking?: boolean;
25-
progress?: ChatProgress[];
26-
toolCalls?: ChatToolCall[];
27-
codeBlocks?: { language: string; code: string }[];
28-
}
29-
30-
export interface ChatAction {
31-
id: string;
32-
label: string;
33-
icon?: string;
34-
onClick?: () => void;
35-
}
36-
37-
export interface ChatProgress {
38-
id: string;
39-
label: string;
40-
status: "pending" | "running" | "completed" | "error";
41-
}
42-
43-
export interface ChatToolCall {
44-
name: string;
45-
status: "running" | "completed" | "error";
46-
filesEdited?: number;
47-
onUndo?: () => void;
48-
onReview?: () => void;
49-
}
16+
export type {
17+
ChatPanelState,
18+
ChatMessage,
19+
ChatAction,
20+
ChatProgress,
21+
ChatToolCall,
22+
} from "./cortexChatTypes";
23+
24+
import type {
25+
ChatPanelState,
26+
ChatMessage,
27+
} from "./cortexChatTypes";
5028

5129
export interface CortexChatPanelProps {
5230
state?: ChatPanelState;

src/components/cortex/__tests__/CortexChatMessageBubble.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, it, expect, vi, beforeEach } from "vitest";
22
import { render, fireEvent, cleanup } from "@solidjs/testing-library";
33
import { ChatMessageBubble } from "../CortexChatMessageBubble";
4-
import type { ChatMessage } from "../CortexChatPanel";
4+
import type { ChatMessage } from "../cortexChatTypes";
55

66
vi.mock("../primitives", () => ({
77
CortexIcon: (props: { name: string; size?: number; color?: string }) => (
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export type ChatPanelState = "home" | "minimized" | "expanded";
2+
3+
export interface ChatMessage {
4+
id: string;
5+
type: "user" | "agent";
6+
content: string;
7+
timestamp?: Date;
8+
actions?: ChatAction[];
9+
isThinking?: boolean;
10+
progress?: ChatProgress[];
11+
toolCalls?: ChatToolCall[];
12+
codeBlocks?: { language: string; code: string }[];
13+
}
14+
15+
export interface ChatAction {
16+
id: string;
17+
label: string;
18+
icon?: string;
19+
onClick?: () => void;
20+
}
21+
22+
export interface ChatProgress {
23+
id: string;
24+
label: string;
25+
status: "pending" | "running" | "completed" | "error";
26+
}
27+
28+
export interface ChatToolCall {
29+
name: string;
30+
status: "running" | "completed" | "error";
31+
filesEdited?: number;
32+
onUndo?: () => void;
33+
onReview?: () => void;
34+
}

src/context/SDKContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createContext, useContext, ParentProps, onCleanup, onMount, batch } from "solid-js";
22
import { createStore, produce } from "solid-js/store";
33
import { invoke } from "@tauri-apps/api/core";
4-
import { useTauriListen } from "../hooks";
4+
import { useTauriListen } from "../hooks/useTauriListen";
55
import { type ServerInfo } from "@/utils/tauri";
66
import { API_BASE_URL } from "../utils/config";
77
import { getWindowLabel } from "@/utils/windowStorage";

src/context/TerminalsContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createStore, produce } from "solid-js/store";
33
import { invoke } from "@tauri-apps/api/core";
44
import { terminalLogger } from "../utils/logger";
55
import { useToast } from "./ToastContext";
6-
import { useTauriListen } from "../hooks";
6+
import { useTauriListen } from "../hooks/useTauriListen";
77

88
// Shell integration utilities
99
import {

src/context/WindowsContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createContext, useContext, ParentProps, onMount, onCleanup } from "soli
22
import { createStore, produce } from "solid-js/store";
33
import { WebviewWindow, getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
44
import { emit } from "@tauri-apps/api/event";
5-
import { useTauriListeners } from "../hooks";
5+
import { useTauriListeners } from "../hooks/useTauriListen";
66

77
// ============================================================================
88
// Types

src/context/editor/EditorUIContext.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ export type { SplitDirection, EditorGroup, EditorSplit, EditorLayout };
2525
// State
2626
// ============================================================================
2727

28-
export interface EditorUIState {
29-
activeGroupId: string;
30-
groups: EditorGroup[];
31-
splits: EditorSplit[];
32-
maximizedGroupId: string | null;
33-
}
28+
import type { EditorUIState } from "./editorUITypes";
29+
export type { EditorUIState } from "./editorUITypes";
3430

3531
const DEFAULT_GROUP_ID = "group-default";
3632

src/context/editor/editorGridLayout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { batch } from "solid-js";
22
import type { SetStoreFunction } from "solid-js/store";
33
import type { EditorGroup, EditorSplit } from "../../types";
4-
import type { EditorUIState } from "./EditorUIContext";
4+
import type { EditorUIState } from "./editorUITypes";
55
import { generateId } from "./languageDetection";
66

77
export function createGridLayoutOps(

src/context/editor/editorGroupOps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { batch } from "solid-js";
22
import { produce, type SetStoreFunction } from "solid-js/store";
33
import type { SplitDirection, EditorGroup, EditorSplit } from "../../types";
4-
import type { EditorUIState } from "./EditorUIContext";
4+
import type { EditorUIState } from "./editorUITypes";
55
import { generateId } from "./languageDetection";
66

77
export function createGroupOps(

0 commit comments

Comments
 (0)