Show real-time feedback in the browser as Claude processes commands — progress states in the sidebar and snackbar notifications on completion/failure.
Command Status Polling
Poll GET /wpce/v1/commands?post_id={current}&since={last_check} from the browser to track active command status changes. Polling interval:
- Every 2s while a command is running
- Every 10s when idle (to catch status updates from commands submitted in other tabs)
- Stop polling when no recent commands exist
Sidebar: Command History
List of recent commands in the AI Actions sidebar panel with status indicators:
- Pending — clock icon, "Waiting for Claude..."
- Claimed/Running — spinner, "Claude is working..."
- Completed — checkmark, "Done"
- Failed — X icon, error message from the
message field
- Expired — clock icon, "Timed out"
- Cancelled — dash icon, "Cancelled"
Running commands show a cancel button. History is scoped to the current post and current session (no need to persist across page reloads beyond what the REST API returns).
Snackbar Notifications
Use @wordpress/notices to show snackbar notifications:
- Completed: "Claude finished proofreading your post." / "Claude finished reviewing your post." (message varies by prompt type)
- Failed: "Claude couldn't complete the review: [message]"
- Expired: "Command timed out — Claude may not be connected."
Notifications should not stack — if multiple commands complete in quick succession, show the most recent.
Acceptance Criteria
Part of #28.
Show real-time feedback in the browser as Claude processes commands — progress states in the sidebar and snackbar notifications on completion/failure.
Command Status Polling
Poll
GET /wpce/v1/commands?post_id={current}&since={last_check}from the browser to track active command status changes. Polling interval:Sidebar: Command History
List of recent commands in the AI Actions sidebar panel with status indicators:
messagefieldRunning commands show a cancel button. History is scoped to the current post and current session (no need to persist across page reloads beyond what the REST API returns).
Snackbar Notifications
Use
@wordpress/noticesto show snackbar notifications:Notifications should not stack — if multiple commands complete in quick succession, show the most recent.
Acceptance Criteria
@wordpress/datastore from AI Actions sidebar panel #32Part of #28.