Skip to content

fix: add retry for appending existing subtitle to iframed editor#2681

Open
laurelfulford wants to merge 3 commits intotrunkfrom
fix/subtitle-not-showing-in-editor-NEWS-1761
Open

fix: add retry for appending existing subtitle to iframed editor#2681
laurelfulford wants to merge 3 commits intotrunkfrom
fix/subtitle-not-showing-in-editor-NEWS-1761

Conversation

@laurelfulford
Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR adds a timed retry to attach the subtitle to the post title when populated. Otherwise, in WP 7.0 posts with a populated subtitle don't actually preview them in the editor until they're edited again.

Closes NEWS-1761

How to test the changes in this Pull Request:

  1. On a test site running the latest WP 7.0 RC, create a post with a subtitle, publish, and refresh the editor.
  2. Note that your subtitle doesn't show initially; try editing it and note it appears.
  3. Apply this PR, and refresh the editor. Confirm that the subtitle now shows on load, and updates as usual when you change the text.
  4. Smoketest the PR on a site running WP 6.9, just in case.

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?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a timed retry mechanism to ensure an existing post subtitle is appended beneath the post title in the (WP 7.0+) iframed editor, addressing cases where the title wrapper isn’t available immediately on load.

Changes:

  • Extend appendSubtitleToTitleDOMElement with a bounded retry loop (100ms intervals, up to 20 attempts) when the title wrapper element isn’t yet present in the editor canvas.
  • Update JSDoc for the DOM-append helper to include the internal retry counter parameter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread newspack-theme/js/src/post-subtitle/utils.js Outdated
Comment thread newspack-theme/js/src/post-subtitle/utils.js Outdated
@laurelfulford laurelfulford marked this pull request as ready for review April 15, 2026 16:27
@laurelfulford laurelfulford requested a review from a team as a code owner April 15, 2026 16:27
@laurelfulford laurelfulford added the [Status] Needs Review The issue or pull request needs to be reviewed label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The issue or pull request needs to be reviewed wp 7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants