feat: github pr context sync with push and close. - #40
Conversation
There was a problem hiding this comment.
Pull request overview
Adds “active PR context” behavior to the GitHub PR drawer so the app can (a) restore an existing PR context from localStorage, (b) push commits to the saved PR head branch, (c) sync editor content from the PR branch, and (d) close out the active PR context via UI controls—supporting the broader AI-sidepanel + GitHub workflow from #18.
Changes:
- Persist/restore an “active PR context” and switch the PR drawer into a “Push commit” mode when one is present.
- Add GitHub API support for PR lookup/closure and for fetching file content to sync editors from the active PR branch.
- Update UI + Playwright coverage for push/close/sync indicators and the new flows.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/panels-editor.css | Adds header layout + sync icon styling for editor panels. |
| src/styles/ai-controls.css | Styles the new “close PR context” control in the toolbar. |
| src/modules/render-runtime.js | Adds in-flight render queueing to avoid overlapping renders. |
| src/modules/github-pr-editor-sync.js | New controller to fetch PR-branch file contents and apply to editors. |
| src/modules/github-pr-drawer.js | Major logic update: active PR context detection, push-commit flow, context verification, and PR closing API call. |
| src/modules/github-pr-context.js | New helpers to parse/format PR references and derive sync keys. |
| src/modules/github-api.js | Adds PR close/get/find-by-head APIs and repo file content fetching; refactors commit flow to support “push commit”. |
| src/index.html | Adds toolbar “close context” button and editor sync icons; adds ids used by UI wiring/tests. |
| src/app.js | Wires new active-context UI state, sync indicators, PR context close action, and render mode restore. |
| playwright/helpers/app-test-helpers.ts | Updates Open PR drawer helpers to accommodate new UI/state changes. |
| playwright/github-pr-drawer.spec.ts | Adds coverage for active context restore, push-commit flow, PR close, and editor sync from branch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Another addition to #18