fix: reload active pr context when readding pat.#51
Merged
knightedcodemonkey merged 2 commits intomainfrom Mar 31, 2026
Merged
Conversation
Owner
knightedcodemonkey
commented
Mar 31, 2026
- fixes Active PR context is not rehydrated after PAT is removed and re-added #41
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes #41 by ensuring that when a user removes their GitHub PAT and later re-adds it, the app preferentially selects the repository that has a saved active PR context, allowing the existing PR verification + push-commit mode rehydration flow to run without manual repo switching.
Changes:
- Add a helper to locate the first writable repository that has a valid saved active PR context in localStorage.
- Update repo auto-selection logic (when no stored selection exists) to prefer the repo with an active PR context.
- Add Playwright coverage for PAT remove → re-add flows (PR open vs PR closed).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/modules/github-pr-drawer.js | Exports findRepositoryWithActivePrContext() to detect which writable repo has an active PR context saved. |
| src/modules/github-byot-controls.js | Uses the new helper to choose the initial repo when no prior repo selection exists (notably after PAT deletion clears selection). |
| playwright/github-pr-drawer.spec.ts | Adds tests validating active PR context rehydration after PAT remove/re-add, including closed-PR deactivation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.