v0.8.0 — Edit existing rules, delete all at once
What's new — edit existing rules, delete all at once
Rules could previously only be deleted and recreated from scratch — no way to tweak an existing one without losing all its settings. Two additions:
- Edit Rule: click the new Edit button on any rule card to open the same 3-step editor, pre-filled with that rule's current trigger, action, and safety settings. Change anything (including the name) and save — it updates the rule in place instead of creating a duplicate.
- Delete All: a new button in the rule list header clears every rule at once. Unlike deleting a single rule, this asks for confirmation first (showing how many rules will be removed), since it's a lot harder to walk back.
Verified: 8 new automated tests (60 total, all passing) covering in-place updates, renaming, name-collision rejection, and bulk deletion at both the service and WebSocket layers — plus manual browser verification against the real backend: created a rule, edited it (renamed + toggled a setting), confirmed it updated in place rather than duplicating, then exercised the Delete All confirmation dialog (declined it — rule survived; confirmed it — list cleared).
新功能 — 編輯現有規則、一次刪除全部
規則之前只能刪除重建,沒辦法在不遺失原本設定的情況下微調一條既有規則。這次新增兩個功能:
- 編輯規則:點擊規則卡片上新增的 編輯 按鈕,會開啟跟新增規則一樣的三步驟編輯器,並預先帶入這條規則目前的觸發條件、動作、安全參數。改完任何欄位(包括名稱)存檔後,會原地更新這條規則,而不是新增一條重複的。
- 刪除全部:規則清單標題列新增一個按鈕,可以一次清空所有規則。跟刪除單一規則不同,這個會先跳出確認對話框(顯示會刪除幾條規則),因為影響範圍大很多、比較難挽回。
驗證方式:新增 8 個自動化測試(總計 60 個,全數通過),涵蓋服務層與 WebSocket 層的原地更新、改名、名稱衝突拒絕、批次刪除 —— 另外針對真實後端做了瀏覽器手動驗證:建立一條規則、編輯它(改名 + 切換一個設定)、確認是原地更新而不是新增重複,接著測試「刪除全部」的確認對話框(取消時規則還在;確認後清單清空)。