feat: add Clear History button to delete all consumed instructions
- Backend: instruction_service.clear_consumed() bulk-deletes consumed rows - Backend: DELETE /api/instructions/consumed route (preserves pending) - Frontend: Clear button in consumed panel header (hidden when empty) - Frontend: SSE handler for history.cleared event - instant UI update - Frontend: api.clearConsumed() fetch wrapper
This commit is contained in:
@@ -104,6 +104,11 @@ function _handleEvent(event) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'history.cleared': {
|
||||
const next = (state.get('instructions') || []).filter(i => i.status !== 'consumed');
|
||||
state.set('instructions', next);
|
||||
break;
|
||||
}
|
||||
case 'status.changed': {
|
||||
api.status().then(s => state.set('status', s)).catch(console.error);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user