Skip to content

Commit 65878b2

Browse files
committed
fix: improve context menu behavior and revert tool descriptions
1 parent abf760e commit 65878b2

4 files changed

Lines changed: 29 additions & 26 deletions

File tree

clif-pad-ide/src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clif-pad-ide/src-tauri/src/commands/agent.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn tool_definitions() -> Vec<serde_json::Value> {
5656
"type": "function",
5757
"function": {
5858
"name": "read_file",
59-
"description": "Read the contents of a file. Read files before editing them. Use this to inspect code, configs, and logs before making changes. For large files, use offset and limit to read specific line ranges instead of the whole file. Output includes line numbers. Prefer this over run_command for reading files.",
59+
"description": "Read the contents of a file. Read files before editing them. Use this to inspect code, configs, and logs before making changes. For large files, use offset and limit to read specific line ranges instead of the whole file.",
6060
"strict": true,
6161
"parameters": {
6262
"type": "object",
@@ -91,7 +91,7 @@ fn tool_definitions() -> Vec<serde_json::Value> {
9191
"type": "function",
9292
"function": {
9393
"name": "edit_file",
94-
"description": "Make a targeted edit by replacing old_string with new_string exactly once. Read the file first. Prefer this over write_file for localized changes. old_string must match the current file contents exactly, including whitespace. Include enough context to make the match unique.",
94+
"description": "Make a targeted edit by replacing old_string with new_string exactly once. Read the file first. Prefer this over write_file for localized changes. old_string must match the current file contents exactly, including whitespace.",
9595
"strict": true,
9696
"parameters": {
9797
"type": "object",
@@ -109,7 +109,7 @@ fn tool_definitions() -> Vec<serde_json::Value> {
109109
"type": "function",
110110
"function": {
111111
"name": "list_files",
112-
"description": "List files and directories at a path. Use this to explore the workspace before reading or editing files. Returns names and types (file/directory).",
112+
"description": "List files and directories at a path. Use this to explore the workspace before reading or editing files.",
113113
"strict": true,
114114
"parameters": {
115115
"type": "object",
@@ -125,7 +125,7 @@ fn tool_definitions() -> Vec<serde_json::Value> {
125125
"type": "function",
126126
"function": {
127127
"name": "search",
128-
"description": "Search for text in files within a directory. Prefer this over run_command for codebase exploration. Returns file paths and matching lines with context.",
128+
"description": "Search for text in files within a directory. Prefer this over run_command for codebase exploration.",
129129
"strict": true,
130130
"parameters": {
131131
"type": "object",
@@ -142,7 +142,7 @@ fn tool_definitions() -> Vec<serde_json::Value> {
142142
"type": "function",
143143
"function": {
144144
"name": "run_command",
145-
"description": "Run a shell command and return its output. Use this mainly for build, test, lint, git, or validation tasks. Prefer read/search/list tools over shell commands for basic exploration. Requires user approval before execution. Avoid for reading files - use read_file instead.",
145+
"description": "Run a shell command and return its output. Use this mainly for build, test, lint, git, or validation tasks. Prefer read/search/list tools over shell commands for basic exploration. Requires user approval before execution.",
146146
"strict": true,
147147
"parameters": {
148148
"type": "object",
@@ -159,7 +159,7 @@ fn tool_definitions() -> Vec<serde_json::Value> {
159159
"type": "function",
160160
"function": {
161161
"name": "find_file",
162-
"description": "Find files or directories by partial name anywhere in the workspace. Use this when you do not know the exact location of something. Faster than run_command find.",
162+
"description": "Find files or directories by partial name anywhere in the workspace. Use this when you do not know the exact location of something.",
163163
"strict": true,
164164
"parameters": {
165165
"type": "object",

clif-pad-ide/src/components/explorer/ContextMenu.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, For, Show, onMount, onCleanup, createSignal } from "solid-js";
2+
import { Portal } from "solid-js/web";
23

34
export interface ContextMenuItem {
45
label: string;
@@ -55,22 +56,23 @@ const ContextMenu: Component<ContextMenuProps> = (props) => {
5556
});
5657

5758
return (
58-
<div
59-
ref={menuRef}
60-
class="fixed z-50"
61-
style={{
62-
left: `${position().x}px`,
63-
top: `${position().y}px`,
64-
background: "var(--bg-surface)",
65-
border: "1px solid var(--border-default)",
66-
"border-radius": "6px",
67-
"box-shadow": "0 4px 16px rgba(0,0,0,0.3)",
68-
"min-width": "160px",
69-
padding: "4px 0",
70-
"font-size": "12px",
71-
"font-family": "var(--font-sans)",
72-
}}
73-
>
59+
<Portal>
60+
<div
61+
ref={menuRef}
62+
class="fixed z-50"
63+
style={{
64+
left: `${position().x}px`,
65+
top: `${position().y}px`,
66+
background: "var(--bg-surface)",
67+
border: "1px solid var(--border-default)",
68+
"border-radius": "6px",
69+
"box-shadow": "0 4px 16px rgba(0,0,0,0.3)",
70+
"min-width": "160px",
71+
padding: "4px 0",
72+
"font-size": "12px",
73+
"font-family": "var(--font-sans)",
74+
}}
75+
>
7476
<For each={props.items}>
7577
{(item) => (
7678
<>
@@ -119,7 +121,8 @@ const ContextMenu: Component<ContextMenuProps> = (props) => {
119121
</>
120122
)}
121123
</For>
122-
</div>
124+
</div>
125+
</Portal>
123126
);
124127
};
125128

clif-pad-ide/src/components/git/FileRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ const FileRow: Component<{
158158
color: "var(--text-primary)",
159159
background: hovered() ? "var(--bg-hover)" : "transparent",
160160
}}
161-
onMouseEnter={() => setHovered(true)}
162-
onMouseLeave={() => setHovered(false)}
161+
onMouseEnter={() => !ctxMenu() && setHovered(true)}
162+
onMouseLeave={() => !ctxMenu() && setHovered(false)}
163163
onContextMenu={handleContextMenu}
164164
onClick={() => {
165165
if (isRenaming()) return;

0 commit comments

Comments
 (0)