Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use dom builder for gutter tooltip and inline widget #5601

Merged
merged 5 commits into from
Jun 27, 2024

Conversation

akoreman
Copy link
Contributor

Issue #, if available: #5575

Description of changes: Changes how we construct the gutter tooltip and inline widget to use the dom building utilities.

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:

Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.78%. Comparing base (e78b1ac) to head (9397ff7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5601      +/-   ##
==========================================
- Coverage   86.79%   86.78%   -0.01%     
==========================================
  Files         594      594              
  Lines       43091    43105      +14     
  Branches     7147     7147              
==========================================
+ Hits        37400    37410      +10     
- Misses       5691     5695       +4     
Flag Coverage Δ
unittests 86.78% <100.00%> (-0.01%) ⬇️

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

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

Copy link
Contributor

@andredcoliveira andredcoliveira left a comment

Choose a reason for hiding this comment

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

Nice

@@ -306,7 +305,7 @@ module.exports = {
}, 50);
}, 50);
},
tearDown: function() {
tearDown: function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a small indentation error was added? Maybe we could add prettier sometime

Suggested change
tearDown: function() {
tearDown: function() {

@@ -395,7 +395,7 @@ module.exports = {
editor.renderer.$loop._flush();
assert.equal(editor.renderer.content.textContent, "abcdefThis is a long test text that is longer than ");

assert.equal(editor.session.lineWidgets[0].el.innerHTML, "<div class=\"ghost_text_line_wrapped\">30 characters</div><div></div><div>Ghost3</div>");
assert.equal(editor.session.lineWidgets[0].el.innerHTML, `<div class="ghost_text_line_wrapped">30 characters</div><div class=""></div><div class="">Ghost3</div>`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Where do the empty classes come from? Are they a consequence of using dom.createElement?

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you confirm whether this was tested manually (e.g., in the kitchen sink) too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the empty classes are a consequence from chunkDiv.className = el.wrapped ? "ghost_text_line_wrapped": "";. I can change it so we only set the classname if it's needed that might be cleaner indeed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you confirm whether this was tested manually (e.g., in the kitchen sink) too?

yes

Screenshot 2024-06-27 at 11 22 21

@akoreman akoreman requested a review from andredcoliveira June 27, 2024 09:24
@akoreman akoreman merged commit e81a299 into ajaxorg:master Jun 27, 2024
3 checks passed
@akoreman akoreman deleted the dom_builder branch June 27, 2024 09:38
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.

3 participants