fix(banner): show creation banner under GitHub Turbo soft navigation - #23
Merged
Merged
Conversation
GitHub's compare form now submits via Turbo (soft navigation), so the PR page is never fully reloaded and CreationFeature.initialize() does not re-run. Move checkForPRCreationSuccess() into onDomChange() as well, mirroring CloseFeature, so the stored creation flag is read on the PR page and the banner shows. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
The "Create pull request" banner stopped appearing after creating a PR from the compare page. GitHub now submits the compare form via Turbo (Hotwire) soft navigation (
data-turbo), so the browser jumps to/pull/xxxwithout a full page reload. As a result, the content script never re-runsinitialize(), andcheckForPRCreationSuccess()— which reads theprCreationTriggeredstorage flag — was only wired intoinitialize(). The banner detection was therefore never triggered on the PR page.This aligns
CreationFeaturewithCloseFeature, which already re-checks on DOM change.Key Changes
checkForPRCreationSuccess()inCreationFeature.onDomChange()(previously only ininitialize()), so the creation flag is read on the PR page after Turbo soft navigation.patchchangeset.Safety is preserved by three existing guards:
isPullRequestPage()early-return (no-op on the compare page), the orchestrator'sbannerShownguard (no duplicate banners), and removal of the storage flag once shown.Type of Change
Test Plan
Manual Testing
pnpm build) and reload it fromdist/inchrome://extensions./compare/<branch>?expand=1) and reload so the new content script runs.Breaking Changes
None
Notes
ApprovalFeaturehas the same latent structure (onDomChange()does not callcheckForPRApprovalSuccess()) and is likely affected by Turbo navigation too, but is intentionally left out of scope for this PR.Checklist