feat: RHS panel — persistent Agent Status sidebar

Added a Right-Hand Sidebar (RHS) panel to the Mattermost plugin that
shows live agent activity in a dedicated, always-visible panel.

- New RHSPanel component with SessionCard views per active session
- registerAppBarComponent adds 'Agent Status' icon to toolbar
- Subscribes to WebSocket updates via global listener
- Shows active sessions with live elapsed time, tool calls, token count
- Shows recent completed sessions below active ones
- Responsive CSS matching Mattermost design system

The RHS panel solves the scroll-out-of-view problem: the status
dashboard stays visible regardless of chat scroll position.
This commit is contained in:
sol
2026-03-08 19:55:44 +00:00
parent c36a048dbb
commit f0a51ce411
7 changed files with 363 additions and 4 deletions

View File

@@ -274,9 +274,17 @@ async function startDaemon() {
// Check if this session was previously completed (reactivation after idle)
const completed = completedBoxes.get(sessionKey);
if (completed) {
postId = completed.postId;
// Delete the old buried post and create a fresh one at the current thread position
// so users can see it without scrolling up
try {
await sharedStatusBox.deletePost(completed.postId);
logger.info({ sessionKey, oldPostId: completed.postId }, 'Deleted old buried status box on reactivation');
} catch (err) {
logger.warn({ sessionKey, oldPostId: completed.postId, err: err.message }, 'Failed to delete old status box (may already be deleted)');
}
completedBoxes.delete(sessionKey);
logger.info({ sessionKey, postId }, 'Reactivating completed session — reusing existing post');
// postId stays null — will create a fresh one below
logger.info({ sessionKey }, 'Reactivating session — creating fresh status box');
}
// Check for existing post (restart recovery)