Skip to content

feat: github pr context sync with push and close. - #40

Merged
knightedcodemonkey merged 4 commits into
mainfrom
bananas
Mar 29, 2026
Merged

feat: github pr context sync with push and close.#40
knightedcodemonkey merged 4 commits into
mainfrom
bananas

Conversation

@knightedcodemonkey

Copy link
Copy Markdown
Owner

Another addition to #18

Copilot AI review requested due to automatic review settings March 29, 2026 01:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread playwright/helpers/app-test-helpers.ts Outdated
Comment thread playwright/helpers/app-test-helpers.ts Outdated
Comment thread playwright/helpers/app-test-helpers.ts Outdated
Comment thread src/app.js Outdated
Comment thread src/modules/github-pr-drawer.js
Comment thread src/modules/render-runtime.js Outdated
Comment thread src/modules/github-api.js
Copilot AI review requested due to automatic review settings March 29, 2026 01:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/app.js
Comment thread playwright/github-pr-drawer.spec.ts Outdated
@knightedcodemonkey
knightedcodemonkey merged commit 1623e6d into main Mar 29, 2026
1 check passed
@knightedcodemonkey
knightedcodemonkey deleted the bananas branch March 29, 2026 02:07
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.

2 participants