Skip to content

feat(web): add manual context compaction - #109

Open
beilo wants to merge 1 commit into
ygncode:mainfrom
beilo:feat/manual-context-compaction
Open

feat(web): add manual context compaction#109
beilo wants to merge 1 commit into
ygncode:mainfrom
beilo:feat/manual-context-compaction

Conversation

@beilo

@beilo beilo commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Add a manual context-compaction action to the live chat UI.

  • Add a Compact context button to the context-usage popover.
  • Accept /compact and /compact <instructions> in the composer.
  • Route both entry points through POST /api/compact to the pi RPC worker.
  • Reject compaction while the session worker is busy and reload the session after success.
  • Reset context-usage aggregation at the compaction boundary.

Related issue

Related to #41 — Support /compact command through RPC.

This PR covers the core button, composer command, and RPC path. The keyboard shortcut and dedicated Playwright E2E case requested in the issue discussion are not included yet.

Type of change

  • feat — new feature
  • test — adding or updating tests

Live vs. Export

  • Not applicable — this PR doesn't touch session rendering
  • Considered both the live app and the export snapshot
  • Kept internal/ui/embedded/ in sync with web/src/session/ changes
  • No live-only chrome (Vite scripts, active composer, SSE/API) leaked into export

The new action is live-app-only. Export rendering does not expose the composer or compact endpoint.

Testing

  • make check
  • make build
  • Frontend unit tests cover command parsing, API calls, popover behavior, and context reset.
  • Go tests cover the HTTP, worker, and RPC paths.
  • Browser UI verification not run.

daveyijzermans pushed a commit to daveyijzermans/pi-web that referenced this pull request Aug 23, 2026
.project-palette was constrained to min(64vh, 520px) which left
empty space in the fullscreen sheet on mobile (≤900px).
Added mobile media query to stretch palette to 100% height.

Closes ygncode#109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant