[PATCH] rounding error can corrupt progress bar in milestone_view
|Reported by:||Owned by:|
|Severity:||normal||Keywords:||progressbar roadmap milestone|
Note the progress bar in the bottom right corner of this image:
Despite the fact that there are zero closed tickets, the progress bar shows ~100% are.
If you look at the HTML generated below, you can see that the first TD is getting a negative width. It should actually show "display: none" since there are no "closed" tickets. IE/Chrome/FF all interpret the negative width as ~100% width:
<table class="progress" style="width: 80%"> <tr> <td class="closed" style="width: -1%"> <a href="/test/query?status=closed&group=status&type=defect&milestone=milestone1" title="0/8 closed"></a> </td><td class="new" style="width: 13%"> <a href="/test/query?status=new&group=status&type=defect&milestone=milestone1" title="1/8 new"></a> </td><td class="open" style="width: 88%"> <a href="/test/query?status=assigned&status=accepted&status=reopened&group=status&type=defect&milestone=milestone1" title="7/8 in progress"></a> </td> </tr> </table>
This is easy to reproduce:
- Fire up a new trac test environment
- Append these lines to your trac.ini:
[milestone-groups] closed = closed closed.order = 0 closed.overall_completion = true new = new new.order = 1 new.css_class = new new.label = new new.overall_completion = false active = * active.order = 2 active.css_class = open active.label = in progress
- Write 8 tickets and assign all of them to milestone1.
- "Accept" all but 1 ticket in the tickets' workflow.
- Click on milestone1 from the roadmap.
I think there's an issue with the way that "1 / 8" gets calculated when "overall_completion = false" that may be a separate bug…