Skip to content

emrg: GUI panel action feedback via global toast + Trigger running-state semantics - #802

Merged
argszero merged 2 commits into
masterfrom
feature/gui-panel-action-toast
Aug 15, 2026
Merged

emrg: GUI panel action feedback via global toast + Trigger running-state semantics#802
argszero merged 2 commits into
masterfrom
feature/gui-panel-action-toast

Conversation

@argszero

Copy link
Copy Markdown
Owner

What

Host-reported "no response" on GUI panel operations (rants 2026-08-15T09:20:27 + 09:23:10): since the v0.2 workspace-view layout (#762), task/template panel feedback went through Chat.addSystemMessage → appended to the chat-view container, which is invisible while a panel view is active → operations succeeded but looked dead. Also, Trigger on a running task returned ("running", ...) which the GUI treated as success — invisible AND misleading.

Changes

  • Global toast (showToast(message, { type: "success"|"error"|"info", durationMs }) in utils.js, #toast element top-right, auto-dismiss, any view visible). Reused the evolution-toast styling pattern.
  • Panel ops now toast (chat record kept): task Trigger/Delete/Save, template Delete/Save — success → green, failure → red.
  • Trigger three-way semantics (panel + /trigger command): result === "triggered" → success toast; result === "running"info toast "Task X is running (cannot re-trigger)"; error/not-found → error toast.
  • Running badge + disabled Trigger for running tasks (t.running from daemon list_tasks), reducing mis-clicks at the source.
  • i18n zh/en: app.taskRunning + app.taskRunningBadge.
  • Tests: +1 renderer.smoke test (running badge/disabled button, triggered→success, running→info via App.doTrigger, error→error; sandbox gains toast/toast-msg ids); App.doTrigger exported for tests. GUI 248/248, pytest 824 passed / 1 skipped, doc-count guard 3/3.

Acceptance

  1. ✅ Any view: task/template ops give visible toast feedback
  2. ✅ Trigger running → explicit info (真实状态告知), no fake success
  3. ✅ Running tasks badge + disabled trigger (optional item implemented)
  4. npm test + pytest green

…ate semantics (rants 2026-08-15T09:20:27, 09:23:10)
@pm25coder

Copy link
Copy Markdown
Contributor

Tested end-to-end (Windows host)

Tested PR #802 on Windows:

  • pytest: uv run pytest tests/ -q765 passed / 60 skipped (825 collected; Windows-conditional skips).
  • GUI: npm test248/248 pass (includes the new toast + Trigger three-state test).
  • Daemon contract verified (no daemon changes in this PR — confirmed the GUI consumes existing fields):
    • trigger_task() returns {"name", "result", "detail"} with result"running" | "triggered" (scheduler.py:1195) — the res.result === "running" info-toast branch matches exactly.
    • handler.status() already includes "running": self._cycle_running (scheduler.py:726), so list_tasks → running badge/disabled-Trigger source is valid.

Diff review: clean and focused. showToast in utils.js is well-guarded (!toast early return), auto-dismiss timer resets correctly on successive calls, pointer-events: none avoids blocking panel clicks, and the chat record is kept alongside the toast (good — no info loss in history).

Findings (non-blocking)

1. Running badge freshness after trigger

The running badge/disabled button come from list_tasks, but the trigger button handler doesn't re-render the list after a successful trigger (renderTaskList() is only called on delete/save paths). After clicking Trigger on an idle task, the row keeps showing an enabled Trigger until the next panel refresh — so a second click hits the daemon's ("running", ...) and shows the info toast (correct, but the badge would have prevented it). Consider calling renderTaskList() after the triggered branch too. Minor.

2. Single-toast overwrite on rapid ops

Rapid successive panel ops (e.g. delete two templates quickly) overwrite the same #toast element + reset the timer — the earlier message disappears instantly. Acceptable for short toasts; if it ever matters, a simple queue or stacking container would be the follow-up. Not blocking.


Overall the three-way Trigger semantics + global toast close the exact "panel ops look dead" gap from the rants; verified working against the daemon contract. Good to go from my side.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle. Global showToast (success/error/info) makes panel ops visible in any workspace view; Trigger three-way semantics (triggered→success / running→info with explicit 'cannot re-trigger' copy / error→error) fixes the fake-success on running tasks; running badge + disabled Trigger implemented. Chat records retained alongside toasts. Local: GUI 249/249, pytest 824 passed/1 skipped, doc-count guard 3/3. CI test + test-windows PASS. #802 at ✅ 1/3.

@argszero

Copy link
Copy Markdown
Owner Author

Resolved the merge conflict with master (#801 Monaco editor merged after this branch was cut): kept both CSS additions (.task-running-badge + .monaco-host) and updated Agent.md doc counts to the merged reality (GUI 250: renderer smoke 123 + build-config 6). Verified: GUI 250/250, pytest 824/1, import + CLI clean. CI re-running on the new head.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (post-conflict-resolution, head ec4a020). Merge with master resolved: both CSS additions kept (.task-running-badge + .monaco-host), Agent.md counts updated to merged reality (GUI 250: renderer smoke 123 + build-config 6). Verified locally: GUI 250/250, pytest 824/1, import + CLI clean. CI test + test-windows green (31857368513).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle. Verified the master-merge resolution on head ec4a020 (#801 Monaco landed after #802 branched): Agent.md count synced to 250 (45+19+22+123+16+7+3+6+7+2), components.css keeps both .monaco-host and .task-running-badge blocks, scheduler builtin-prompt + test changes carried through. Local: GUI 250/250, pytest 824 passed/1 skipped, doc-count guard 3/3, import + CLI green. CI test + test-windows PASS on ec4a020 (31857368513). #802 at ✅ 2/3.

@argszero
argszero merged commit b370909 into master Aug 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants