Skip to content

Fix AI Assistant modal shaking when content streams in#47616

Open
CGastrell wants to merge 3 commits intotrunkfrom
fix/ai-modal-spacing-and-sticky-header
Open

Fix AI Assistant modal shaking when content streams in#47616
CGastrell wants to merge 3 commits intotrunkfrom
fix/ai-modal-spacing-and-sticky-header

Conversation

@CGastrell
Copy link
Contributor

@CGastrell CGastrell commented Mar 16, 2026

Part of JPAI-95

Fixes a visual issue where the AI Assistant modal would shake/jitter as content streamed in.

Proposed changes

  • Fix modal header spacing (ai-client): The header used -32px negative margins that didn't match the WordPress Modal component's actual 24px content padding, causing layout instability as content changed. Corrected to -24px.
  • Make header sticky (ai-client): Replace the separate <hr> divider element with a border-bottom on the header and add position: sticky so the header stays in place when content scrolls, reducing visual jumpiness.
  • Align consumer components (plugins/jetpack): Update the feedback suggestion and title optimization footer components to use matching -24px margins/padding.
Screen.Recording.2026-03-16.at.17.44.33.mov

Other information

  • Generate changelog entries for this PR (using AI).

Related product discussion/links

p1773669718127489-slack-CDLH4C1UZ

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  1. Open a post in the block editor
  2. Open the AI Assistant from the Jetpack sidebar
  3. Use "Optimize title" or request feedback on the post
  4. Observe the modal as text streams in — it should no longer shake or jitter
  5. If the modal content is long enough to scroll, verify the header stays pinned at the top

CGastrell and others added 2 commits March 16, 2026 17:54
The modal header used -32px negative margins that didn't match the
actual modal padding, causing misalignment. Update to -24px to match
the WordPress Modal component's content padding.

Replace the separate <hr> divider element with a border-bottom on the
header itself, and make the header sticky so it remains visible when
modal content scrolls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update negative margin and padding values from -32px to -24px in the
feedback suggestion and title optimization footer components to match
the corrected modal content padding from the ai-client package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CGastrell CGastrell self-assigned this Mar 16, 2026
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR labels Mar 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/ai-modal-spacing-and-sticky-header branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/ai-modal-spacing-and-sticky-header

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: March 31, 2026
    • Code freeze: March 31, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Mar 16, 2026
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Mar 16, 2026
@jp-launch-control
Copy link

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

Coverage check overridden by Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR [Extension] AI Assistant Plugin [JS Package] AI Client [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA [Status] Needs Review This PR is ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant