carbonless-review 0.3.0 → 0.4.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.3.0",
3
- "commit": "921b050bd55f574b3441c242b6f0637d643c72ec"
2
+ "version": "0.4.0-rc.2",
3
+ "commit": "c30bb5eb1b3c0676da99c4a3d84235c780f29e48"
4
4
  }
@@ -390,6 +390,22 @@ export function mapThreads(nodes, ctx) {
390
390
  continue;
391
391
  participants.push({ login: name, avatarUrl: str(a.avatarUrl), at });
392
392
  }
393
+ // Who spoke last: the latest published comment (by the cutoff, as
394
+ // `lastActivityAt`), the latest by creation past the listed ones;
395
+ // pending comments left out. The opener when nothing else is known.
396
+ const spoken = [
397
+ ...comments,
398
+ ...(!asOf && latestAt !== null
399
+ ? [{ c: obj(latestNode), at: latestAt }]
400
+ : []),
401
+ ];
402
+ const lastSpoken = spoken.reduce((best, s) => best === null || timeOf(s.at) >= timeOf(best.at) ? s : best, null);
403
+ const lastAuthorNode = lastSpoken ? obj(lastSpoken.c.author) : author;
404
+ const lastAuthor = {
405
+ login: str(lastAuthorNode.login),
406
+ avatarUrl: str(lastAuthorNode.avatarUrl),
407
+ bot: isBotAuthor(lastAuthorNode),
408
+ };
393
409
  const attention = attentionSet({
394
410
  comments: commenters,
395
411
  prAuthor,
@@ -425,6 +441,7 @@ export function mapThreads(nodes, ctx) {
425
441
  bot,
426
442
  avatarUrl: str(author.avatarUrl),
427
443
  participants,
444
+ lastAuthor,
428
445
  // The total, less pending comments (the viewer's), which don't
429
446
  // count; past the listed ones (gh.ts pages them in when there are
430
447
  // more than 100), only the latest can be told. As of a cutoff,
@@ -226,6 +226,7 @@ async function update(target, threadId, nodes, read, commentId) {
226
226
  resolved: thread.resolved,
227
227
  commentCount: thread.commentCount,
228
228
  lastActivityAt: thread.lastActivityAt,
229
+ lastAuthor: thread.lastAuthor,
229
230
  attention: thread.attention,
230
231
  yourTurn: thread.yourTurn,
231
232
  viewerCan: thread.viewerCan,