Skip to content

PR template fix: Auto-apply the last selected template #9296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2025

Conversation

estib-vega
Copy link
Contributor

The last selected template for the PR is automatically applied on the next time a PR is created

Description

  • Refactored PR template content application to use new PrTemplateStore logic.
  • Updated PrTemplateSection, ReviewCreation, and prContents to integrate with the new store.
  • Implemented async template content fetching for proper default values.
  • Wired template toggle to the new store for seamless template resolution and selection.
  • Enhanced Cypress tests and mocks to cover template enablement, toggling, content persistence, and multi-stack scenarios.
  • Added test IDs for template toggle and improved test environment configuration.

Refactor how default PR template content is applied:
- PrTemplateSection, ReviewCreation, and prContents updated to use the new PrTemplateStore logic.
- Template resolution and selection now flows through the new store, and template toggle is wired accordingly.
- Async template content fetching integrated, supporting proper default values when enabled.

No test changes included in this commit.
Update and extend tests and mocks for revised PR template logic:
- Cypress tests updated to cover template enablement, toggling, content persistence, and multi-stack scenario.
- Mock backend extended for simulating template content/API.
- Test ID added for the template toggle; Toggle component supports test id attr.
- .env adjusted for local test environment compatibility.

No production logic changes in this commit; only supporting/tests.
Copy link

vercel bot commented Jul 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 7, 2025 11:47am
gitbutler-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 7, 2025 11:47am

@estib-vega estib-vega merged commit e908e34 into master Jul 7, 2025
20 checks passed
@estib-vega estib-vega deleted the pr-template-fix branch July 7, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant