Add a create-schedule button to the Schedules UI tab #119
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_shrimp#119
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?
Problem
The Library > Schedules tab can list, enable/disable, run-now, and delete schedules, but there is no way to create one from the UI. The empty state just says "Create via schedule.create".
Backend already supports it
The
schedule.createRPC method exists and works (crates/hero_shrimp_server/src/rpc/methods/schedule.rs), and the CLI uses it. Only the web UI is missing the wiring.Proposed fix
Add a "+ new schedule" button to
SchedulesTabincrates/hero_shrimp_web/ui/src/components/LibraryPage.tsx. It opens a small form with:On submit, call
rpc("schedule.create", {...}), then refresh the list. Mirror the existing button/toast patterns in the same component.Acceptance criteria
schedule.createand the new entry appears in the list.Implementation Spec for Issue #119
Objective
Add a "+ new schedule" button and inline form to the
SchedulesTabcomponent so users can create schedules from the Library UI, calling the existingschedule.createRPC and refreshing the list on success. No backend changes required.Requirements
supported_kindsreturned byschedule.list), and description (optional).rpc("schedule.create", {...}), then refresh the list so the new entry appears.btn-ghost,btn-primary,input-base,toast).Files to Modify
crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx— modify theSchedulesTabfunction. Only file changed; no new files, no backend changes. No new imports needed (createSignal,Show,For,rpc,toastalready imported).Implementation Plan
Step 1: Add form state signals
Files:
crates/hero_shrimp_web/ui/src/components/LibraryPage.tsxInside
SchedulesTab, add signals alongside existing ones:showCreate(bool),creating(bool),fName,fCadence,fKind,fDesc(strings). InitializefKindto"job_run".Dependencies: none
Step 2: Add a submit() handler
Files:
crates/hero_shrimp_web/ui/src/components/LibraryPage.tsxModeled on existing
runNow/togglehandlers. Guard empty name/cadence withtoast(..., "bad"). Callrpc("schedule.create", { name, cadence, kind, description })usingcadenceas the param name (matches CLI). On success: success toast, reset fields, hide form,refresh(). On error:toast("create failed: " + (e?.message || e), "bad"). try/catch/finally withcreating(false)in finally.Dependencies: Step 1
Step 3: Add toggle button + inline form
Files:
crates/hero_shrimp_web/ui/src/components/LibraryPage.tsxAdd a "+ new schedule"
btn-ghostbutton in the header summary line (so it shows in both populated and empty states). Add<Show when={showCreate()}>form with name/cadence/kind(select fromsupported()with fallback to the four known kinds)/description inputs and cancel/create footer buttons, mirroring CrewPage form styling but inline.Dependencies: Steps 1, 2
Step 4: Verify build
Run the UI typecheck/build to confirm no type errors.
Dependencies: Steps 1-3
Acceptance Criteria
supported_kinds), and optional description.schedule.createand the new entry appears in the list after refresh.SchedulesTab/CrewPage.Notes
schedule.createparams (fromschedule.rs):name(required), cadence (required; handler acceptscron/expression/cadence— usecadenceto match the CLI),kind(optional, defaults tojob_run),description(optional). Payload:rpc("schedule.create", { name, cadence, kind, description }).supported_kinds:dream,pattern_synthesize,skills_reload,job_run. Already read into thesupported()signal; fall back to this literal list if empty.daily 9am,every 5 minutes) or raw cron. Invalid input returns an error message propagated byrpc()and shown via toast.SchedulesTabdoes not use the genericCatalogList; keep new state local to the function.Test Results
LibraryPage.tsxchanged)Details
Verified that the only modified file is
crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx(no Rust files changed), socargo testwas not run.Ran
npx tsc --noEmitincrates/hero_shrimp_web/ui. Filtering for the changed file (grep -i librarypage) returns no matches, confirmingLibraryPage.tsxcompiles cleanly with no new type errors.The 14 remaining errors are pre-existing and unrelated to this change:
Conclusion: PASS for the scope of this change —
LibraryPage.tsxintroduces no new type errors.Implementation Summary
Added a create-schedule UI to the Library > Schedules tab. No backend changes were needed; the UI now wires up the existing
schedule.createRPC.Changes
crates/hero_shrimp_web/ui/src/components/LibraryPage.tsx(SchedulesTab):supported_kinds, falling back to dream / pattern_synthesize / skills_reload / job_run), and optional description.submit()handler that callsrpc("schedule.create", { name, cadence, kind, description })(using thecadenceparam to match the CLI), shows a success toast, resets the form, and refreshes the list.Acceptance criteria
schedule.createand the new entry appears in the list (via refresh).Tests
tsc --noEmit): 0 errors inLibraryPage.tsx. The only remaining errors are pre-existing and in unrelated files. No Rust files changed.