File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
webview-ui/src/components/cline-rules Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " claude-dev " : minor
3+ ---
4+
5+ Add an edit button to the Cline Rules toggle modal to open rule files
Original file line number Diff line number Diff line change 1+ import { vscode } from "@/utils/vscode"
2+ import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
3+
14const 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 >
You can’t perform that action at this time.
0 commit comments