-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow creation of user annotations based on a selection #4596
Conversation
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.
-
Regarding the button: why not make this a proper FAB? The collapsed version could then expand on mouseover instead of the tooltip now.
-
Would it be possible to also drag the button to select lines? Drag release would then automatically trigger the button click which would be the fasted way to add a multi line comment: big click target to start drag, drag a few lines, release and directly start typing.
-
The background color while selecting is ok, but seems a bit strange after adding the comment. For comments of a substring, I would expect it to mimic the curly underline of the linting comments. For single or multi-line comments it seems very prominent. Alternatives: show something in the margin or show no formatting in the code but add a "comment on line x" "comment on line x to y" to the top of the comment (which is what gitlab does). Mouseover on the line(s) or comment could then show the range using a bg-color.
@bmesuere does the following match your expectations for the FAB buttons: I used the Sidenote: in this pr #4616 I was experimenting with a design that more closely followed the google docs design to work with multiple buttons. Which looked like this: |
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, some nitpicks:
- I think it will look better if you keep the icon left and put the text on the left. Maybe a little css transition to expand the button will also help with the smoothness
- on mouse over, the button in slightly darker (in light mode), however, the little arrow stays in the base color
- dragging the FAB doesn't work for me (chrome). I can drag the button (both in x- and y-direction, where I would expect the x-position to be locked), but when I release it, the button is gone and no form appears. In addition, the button also doesn't show up when I hover over the code. There is no error in the console.
- the default line highlights look more subtle now, well done!
- the darker highlight on mouse over is also very nice!
|
@bmesuere I did not add the transition because I use the display properties right now got the button change, which don't work with css transitions. I will work on this after the release if desired. |
This pull request marks user annotations inside the code. It uses a background instead of a text decoration. This way one machine annotation and one user annotation can be visualized simultaneously. The most important type of each will get priority.
It is possible to mark part of a line, or multiple whole lines. If a line is only partially selected in a multi line selection, the selection will be adjusted to select the whole line.
Examples:
While selecting code, selecting other text or annotations is disabled. This makes it easier to select code across annotations. This also fixes #3976 . It is still possible to select text within an annotation if your selection starts there. Code selections and other selections are differentiated by the selection color and the side button becoming larger.
Using the old create annotation button marks the whole line:
When all annotations are hidden, the marked annotations have tooltips:
Note: Testing was hard as firefox implements selection differently than chrome. The testing framework works similar to chrome, so the firefox code could not be tested.
Closes #3976 and #2826