|
1 | | -// bark-index.js — Client-side filtering, sorting, URL state, lazy-load closed. |
| 1 | +// bark-index.js -- Client-side filtering, sorting, URL state, lazy-load closed. |
2 | 2 | // Copyright (c) 2026 Bastien Guerry <bzg@gnu.org> |
3 | 3 | // SPDX-License-Identifier: MPL-2.0 |
4 | 4 | // |
5 | 5 | // Expects global objects: |
6 | | -// barkConfig — .types, .total, .openCount, .closedCount, .closedJsonUrl, .pageSize, .sourceType |
7 | | -// barkData — array of report objects (open reports, embedded in page) |
| 6 | +// barkConfig -- .types, .total, .openCount, .closedCount, .closedJsonUrl, .pageSize, .sourceType |
| 7 | +// barkData -- array of report objects (open reports, embedded in page) |
8 | 8 |
|
9 | 9 | var allTypes = barkConfig.types; |
10 | 10 | var activeTypes = {}; |
@@ -584,13 +584,28 @@ function buildRowElement(rpt) { |
584 | 584 | } |
585 | 585 |
|
586 | 586 | var relatedHtml = ''; |
587 | | - if (r.related && r.related.length > 0) { |
588 | | - var mids = r.related.map(function(x) { return x['message-id']; }).filter(Boolean).join(','); |
589 | | - if (mids) { |
590 | | - relatedHtml = '<a class="secondary" href="#" onclick="showRelated(\'m:' + escAttr(mids) + |
591 | | - '\'); return false;" title="Filter related reports" style="font-size:0.75rem">\u21B3' + |
592 | | - r.related.length + ' </a>'; |
| 587 | + // Union of all qualified-relation kinds: a click on this link should |
| 588 | + // filter on every report linked to the current one regardless of how |
| 589 | + // (resolves, supersedes, duplicates, related-to, and their inverses). |
| 590 | + var allRelated = []; |
| 591 | + var seenMids = {}; |
| 592 | + ['resolves', 'resolved-by', |
| 593 | + 'supersedes', 'superseded-by', |
| 594 | + 'duplicates', 'duplicated-by', |
| 595 | + 'related-to'].forEach(function(kind) { |
| 596 | + var entries = r[kind]; |
| 597 | + if (entries && entries.length) { |
| 598 | + entries.forEach(function(e) { |
| 599 | + var mid = e && e['message-id']; |
| 600 | + if (mid && !seenMids[mid]) { seenMids[mid] = 1; allRelated.push(mid); } |
| 601 | + }); |
593 | 602 | } |
| 603 | + }); |
| 604 | + if (allRelated.length > 0) { |
| 605 | + relatedHtml = '<a class="secondary" href="#" onclick="showRelated(\'m:' + |
| 606 | + escAttr(allRelated.join(',')) + |
| 607 | + '\'); return false;" title="Filter related reports" style="font-size:0.75rem">\u21B3' + |
| 608 | + allRelated.length + ' </a>'; |
594 | 609 | } |
595 | 610 |
|
596 | 611 | var eventsHtml = ''; |
@@ -635,9 +650,9 @@ function buildRowElement(rpt) { |
635 | 650 | } |
636 | 651 |
|
637 | 652 | var priLabel = priority === 3 ? 'A' : priority === 2 ? 'B' : priority === 1 ? 'C' : ' '; |
638 | | - var priTitle = priority === 3 ? 'Priority A — urgent and important' |
639 | | - : priority === 2 ? 'Priority B — urgent' |
640 | | - : priority === 1 ? 'Priority C — important' |
| 653 | + var priTitle = priority === 3 ? 'Priority A -- urgent and important' |
| 654 | + : priority === 2 ? 'Priority B -- urgent' |
| 655 | + : priority === 1 ? 'Priority C -- important' |
641 | 656 | : 'No priority'; |
642 | 657 | var isMaint = role === 'maintainer'; |
643 | 658 | var authorInner = isMaint ? '<strong>' + escHtml(author) + '</strong>' : escHtml(author); |
|
0 commit comments