@@ -49,16 +49,23 @@ function renderTable() {
4949 const tdKind = document . createElement ( "td" ) ; tdKind . textContent = r . kind || "" ;
5050 const tdSeverity = document . createElement ( "td" ) ; tdSeverity . textContent = r . severity || "" ;
5151 const tdActions = document . createElement ( "td" ) ;
52- // Restore delete button
52+ // Edit button
53+ const editBtn = document . createElement ( "button" ) ;
54+ editBtn . textContent = "✏️" ;
55+ editBtn . title = "Edit" ;
56+ editBtn . style . padding = "4px 8px" ;
57+ editBtn . onclick = function ( ) {
58+ if ( typeof window . editRule === "function" ) { window . editRule ( idx ) ; }
59+ } ;
60+ tdActions . appendChild ( editBtn ) ;
61+
62+ // Delete button (with confirmation modal)
5363 const delBtn = document . createElement ( "button" ) ;
5464 delBtn . textContent = "🗑" ;
5565 delBtn . title = "Delete" ;
5666 delBtn . style . padding = "4px 8px" ;
5767 delBtn . onclick = function ( ) {
58- rules . splice ( idx , 1 ) ;
59- saveRules ( ) ;
60- renderTable ( ) ;
61- showToast ( "Rule deleted" , { background : "#b91c1c" } ) ;
68+ if ( typeof window . deleteRule === "function" ) { window . deleteRule ( idx ) ; }
6269 } ;
6370 tdActions . appendChild ( delBtn ) ;
6471 tr . appendChild ( tdId ) ;
@@ -732,7 +739,7 @@ window.editRule = function (idx) {
732739} ;
733740
734741window . deleteRule = function ( idx ) {
735- showDeleteConfirmation ( idx ) ;
742+ showDeleteConfirmation ( idx , rules , saveRules , renderTable , showToast ) ;
736743} ;
737744
738745
0 commit comments