[#115] feat: Workflows tab v0.1 (replace Later)#116
Open
SymbolStar wants to merge 1 commit into
Open
Conversation
Replace the Later icon-rail slot with Workflows (⏰) and add a v0.1 UI
shell backed by the existing openclaw cron CLI. Runtime and jobs.json
schema are untouched; this is purely a read/trigger surface.
Front-end (web/):
- icon rail: only the Later slot is changed (⏰ Workflows, enabled).
Every other tab keeps its icon / order / is-dim state.
- new #workflows-view section with the mock-v0.2-final layout:
sidebar (Failing / Running / All) + main pane (Run activity health
strip, filter chips, 6-col table). Only failed rows get the 3px
danger accent bar; disabled rows use opacity .6; no red row bg.
- new setActive("workflows") branch, hashroute #/workflows, and
routeFromHash dispatch. workflowsView IIFE polls /api/workflows
every 30s while active and re-polls at 3/6/12s after Run Now.
Back-end (server.py + forge_workflows.py):
- GET /api/workflows -> normalized job list from `openclaw
cron list --json`; cron->人话 covers the 5 documented patterns
(每天/工作日/周末) and gracefully falls back to raw expr.
- POST /api/workflows/<id>/run -> shells out to `openclaw cron run`.
CSS: 0 hex literals in the new #workflows-view section (only
semantic tokens --surface-*, --brand-blue*, --ok/warn/danger*,
--text*, --border*, --divider, --closed, --font/--mono, all
already defined for both light + dark).
🤖 bot-review (comment-only · phase 1)Diff: Red-line checks:
Needs human review — these paths are not eligible for future auto-approve:
Phase 2: auto-approve + auto-merge fire only when red-lines are clean, author is internal, and no needs-human path is touched. Block with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #115: replace the Later icon-rail slot with ⏰ Workflows and add a v0.1 UI shell for managing the 20 (mock says 26; live is 20) real jobs in
~/.openclaw/cron/jobs.json. Runtime / jobs.json schema unchanged — this is a pure read + trigger surface backed by the existingopenclaw cronCLI.Closes #115.
Changes
web/index.htmldata-view="workflows",data-enabled="1", ⏰ icon,Workflowslabel. All other tabs (Home / Files / Agents / Activity / More) — same icon, same order, same.is-dim, unchanged.<section id="workflows-view">shell:#wf-sidebar+#wf-main(header, health strip, filter bar, table, legend).web/style.css— appended#workflows-viewblock. 0 hex literals in the new section (verified viaawk '/Workflows tab \(v0.1 UI shell\)/,0' web/style.css | grep -c '#[0-9A-Fa-f]\{6\}'→ 0). Only semantic tokens (--surface-*,--text*,--border*,--divider,--brand-blue*,--ok*,--warn*,--danger*,--closed,--font,--mono), all pre-existing in both light + dark blocks.web/app.jssetActive('workflows')branch + activate/deactivate hooks.routeFromHashdispatch for#/workflows.#/workflows.workflowsViewIIFE: fetches/api/workflows, renders sidebar (Failing / Running / All) + health tiles + filter chips + table; Run Now →POST /api/workflows/<id>/run; 30s poll while active + 3/6/12s re-poll after triggering a run.forge_workflows.py(new)openclaw cron list --jsonand normalizes each job into theNormalizedJobshape from the issue (id/name/agent/enabled/schedule/target/delivery/lastRun).cron → 人话covers 5 patterns (0 H * * *,M H * * *,M H * * 1-5,M H * * 6,0, fallback = raw expr).at → 人话handles future vs past.state.nextRunAtMsfrom the CLI for anything unsupported.sessionTargettruncation (session:…<tail>).error → failed/skipped → okstatus mapping.server.py— two new routes:GET /api/workflowsPOST /api/workflows/<id>/runAcceptance checklist
.is-dimstate preserved (git diff web/index.htmlconfirms one hunk touching lines 65-67).Workflows; selected style comes from the existing.icon-rail-item.is-activerule (unchanged).Run activity · today; all four tiles useX runsunits.cronexpression via.wf-cron-rawtooltip (visibility: hidden→visibleon:hover).<tr class="is-failing">→box-shadow: inset 3px 0 0 var(--danger)on first cell only, no background tint.opacity: .6via.is-disabled./api/workflows/<id>/runand re-polls at 3s / 6s / 12s.:root(light) and the@media (prefers-color-scheme: dark)/[data-theme="dark"]blocks.curl /api/workflowsreturned 20 jobs; first rowmacro-intl-eveningshows工作日 21:00and今天 21:00 · in 1h). Unsupported patterns fall back to the raw expression without crashing.Not verified in this PR
--force-prefers-color-scheme=light, so my "light" screenshots came back visually identical to dark. Settingdata-theme="light"via the in-app theme toggle would render correctly (all tokens are pinned to:rootfallbacks); I just couldn't automate the screenshot from the CLI-only sandbox I had. Flagging honestly per the issue instructions.jobs.jsonon this machine only has 20 enabled+disabled jobs. Not a regression, just a reality check.Local smoke test