From 85999b25a824f276248da52951bf1a3e9c200f6c Mon Sep 17 00:00:00 2001 From: Zaki Manian Date: Tue, 3 Mar 2026 16:38:48 -0800 Subject: [PATCH] fix(web): refresh routine UI after Run Now trigger (#501) * fix(web): refresh routine UI after "Run Now" trigger triggerRoutine() only showed a toast but did not refresh the routine data after triggering. This adds openRoutineDetail() / loadRoutines() calls after the toast, matching the pattern used by toggleRoutine(). Closes #483 Co-Authored-By: Claude Opus 4.6 * fix: only refresh detail view if triggered routine matches current view Check currentRoutineId === id before refreshing the detail panel to avoid refreshing the wrong routine's view. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/channels/web/static/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/channels/web/static/app.js b/src/channels/web/static/app.js index fd7b16fa..7fed4157 100644 --- a/src/channels/web/static/app.js +++ b/src/channels/web/static/app.js @@ -3030,7 +3030,11 @@ function renderRoutineDetail(routine) { function triggerRoutine(id) { apiFetch('/api/routines/' + id + '/trigger', { method: 'POST' }) - .then(() => showToast('Routine triggered', 'success')) + .then(() => { + showToast('Routine triggered', 'success'); + if (currentRoutineId === id) openRoutineDetail(id); + else loadRoutines(); + }) .catch((err) => showToast('Trigger failed: ' + err.message, 'error')); }