feat(dashboard): make agent card row click-anywhere and Run Now optimistic
- Run Now now optimistically stamps the agent's state to "running" before the startAgentRun API call so the card reacts immediately. Rolls back on error, mirroring the handleStateChange pattern. - Whole .agent-card body is clickable (role=button, Enter/Space, focus ring) and bails when the click landed on an action button, select, or the role-icon so those keep their dedicated behaviors. - Renamed the card's "View Details" button to "Details" and switched .agent-card-actions to flex-wrap: nowrap so Run Now / Pause / Details stay on one row regardless of card width. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
9
.changeset/agent-card-list-ux.md
Normal file
9
.changeset/agent-card-list-ux.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Three small UX fixes on the agent list card.
|
||||
|
||||
- **Optimistic Run Now**: clicking the Run Now button now flips the card's state badge to `running` immediately. The `startAgentRun` API call can take several seconds, and the prior code awaited it before any visual feedback, leaving users unsure whether the click registered. Mirrors the existing `handleStateChange` pattern — stamp the override, await the API, refresh on success, roll back on failure.
|
||||
- **Whole-card clickable**: the entire `.agent-card` body opens the agent detail view, not just the name/icon area. Clicks on action buttons (Run Now, Pause, Details, Delete), the role-edit select, and the role-icon button keep their dedicated behaviors via a target check that bails on interactive descendants. `role="button"`, `tabIndex`, and Enter/Space handling preserve keyboard access; a `--focus-ring` outline shows the focus state.
|
||||
- **Single-row card actions**: renamed "View Details" → "Details" and switched `.agent-card-actions` to `flex-wrap: nowrap` with per-button `flex-shrink: 0; white-space: nowrap` so Run Now / Pause / Details stay on one row regardless of card width.
|
||||
Reference in New Issue
Block a user