picoclaw/web/frontend/src/features/chat
Guoguo 6ca7311273
feat(agent): add context usage ring indicator and /context command (#2537)
Add a context window usage indicator to the web chat UI and a /context
slash command that works across all channels.

Backend:
- Add computeContextUsage() estimating history + system + tool tokens
- Attach ContextUsage to outbound messages via the pico WebSocket protocol
- Add /context command showing context stats as formatted text
- Add EstimateSystemTokens() on ContextBuilder for system prompt estimation

Frontend:
- Add ContextUsageRing component (SVG ring + hover/tap popover)
- Show usage percentage, token counts, and compression threshold
- Hover on desktop (150ms leave delay), tap on mobile
- "View Details" sends /context with 1s cooldown
- i18n support (en/zh) for popover labels

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 16:30:02 +08:00
..
controller.ts feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
history.ts fix(pico): separate thought and normal messages 2026-04-10 20:23:12 +08:00
protocol.ts feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
state.ts fix(web): refactor pico chat flow and fix proxied websocket URLs (#1639) 2026-03-16 16:25:16 +08:00
websocket.ts feat(web): protect launcher dashboard with token and SPA login (#1953) 2026-03-29 13:11:43 +08:00