Type Ahead: Fix ghost text placement and empty-block placeholder overlap#847
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #847 +/- ##
==========================================
Coverage 75.74% 75.74%
Complexity 2088 2088
==========================================
Files 99 99
Lines 8630 8630
==========================================
Hits 6537 6537
Misses 2093 2093
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What, Why, and How?
Closes #846
Type Ahead depends on the current caret position and block focus to decide where a suggestion should appear. When the first empty paragraph is focused while a request is still resolving, Gutenberg can briefly report a caret rectangle outside the editable block. The overlay then trusts that stale or invalid geometry, causing ghost text to render above the title instead of inside the paragraph.
cancelPendingRequest()aborts the active request, but theabilitiesModule.executeAbility()path does not currently honor theAbortControllersignal. That means a cancelled request can still resolve later and apply a stale suggestion after focus has moved, causing ghost text to appear alongside Gutenberg’s placeholder.cancelPendingRequest()needs to also invalidate stale in-flight responses.Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Code review and PR metadata. The changes are tested and reviewed by me.
Testing Instructions
Screencast
screencast.mov
Changelog Entry