-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat: summary of annotations in folded lines #5117
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5117 +/- ##
==========================================
+ Coverage 86.79% 86.83% +0.03%
==========================================
Files 558 558
Lines 43611 43718 +107
Branches 6780 6794 +14
==========================================
+ Hits 37853 37962 +109
+ Misses 5758 5756 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
The change of anchor position was accidental in the last pr, but maybe we should keep it aligned to the icon? I think the first one looks better, and it is worth to consider keeping it as is. |
The main problem I noticed was the inconsistency between the anchoring for SVG and PNG icon gutter tooltips so I changed it to be the old/second behavior for both. But I'm also okay with changing it so we will have the first/new behavior for both, agree that the first/new one looks a bit more coherent. |
src/css/editor.css.js
Outdated
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg=="); | ||
background-repeat: no-repeat; | ||
background-position: 2px center; | ||
} | ||
|
||
.ace_gutter-cell.ace_warning, .ace_icon.ace_warning { | ||
.ace_gutter-cell.ace_warning, .ace_gutter-tooltip .ace_icon.ace_warning { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed? We may want to use the icon in other places too, e.g. in documentation tooltip.
src/css/editor.css.js
Outdated
float: left; | ||
} | ||
|
||
.ace_gutter-cell.ace_error, .ace_gutter-tooltip .ace_icon.ace_error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change will break cloud9, because there we use custom gutter cell backgrounds for errors and breakpoints. With this both will be visible.
If the goal is simply to have a node for getting client rect, maybe we can use client rect from element and offset by editor.renderer.$gutterLayer.$padding.left
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to not break c9 🙂 could you explain how this change could affect c9?
I assume they use selectors like .ace_gutter-cell.ace_error
for their custom backgrounds and nothing changes for these selectors. The only change here is that the background set for .ace_icon.ace_error
is now scoped to .ace_gutter-tooltip
(to avoid the background image showing up twice).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, i thought this changes ace to set background on ace_icon
instead of ace_gutter-cell
, which would break the css override in cloud9.
I still think using the value from padding instead of adding a completely empty element would be better, but this may be ok too.
Refactored and simplified the PR a bit. |
I'm working on incorporating this PR into a slightly larger improvement of the gutter tooltip. Setting PR to draft for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, but left some comments: mostly about code style and nitpicks
src/mouse/default_gutter_handler.js
Outdated
var annotation; | ||
|
||
if (annotationsInRow) | ||
annotation = {text: [...annotationsInRow.text], type: [...annotationsInRow.type]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not use code constructs that cannot be efficiently compiled for old browsers, also why do we need to copy the array here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to add an element to the array used to construct the tooltip so I want to copy the array by value. Switched to a different implementation for that to not use spread.
Currently, when there are gutter annotations for lines which are folded away, the gutter annotations are invisible. This change adds a (optional) one-line summary of the annotations in the folded code:
Added as an option to not break existing users who have custom gutter annotation icons in their themes (they would see their custom icons for 'normal' annotations and the default icons for annotations in folds).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.