Skip to content
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

feat: add corrections customize settings #3751

Merged
merged 4 commits into from
Feb 26, 2025

Conversation

Takshil-Kunadia
Copy link
Collaborator

All Submissions:

Changes proposed in this Pull Request:

  • Add a new Panel and global customizer setting “Corrections Location” (with options “Top” and “Bottom”).
  • Fix a edge case in Correction Modal.

Closes # .

How to test the changes in this Pull Request:

  1. Open the WordPress Customizer and Load a single post in the theme.
  2. Open Template Settings > Correction Settings > Corrections & Clarifications, and check the Radio buttons Top & Bottom to see the impact.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@Takshil-Kunadia
Copy link
Collaborator Author

Takshil-Kunadia commented Feb 14, 2025

@leogermani
Currently, if corrections are enabled and present, they are automatically appended to the post content. However, we are not providing users with an option to enable or disable corrections per post, as was originally intended by:

const CORRECTIONS_ACTIVE_META = 'newspack_corrections_active';

Would you like me to add a UI option to enable/disable corrections for individual posts?

Additionally, if we proceed with this implementation, corrections will be appended to all posts by default. This might not be ideal for users who may want to use blocks we are going to create via https://app.asana.com/0/1209292256643614/1209292256643625.

Would it make sense to introduce a separate setting in the modal for "Enable/Disable auto-inserting corrections" so users can choose whether corrections should be automatically appended? We could reuse(and rename it) CORRECTIONS_ACTIVE_META for this, but I wanted to check with you first—should we manage "enable/disable corrections" and "auto-insert corrections" separately, or should they share the same meta field?

@leogermani
Copy link
Contributor

should we manage "enable/disable corrections" and "auto-insert corrections" separately, or should they share the same meta field?

As @laurelfulford suggested here, let's only filter into the_content if the active theme is not a block theme

@Takshil-Kunadia Takshil-Kunadia force-pushed the feature/correction-customize-settings branch from f1682bb to 1a54cbb Compare February 25, 2025 07:47
@Takshil-Kunadia Takshil-Kunadia marked this pull request as ready for review February 25, 2025 09:41
@Takshil-Kunadia Takshil-Kunadia requested a review from a team as a code owner February 25, 2025 09:41
@github-actions github-actions bot added the [Status] Approved The pull request has been reviewed and is ready to merge label Feb 26, 2025
Copy link
Member

@naxoc naxoc left a comment

Choose a reason for hiding this comment

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

This looks good 👍 I tested "Open Template Settings > Correction Settings > Corrections & Clarifications" and it works great. It's not under Template Settings, but directly under "Corrections Settings", but I also think that makes more sense.

@Takshil-Kunadia
Copy link
Collaborator Author

Thanks! @leogermani @naxoc for taking a look 🙇 . Merging this PR 🚀

@Takshil-Kunadia Takshil-Kunadia merged commit 11dbc5e into trunk Feb 26, 2025
9 checks passed
@Takshil-Kunadia Takshil-Kunadia deleted the feature/correction-customize-settings branch February 26, 2025 15:13
Copy link

Hey @Takshil-Kunadia, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request Feb 27, 2025
# [6.0.0-alpha.2](v6.0.0-alpha.1...v6.0.0-alpha.2) (2025-02-27)

### Bug Fixes

* **memberships:** ensure user membership is linked to the correct subscription ([#3768](#3768)) ([a942616](a942616))
* undo forcing WC order attribution to off ([#3771](#3771)) ([c9cb52a](c9cb52a))
* **woo:** page template meta leaking to other types ([#3782](#3782)) ([325a21c](325a21c))

### Features

* add corrections customize settings ([#3751](#3751)) ([11dbc5e](11dbc5e))
* **corrections:** Unit tests for Corrections functionality ([#3776](#3776)) ([ae58933](ae58933))
* **my-account:** add change email template ([#3772](#3772)) ([32bef3c](32bef3c))
* **my-account:** add pending email change state ([#3763](#3763)) ([c9ba046](c9ba046))
* **my-account:** verify email change ([#3764](#3764)) ([b50c980](b50c980))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 6.0.0-alpha.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants