Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-16580-viewer-signoff-match.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity Monitor: a sign-off question naming `@clubanderson-bot` or `@clubandersonx` no longer reads "needs your sign-off" to the viewer `clubanderson`; the viewer's handle is matched on a word boundary.
2 changes: 2 additions & 0 deletions src/pkg/dashboard/stage_tracker_activity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ test('#16484: count grammar โ€” CI passed/total and Review done/total across eve
try {
assert.equal(review('human_decision', {}, { decision_needed: { question: '@clubanderson should decide whether to accept this workflow change from a fork.' } }), 'Review 3/5 ยท needs your sign-off', 'the ask names the viewer');
assert.equal(review('human_decision', {}, { decision_needed: { question: '@someone-else should decide.' } }), 'Review 3/5 ยท needs owner sign-off');
for (const q of ['@clubanderson-bot should decide.', '@clubandersonx should decide.']) assert.equal(review('human_decision', {}, { decision_needed: { question: q } }), 'Review 3/5 ยท needs owner sign-off', 'a longer login is not the viewer: ' + q);
for (const q of ['@clubanderson', 'ping @clubanderson, please decide.', 'ok @ClubAnderson?']) assert.equal(review('human_decision', {}, { decision_needed: { question: q } }), 'Review 3/5 ยท needs your sign-off', 'the viewer handle ends at punctuation or the end: ' + q);
} finally { delete globalThis.window; }
assert.equal(review('reviewing', { actor: 'reviewer-2' }), 'Review 3/5 ยท reviewer-2 reviewing');
assert.equal(review('adjudicating', { actor: 'adjudicator' }), 'Review 3/5 ยท adjudicator reviewing');
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/static-src/js/tracker-row-strip.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
if (stageTrackerHiveOwnsRepair(item)) return count + ' ยท changes requested';
const q = item.decision_needed && item.decision_needed.question ? String(item.decision_needed.question).toLowerCase() : '';
const me = typeof window !== 'undefined' && window._hiveUser ? String(window._hiveUser).toLowerCase() : '';
const mine = !!me && q.indexOf('@' + me) >= 0;
const mine = !!me && new RegExp('@' + me.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '(?![\\w-])').test(q);
return count + (mine ? ' ยท needs your sign-off' : ' ยท needs owner sign-off');
}
case 'reviewing': case 'adjudicating': return count + ' ยท ' + (actor ? actor + ' reviewing' : 'reviewing');
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18188,7 +18188,7 @@ <h3 class="faq-group-title">Where to get help</h3>
if (stageTrackerHiveOwnsRepair(item)) return count + ' ยท changes requested';
const q = item.decision_needed && item.decision_needed.question ? String(item.decision_needed.question).toLowerCase() : '';
const me = typeof window !== 'undefined' && window._hiveUser ? String(window._hiveUser).toLowerCase() : '';
const mine = !!me && q.indexOf('@' + me) >= 0;
const mine = !!me && new RegExp('@' + me.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '(?![\\w-])').test(q);
return count + (mine ? ' ยท needs your sign-off' : ' ยท needs owner sign-off');
}
case 'reviewing': case 'adjudicating': return count + ' ยท ' + (actor ? actor + ' reviewing' : 'reviewing');
Expand Down
Loading