fix(chrome-ext): shifting highlights after cursor during delay#3446
Merged
Conversation
Member
|
Appreciate it! 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
N/A
Description
This PR fixes stale Chrome Extension highlight positions when lint delay/debounce is enabled and the user edits text before an existing lint.
This issue was brought to my attention by @JasonTheAdams.
The core change adds centralized text-edit span remapping in
lint-framework. During render, stale lint spans are remapped from the lint's original source text to the target's current text. Lints that overlap the edit, or no longer point at the same problem text after remapping, are hidden until the next lint pass.Changes include:
packages/lint-framework/src/lint/spanMapping.tsfor single-edit detection and lint/span remapping.packages/lint-framework/src/lint/LintFramework.tsto remap stale lints during render before computing highlight boxes.LintFrameworkso linting and render-time remapping use the same target text model.Demo
N/A
How Has This Been Tested?
Added Playwright coverage for textarea highlights during lint delay:
AI Disclosure
Checklist