[Session] Frontend — "Clear history" button in session panel #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add a "Clear history" affordance inside the Workshop session panel (the-matrix UI). When clicked it calls the
DELETE /api/sessions/:id/historyendpoint from #40 and shows a brief confirmation.Depends on: #40 (clear endpoint)
Why
Users may want to start a fresh context mid-session (e.g., switching topics) without having to fund a new session. The button gives them explicit control without touching balance or expiry.
Placement
Inside the active-session step (
[data-session-step="active"]) inthe-matrix/index.html, add a small button below the current balance display:Style it as a muted secondary link-style button (no background, small text, same family as other session panel links).
JavaScript (
the-matrix/js/session.js)initSessionPanel(), wire up the button:_clearHistory():UX details
_sessionState === "active"or"paused"(controlled by_applySessionUI())appendSystemMessage) — no need to wipe the UI event logRelevant files
the-matrix/index.htmlthe-matrix/js/session.jsAcceptance
DELETE /api/sessions/:id/historywith the macaroonPR created: #74
Added a "🗑 Clear history" link-style button in the active session panel step. It sends
DELETE /api/sessions/:id/historywith the macaroon, shows a green "✓ History cleared" confirmation for 2.5s on success, and displays error status on failure. Button is disabled during the request and only visible when the active session step is shown.