Skip to content

Fix autocomplete popup positioning with CSS transforms#5984

Open
cyphercodes wants to merge 2 commits into
ajaxorg:masterfrom
cyphercodes:fix-transformed-autocomplete-popup
Open

Fix autocomplete popup positioning with CSS transforms#5984
cyphercodes wants to merge 2 commits into
ajaxorg:masterfrom
cyphercodes:fix-transformed-autocomplete-popup

Conversation

@cyphercodes

@cyphercodes cyphercodes commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:
Fixes #5688

Description of changes:

  • Position the autocomplete popup using the renderer's CSS-transform coordinate mapper when hasCssTransforms is enabled.
  • Use the transformed line height/ghost-text offset for popup placement decisions so scaled editors anchor the popup next to the transformed cursor.
  • Add regression coverage for transformed popup coordinates.

Verification:

  • npm test -- --grep "popup positioning accounts for editor css transforms"
  • npx mocha ./src/autocomplete_test.js ./src/autocomplete/popup_test.js --exit --color
  • npx eslint src/autocomplete.js src/autocomplete_test.js
  • git diff --check HEAD~1..HEAD

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Pull Request Checklist:

Open kitchen-sink @ 2cc6417e777f1e7a4666da6c86ed13d70a9aa673

Open kitchen-sink @ b399e9431752a2d4a63eceb2c0922df624582077

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.04762% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.70%. Comparing base (f82010e) to head (2cc6417).

Files with missing lines Patch % Lines
src/autocomplete.js 88.46% 3 Missing ⚠️
src/autocomplete_test.js 96.55% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5984      +/-   ##
==========================================
- Coverage   93.73%   93.70%   -0.03%     
==========================================
  Files         641      641              
  Lines      138167   138245      +78     
  Branches    14561    14552       -9     
==========================================
+ Hits       129510   129546      +36     
- Misses       8657     8699      +42     
Flag Coverage Δ
unittests 93.70% <94.04%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cyphercodes

Copy link
Copy Markdown
Contributor Author

Added focused coverage for the transformed ghost-text popup positioning path that Codecov flagged.

Verification:

  • npx mocha ./src/autocomplete_test.js --exit -p --color
  • git diff --check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

completer: popup positioning is wrong for transformed editor

1 participant