#522  Code Comment in Pull Request
Aldy opened 4 months ago


I'm lost at understanding the "Code Comments" feature. What is it exactly and how to use it? I was thinking that it is the same as the comments that you can write during (for example) a Pull Request, but after writing the comments there, and then I open the Code Comments menu (on the navigation bar), it still empty. So, how to use it? is there any documentation? Thanks.

Robin Shen commented 4 months ago

With code comment, you can select any snippet of code from any where (source, diff, pull request changes etc) to start discussion about the code. You may @someone in the comment to notify them.

It also serves as code documentation as it lives through code change, and even file rename.

At my side, added comment will appear in code comments menu, as demonstrated here:


If it does not work at your side, please let me know the detailed reproducing steps.

Aldy commented 4 months ago

Hi @robin,

It works and I can see highlighted comment on my side.

So, in order to do code comment, I have to open the file, and select a portion of the code that I want to comment, then a context menu should appear with the "Add comment to this selection" command. What threw me off is I was trying to comment a Markdown file (trying to comment on one of the lines of an *.md file) and this context menu didn't appear. Probably this is because it has different rendering for *.md files so the context menu wasn't there. No worries, but I think the documentation on how to use the Code Comments can be improved later (may be in one of the Tutorials pages).

And also, when viewed using Mobile browser, the highlighted comment (the purple shade color) not shown on the code. But I think this is still fine, most people open this on laptop while working on the code. Thanks!

Robin Shen changed state to 'Closed' 4 months ago
Previous Value Current Value
Robin Shen commented 4 months ago

That is correct. It only works in source view mode. This is disabled for mobile as comment showing on the side is almost not usable due to screen size.

Robin Shen commented 4 months ago

A workaround to comment on markdown file is to blame it first to enter into source view mode.

issue 1 of 1
Issue Votes (0)
Watchers (3)
issue onedev/server#522
Please wait...
Page is in error, reload to recover