Edgewall Software

Ticket #7075 (closed enhancement: fixed)

Opened 9 months ago

Last modified 7 months ago

Add ticket comment number to comment header line

Reported by: Norbert Unterberg <nunterberg@…> Owned by: cboos
Priority: normal Milestone: 0.12
Component: ticket system Version:
Severity: normal Keywords:
Cc:

Description

When a ticket comment was added by clicking on the "Reply" button of an existing comment, the new comment's header has the note "in reply to: 13". But since ticket comments do not display the comment number, I have no chance to find comment 13 except I click on the link.

I think it would be a good idea to add the comment number/ID to each comment header line. I then have a chance to follow discussions, even on paper after I do a printout of the ticket.

Attachments

Change History

  Changed 9 months ago by cboos

  • milestone set to 0.11.1

For printouts, yes, that's a good point.

Let's see if it doesn't clutter the screen too much, so maybe we can have it for the normal display as well.

  Changed 7 months ago by jsiirola@…

This is something that I have also wanted (in fact, I just hacked it into the ticket.cs for my production 0.10.4 system).

The other significant use is that when someone refers to a comment (e.g. comment:1), there is no reliable way either to create that reference or to identify the referenced comment without counting them or mousing over each permalink. On systems with large monitors/small fonts, simply clicking on the TracLink does not guarantee that the referenced comment will be at the top of the screen (i.e. if it is toward the bottom of the list of comments).

Looking at the new templates, shouldn't implementing this be as easy as adding

${change.cnum}:

to the beginning of ticket.html line 221? I certainly don't think that something so unobtrusive would clutter things up.

follow-up: ↓ 4   Changed 7 months ago by osimons

  • owner changed from cboos to osimons
  • milestone changed from 0.11.2 to 0.11.1

Agree that comments should have some sort of visible ID in all situations, and just prefixing the 'Changed...' line with the comment number works quite well.

Objections or alternative proposals?

in reply to: ↑ 3 ; follow-up: ↓ 5   Changed 7 months ago by cboos

Alternative proposal:

  • trac/ticket/templates/ticket.html

     
    2323      jQuery(document).ready(function($) { 
    2424        $("div.description").find("h1,h2,h3,h4,h5,h6").addAnchor("Link to this section"); 
    2525      <py:when test="ticket.exists"> 
    26         $("#changelog h3.change").addAnchor("Link to this change"); 
     26        $("#changelog h3.change span.cnum").addAnchor("Link to this change"); 
    2727 
    2828        /* only enable control elements for the currently selected action */ 
    2929        var actions = $("#action input[name='action']"); 
     
    202202          <div id="changelog"> 
    203203            <form py:for="change in changes" method="get" action="#comment" class="printableform"> 
    204204              <div class="change"> 
    205                 <h3 class="change" id="${'cnum' in change and 'comment:%d' % change.cnum or None}"> 
    206                   <span class="threading" py:if="replies and 'cnum' in change" 
     205                <h3 class="change"> 
     206                  <span class="threading" py:if="'cnum' in change" 
    207207                        py:with="change_replies = replies.get(str(change.cnum), [])"> 
     208                    <span id="${'cnum' in change and 'comment:%d' % change.cnum or None}" class="cnum">comment:$change.cnum</span> 
    208209                    <py:if test="change_replies or 'replyto' in change"> 
    209210                      <py:if test="'replyto' in change"> 
    210211                        in reply to: ${commentref('&uarr;&nbsp;', change.replyto)} 

This should look better than the number prefix and is also a reminder or hint about the comment: TracLinks syntax. Putting the number in the threading span makes sense, as you will see things like: "comment:4 in reply to 3".

in reply to: ↑ 4   Changed 7 months ago by osimons

Replying to cboos:

Alternative proposal:

Looks good as well. Commit, please :-)

  Changed 7 months ago by cboos

Well, the right alignment is not perfect, I need to fix it first.

  Changed 7 months ago by cboos

  • owner changed from osimons to cboos
  • status changed from new to assigned
  • milestone changed from 0.11.1 to 0.12

Ok, I have a better solution now. However, as this is an enhancement which changes the look and feel of the ticket history in quite visible way, it shouldn't go in 0.11.x.

  Changed 7 months ago by cboos

  • status changed from assigned to closed
  • resolution set to fixed

Implemented in [7255].

Add/Change #7075 (Add ticket comment number to comment header line)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cboos. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.