Skip to content

fix(banner): show creation banner under GitHub Turbo soft navigation - #23

Merged
leochiu-a merged 2 commits into
mainfrom
claude/pull-request-banner-missing-de71f8
Jul 21, 2026
Merged

fix(banner): show creation banner under GitHub Turbo soft navigation#23
leochiu-a merged 2 commits into
mainfrom
claude/pull-request-banner-missing-de71f8

Conversation

@leochiu-a

@leochiu-a leochiu-a commented Jul 21, 2026

Copy link
Copy Markdown
Owner

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/xxx without a full page reload. As a result, the content script never re-runs initialize(), and checkForPRCreationSuccess() — which reads the prCreationTriggered storage flag — was only wired into initialize(). The banner detection was therefore never triggered on the PR page.

This aligns CreationFeature with CloseFeature, which already re-checks on DOM change.

Key Changes

  • Call checkForPRCreationSuccess() in CreationFeature.onDomChange() (previously only in initialize()), so the creation flag is read on the PR page after Turbo soft navigation.
  • Add a patch changeset.

Safety is preserved by three existing guards: isPullRequestPage() early-return (no-op on the compare page), the orchestrator's bannerShown guard (no duplicate banners), and removal of the storage flag once shown.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • ♻️ Refactoring
  • 🎨 Style/formatting changes
  • 🧪 Test improvements
  • 🔧 Configuration changes

Test Plan

Manual Testing

  • Build the extension (pnpm build) and reload it from dist/ in chrome://extensions.
  • Open a compare page (e.g. /compare/<branch>?expand=1) and reload so the new content script runs.
  • Click Create pull request; on landing on the PR page, the creation banner should appear.
  • Confirm no banner appears prematurely on the compare page itself.

Breaking Changes

None

Notes

  • ApprovalFeature has the same latent structure (onDomChange() does not call checkForPRApprovalSuccess()) and is likely affected by Turbo navigation too, but is intentionally left out of scope for this PR.

Checklist

  • 📝 Code follows style guidelines
  • 👀 Self-review performed
  • 🧪 Tests added/updated
  • 📖 Documentation updated

leochiu-a and others added 2 commits July 21, 2026 09:56
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>
@leochiu-a
leochiu-a merged commit 71c7f63 into main Jul 21, 2026
3 checks passed
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