# HG changeset patch # User Mads Kiilerich # Date 1591909471 -7200 # Node ID d9116644696b3adb2781044f357ceeafe93ac61b # Parent 9038c1a443a08ed97170db9805c7200b9c54df0e diff: allow commenting on meta lines (Issue #329) There is no good reason it only should be possible to comment on content lines. Other lines might not have an obvious locator, but we can live with that as long as each comment only apply in one place. With this, we actually want the comment bubble on all lines with bubble markup, so we can loosen the css selector. diff -r 9038c1a443a0 -r d9116644696b kallithea/front-end/kallithea-diff.less --- a/kallithea/front-end/kallithea-diff.less Thu Jun 11 22:48:50 2020 +0200 +++ b/kallithea/front-end/kallithea-diff.less Thu Jun 11 23:04:31 2020 +0200 @@ -168,10 +168,7 @@ left: -8px; box-sizing: border-box; } -/* comment bubble, only visible when in a commentable diff */ -.commentable-diff tr.line.add:hover td .add-bubble, -.commentable-diff tr.line.del:hover td .add-bubble, -.commentable-diff tr.line.unmod:hover td .add-bubble { +.commentable-diff tr.line:hover td .add-bubble { display: block; z-index: 1; } diff -r 9038c1a443a0 -r d9116644696b kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py Thu Jun 11 22:48:50 2020 +0200 +++ b/kallithea/lib/diffs.py Thu Jun 11 23:04:31 2020 +0200 @@ -77,6 +77,7 @@ }) for file_info in parsed_lines: + count_no_lineno = 0 # counter to allow comments on lines without new/old line numbers for chunk in file_info['chunks']: _html_empty = False for change in chunk: @@ -127,7 +128,13 @@ ########################################################### # NO LINE NUMBER ########################################################### - _html.append('''\t''' % { + anchor = "%(filename)s_%(count_no_lineno)s" % { + 'filename': _safe_id(file_info['filename']), + 'count_no_lineno': count_no_lineno, + } + count_no_lineno += 1 + _html.append('''\t''' % { + 'anchor': anchor, 'olc': no_lineno_class, }) _html.append('''\n''')