picoclaw/web/frontend/src
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
..
api refactor(web): secure Pico websocket access behind launcher auth 2026-04-20 10:11:03 +08:00
components feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
features/chat feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
hooks feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
i18n feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
lib feat(launcher): standard HTTP login/setup/logout flow for dashboard, frontend and backend impl. and fix windows pid lock for ws (#2339) 2026-04-08 21:43:51 +08:00
routes fix(web): restore chat composer disabled-state messaging and clean up code (#2526) 2026-04-15 11:24:27 +08:00
store feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
app-providers.tsx chore(web): move app providers out of main entry 2026-04-15 17:36:22 +08:00
index.css refactor(web): use official highlight themes for markdown 2026-04-15 17:19:48 +08:00
main.tsx chore(web): move app providers out of main entry 2026-04-15 17:36:22 +08:00
routeTree.gen.ts feat(launcher): standard HTTP login/setup/logout flow for dashboard, frontend and backend impl. and fix windows pid lock for ws (#2339) 2026-04-08 21:43:51 +08:00