picoclaw/web/frontend
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
..
public feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
scripts build: use WEB_GO for web targets and preserve backend dist directory (#1671) 2026-03-17 15:23:49 +08:00
src feat(agent): add context usage ring indicator and /context command (#2537) 2026-04-21 16:30:02 +08:00
.editorconfig feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
.gitignore fix(web): render ansi logs with wrapped lines (#1425) 2026-03-12 19:12:19 +08:00
.prettierignore feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
components.json feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
eslint.config.js chore(web): update linting and router dependencies (#2592) 2026-04-20 11:18:42 +08:00
index.html feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
package.json chore(web): update linting and router dependencies (#2592) 2026-04-20 11:18:42 +08:00
pnpm-lock.yaml chore(web): update linting and router dependencies (#2592) 2026-04-20 11:18:42 +08:00
prettier.config.js feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
tsconfig.app.json feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
tsconfig.json feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
tsconfig.node.json feat(web): migrate launcher to modular web frontend/backend and improve management UX (#1275) 2026-03-09 19:42:03 +08:00
vite.config.ts refactor(web): secure Pico websocket access behind launcher auth 2026-04-20 10:11:03 +08:00