Skip to content

Commit 180ebda

Browse files
Add edit cline rule button (RooCodeInc#2956)
* add button to open rule file * changeset
1 parent 2a80fed commit 180ebda

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.changeset/six-birds-move.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
Add an edit button to the Cline Rules toggle modal to open rule files

webview-ui/src/components/cline-rules/RuleRow.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { vscode } from "@/utils/vscode"
2+
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
3+
14
const RuleRow: React.FC<{
25
rulePath: string
36
enabled: boolean
@@ -6,6 +9,13 @@ const RuleRow: React.FC<{
69
// Get the filename from the path for display
710
const displayName = rulePath.split("/").pop() || rulePath
811

12+
const handleEditClick = () => {
13+
vscode.postMessage({
14+
type: "openFile",
15+
text: rulePath,
16+
})
17+
}
18+
919
return (
1020
<div className="mb-2.5">
1121
<div
@@ -17,7 +27,7 @@ const RuleRow: React.FC<{
1727
</span>
1828

1929
{/* Toggle Switch */}
20-
<div className="flex items-center ml-2">
30+
<div className="flex items-center ml-2 space-x-2">
2131
<div
2232
role="switch"
2333
aria-checked={enabled}
@@ -40,6 +50,14 @@ const RuleRow: React.FC<{
4050
}`}
4151
/>
4252
</div>
53+
<VSCodeButton
54+
appearance="icon"
55+
aria-label="Edit rule file"
56+
title="Edit rule file"
57+
onClick={handleEditClick}
58+
style={{ height: "20px" }}>
59+
<span className="codicon codicon-edit" style={{ fontSize: "14px" }} />
60+
</VSCodeButton>
4361
</div>
4462
</div>
4563
</div>

0 commit comments

Comments
 (0)