Edit Buttons Not Working, Need to Fix #77
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proc#77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
use browser mcp to test all buttons
e..g. edit not working on most tabs
also check other buttons
check all and fix
Edit Button Not Working, Need to Fixto Edit Buttons Not Working, Need to FixImplementation Spec for Issue #77 — Fix Broken Edit Buttons and Other UI Buttons
Objective
Identify and fix all broken buttons in the hero_proc admin dashboard. The primary symptom reported is that edit buttons on most tabs do not work. The root cause is a data-shape mismatch in
loadServices()indashboard.js.Root Cause Analysis
Bug 1 (Critical) —
loadServices()never populatescachedServices:service.listreturns{ "value": ["name1", "name2", ...] }but the JS tests forArray.isArray(result)(false) thenresult.services(undefined). It falls through tocachedServices = [], so the Services tab is always blank — all Edit/Delete/Start/Stop/Restart/Kill buttons on that tab are never rendered.Bug 2 — Service control buttons show wrong state:
renderServices()gates Start/Stop/Restart/Kill buttons onspec.status === 'running'butspec.statusis the wanted config state (start/stop/ignore), not the live runtime state. Services withstatus: "stop"never show control buttons even if live.Bug 3 — Schedules tab has no Edit button:
The Schedules detail panel has only a Close button. No path exists to edit a schedule's underlying action.
Requirements
loadServices()to handle the{ value: string[] }response fromservice.list(or switch toservice.list_full)Files to Modify
crates/hero_proc_ui/static/js/dashboard.js— all three fixesImplementation Plan
Step 1 — Browser MCP baseline test
Use browser MCP to test all buttons on all tabs: Actions, Services, Runs, Jobs, Secrets, Schedules, Logs, Admin, Docs, Terminal. Record what is broken.
Step 2 — Fix
loadServices()response shape (Critical)Switch from
service.listtoservice.list_fullwhich returns{ value: ServiceConfig[] }:This also eliminates N serial
service.getround-trips on each 5s refresh.Step 3 — Fix service control buttons
Remove the
isRunningconditional inrenderServices(). Show all control buttons (Start/Stop/Restart/Kill) unconditionally — the server handles invalid state transitions gracefully.Step 4 — Add Edit button to Schedules detail panel
In
viewSchedule(), add an Edit button that navigates to the action's edit form:Step 5 — Browser MCP re-test after fixes
Confirm Services tab renders rows, all buttons work, Schedules has an Edit button, no regressions on other tabs.
Acceptance Criteria
Notes
dashboard.jsrequires changes — no Rust/server changes neededloadActions(),loadSecrets(),loadSchedules(),loadRuns(),loadJobs()are all working correctlyservice.list_fullis preferable toservice.list+ Nservice.getcalls for performanceTest Results
Cargo build: Failed to compile — pre-existing test error in
tests/integration/tests/pty.rs:154:struct hero_proc_sdk::ActionSpec has no field named 'args'. This error is unrelated to the dashboard.js changes in this PR (it references a Rust struct field that no longer exists, not any UI code).Browser validation (all fixes confirmed working):
Fix 1 —
loadServices()now usesservice.list_fullreturning{ value: ServiceConfig[] }:service.getround-trips on each refreshFix 2 — Service control buttons (Start/Stop/Restart/Kill) rendered unconditionally:
Fix 3 — Schedules detail panel Edit button:
viewSchedule()panel template (confirmed in source at line 1608)editAction()Zero JS console errors across all tabs.
Test Results
Cargo build: Failed to compile — pre-existing test error in
tests/integration/tests/pty.rs:154:struct hero_proc_sdk::ActionSpec has no field named 'args'. This error is unrelated to the dashboard.js changes in this PR (it references a Rust struct field that no longer exists, not any UI code).Browser validation (all fixes confirmed working):
Fix 1 —
loadServices()now usesservice.list_fullreturning{ value: ServiceConfig[] }:service.getround-trips on each refreshFix 2 — Service control buttons (Start/Stop/Restart/Kill) rendered unconditionally:
Fix 3 — Schedules detail panel Edit button:
viewSchedule()panel template (confirmed in source at line 1608)editAction()Zero JS console errors across all tabs.
Implementation Summary
Three bugs were identified and fixed in
crates/hero_proc_ui/static/js/dashboard.js:Bug 1 — Services tab always blank (critical)
loadServices()calledservice.listwhich returns{ "value": string[] }, but the JS only handledArray.isArray(result)andresult.services— neverresult.value. The function always fell through tocachedServices = [], so the Services tab was permanently empty and all Edit/Delete/Start/Stop/Restart/Kill buttons on that tab were never rendered.Fix: Switched to
service.list_fullwhich returns{ "value": ServiceConfig[] }directly, eliminating the response-shape mismatch and removing N serialservice.getround-trips on every 5-second auto-refresh.Bug 2 — Service control buttons missing for non-running services
renderServices()gated Start/Stop/Restart/Kill buttons onspec.status === 'running' || spec.status === 'start'. Thespec.statusfield is the wanted config state (start,stop,ignore,spec), not the live runtime state — so'running'was never true, and services withstatus: 'stop'showed no control buttons at all.Fix: Removed the conditional. All four control buttons (Start, Stop, Restart, Kill) are now always rendered for every service row. The server handles invalid state transitions gracefully.
Bug 3 — Schedules detail panel had no Edit button
The
viewSchedule()detail panel only had a Close button, with no way to edit a schedule's underlying action.Fix: Added an Edit button to the Schedules detail panel header that calls
editAction(name)to open the action's edit form directly.Files Changed
crates/hero_proc_ui/static/js/dashboard.js— all three fixesValidation
Browser MCP test confirmed:
editAction()