Skip to content

Commit ca1e93a

Browse files
chore: formatting and cleanup
1 parent bfa1911 commit ca1e93a

6 files changed

Lines changed: 44 additions & 22 deletions

File tree

apps/desktop/src/main/windows/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ export async function MainWindow() {
188188
},
189189
);
190190

191-
192191
// Forward low-volume terminal lifecycle events to the renderer via the existing
193192
// notifications subscription. This is used only for correctness (e.g. clearing
194193
// stuck agent lifecycle statuses when terminal panes aren't mounted).

apps/desktop/src/renderer/components/Chat/ChatInterface/components/ChatInputFooter/ChatInputFooter.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export function ChatInputFooter({
200200
cwd={cwd}
201201
slashCommands={slashCommands}
202202
placeholder="Ask to make changes, @mention files, run /commands"
203-
focusShortcutText={showFocusHint ? focusShortcutText : undefined}
203+
focusShortcutText={
204+
showFocusHint ? focusShortcutText : undefined
205+
}
204206
/>
205207
<ChatComposerControls
206208
availableModels={availableModels}

apps/desktop/src/renderer/components/Chat/ChatInterface/components/TiptapPromptEditor/SlashCommandNode.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { cn } from "@superset/ui/utils";
12
import { mergeAttributes, Node } from "@tiptap/core";
23
import {
34
type NodeViewProps,
45
NodeViewWrapper,
56
ReactNodeViewRenderer,
67
} from "@tiptap/react";
7-
import { cn } from "@superset/ui/utils";
88
import { useCallback, useEffect, useRef } from "react";
99

1010
function SlashCommandChip({
@@ -47,7 +47,11 @@ function SlashCommandChip({
4747
e.stopPropagation();
4848
const pos = getPos();
4949
if (pos !== undefined) {
50-
editor.chain().focus().setTextSelection(pos + node.nodeSize).run();
50+
editor
51+
.chain()
52+
.focus()
53+
.setTextSelection(pos + node.nodeSize)
54+
.run();
5155
} else {
5256
editor.commands.focus("end");
5357
}
@@ -58,7 +62,8 @@ function SlashCommandChip({
5862
e.stopPropagation();
5963
const pos = getPos();
6064
if (pos !== undefined) {
61-
editor.chain()
65+
editor
66+
.chain()
6267
.focus()
6368
.deleteRange({ from: pos, to: pos + node.nodeSize })
6469
.run();

apps/desktop/src/renderer/components/Chat/ChatInterface/components/TiptapPromptEditor/SlashCommandPreviewPopover.tsx

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,28 @@ export function SlashCommandPreviewPopover({
5252
el.style.top = `${rect.top}px`;
5353
el.style.width = `${rect.width}px`;
5454
el.style.height = `${rect.height}px`;
55-
}, [editor, inputValue]);
55+
}, [editor]);
5656

5757
const slashPreviewInput = normalizeSlashPreviewInput(inputValue);
5858
const parsedInput = useMemo(() => parseSlashInput(inputValue), [inputValue]);
5959
const debouncedSlashPreviewInput = useDebouncedValue(slashPreviewInput, 120);
6060

61-
const { data: slashPreview } = chatServiceTrpc.workspace.previewSlashCommand.useQuery(
62-
{ cwd, text: debouncedSlashPreviewInput },
63-
{
64-
enabled: debouncedSlashPreviewInput.length > 1 && !!cwd,
65-
staleTime: 250,
66-
placeholderData: (previous) => previous,
67-
},
68-
);
61+
const { data: slashPreview } =
62+
chatServiceTrpc.workspace.previewSlashCommand.useQuery(
63+
{ cwd, text: debouncedSlashPreviewInput },
64+
{
65+
enabled: debouncedSlashPreviewInput.length > 1 && !!cwd,
66+
staleTime: 250,
67+
placeholderData: (previous) => previous,
68+
},
69+
);
6970

7071
const commandDefinition = useMemo(() => {
7172
if (!parsedInput?.commandName) return null;
72-
return resolveSlashCommandDefinition(slashCommands, parsedInput.commandName);
73+
return resolveSlashCommandDefinition(
74+
slashCommands,
75+
parsedInput.commandName,
76+
);
7377
}, [parsedInput?.commandName, slashCommands]);
7478

7579
const commandDescription = commandDefinition?.description?.trim() ?? "";
@@ -80,17 +84,26 @@ export function SlashCommandPreviewPopover({
8084
canonicalCommandName &&
8185
previewCommandName === canonicalCommandName,
8286
);
83-
const previewPrompt = previewMatchesInputCommand ? (slashPreview?.prompt ?? "") : "";
87+
const previewPrompt = previewMatchesInputCommand
88+
? (slashPreview?.prompt ?? "")
89+
: "";
8490

8591
// Show popover when there's an active command with a preview to display
8692
const showPopover = Boolean(
87-
parsedInput && commandDefinition && debouncedSlashPreviewInput && previewPrompt,
93+
parsedInput &&
94+
commandDefinition &&
95+
debouncedSlashPreviewInput &&
96+
previewPrompt,
8897
);
8998

9099
return (
91100
<Popover open={showPopover && isFocused}>
92101
<PopoverAnchor asChild>
93-
<div ref={anchorRef} className="pointer-events-none fixed" aria-hidden="true" />
102+
<div
103+
ref={anchorRef}
104+
className="pointer-events-none fixed"
105+
aria-hidden="true"
106+
/>
94107
</PopoverAnchor>
95108
<PopoverContent
96109
side="top"
@@ -105,9 +118,13 @@ export function SlashCommandPreviewPopover({
105118
<span className="flex size-4.5 shrink-0 items-center justify-center rounded bg-muted font-mono text-[11px]">
106119
/
107120
</span>
108-
<span className="font-mono text-foreground/90">{parsedInput?.commandName}</span>
121+
<span className="font-mono text-foreground/90">
122+
{parsedInput?.commandName}
123+
</span>
109124
{commandDescription && (
110-
<span className="truncate text-muted-foreground/70">{commandDescription}</span>
125+
<span className="truncate text-muted-foreground/70">
126+
{commandDescription}
127+
</span>
111128
)}
112129
</div>
113130
<div className="space-y-1">

apps/desktop/src/renderer/components/Chat/ChatInterface/components/ToolCallBlock/ToolCallBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import { ListTaskStatusesToolCall } from "./components/ListTaskStatusesToolCall"
3636
import { ListTasksToolCall } from "./components/ListTasksToolCall";
3737
import { ListWorkspacesToolCall } from "./components/ListWorkspacesToolCall";
3838
import { LspInspectToolCall } from "./components/LspInspectToolCall";
39-
import { StartAgentSessionToolCall } from "./components/StartAgentSessionToolCall";
4039
import { SkillToolCall } from "./components/SkillToolCall";
40+
import { StartAgentSessionToolCall } from "./components/StartAgentSessionToolCall";
4141
import { SubagentToolCall } from "./components/SubagentToolCall";
4242
import { SupersetToolCall } from "./components/SupersetToolCall";
4343
import { SwitchWorkspaceToolCall } from "./components/SwitchWorkspaceToolCall";

apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatPane/components/WorkspaceChatInterface/components/ChatInputFooter/ChatInputFooter.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import type {
1919
PermissionMode,
2020
} from "renderer/components/Chat/ChatInterface/types";
2121
import { useHotkeyDisplay } from "renderer/hotkeys";
22-
import { MentionAnchor, MentionProvider } from "../MentionPopover";
2322
import { ChatComposerControls } from "./components/ChatComposerControls";
2423
import { ChatInputDropZone } from "./components/ChatInputDropZone";
2524
import { ChatShortcuts } from "./components/ChatShortcuts";

0 commit comments

Comments
 (0)