@in-the-loop-labs/pair-review 5.3.6 → 5.4.0

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.
Files changed (41) hide show
  1. package/README.md +8 -0
  2. package/package.json +3 -3
  3. package/plugin/.claude-plugin/plugin.json +1 -1
  4. package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
  5. package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
  6. package/public/css/pr.css +407 -13
  7. package/public/js/components/AIPanel.js +323 -104
  8. package/public/js/components/ReviewHistoryModal.js +294 -0
  9. package/public/js/components/ReviewModal.js +131 -14
  10. package/public/js/components/SplitButton.js +14 -0
  11. package/public/js/local.js +4 -8
  12. package/public/js/modules/comment-manager.js +6 -12
  13. package/public/js/modules/comment-minimizer.js +4 -1
  14. package/public/js/modules/file-comment-manager.js +38 -74
  15. package/public/js/modules/pierre-bridge.js +36 -0
  16. package/public/js/modules/suggestion-manager.js +4 -1
  17. package/public/js/pr.js +337 -191
  18. package/public/js/utils/posted-comment.js +326 -0
  19. package/public/js/vendor/pierre-diffs-worker.js +41 -13485
  20. package/public/js/vendor/pierre-diffs.js +131 -1364
  21. package/public/local.html +1 -0
  22. package/public/pr.html +2 -0
  23. package/src/chat/api-reference.js +22 -2
  24. package/src/config.js +28 -4
  25. package/src/database.js +177 -35
  26. package/src/github/client.js +95 -16
  27. package/src/github/impl/graphql/pending-review-comments.js +118 -14
  28. package/src/github/impl/graphql/pending-review.js +8 -2
  29. package/src/github/impl/graphql/review-comment-edit.js +89 -0
  30. package/src/github/impl/host/pending-review-comments.js +41 -10
  31. package/src/github/impl/host/review-comment-edit.js +36 -0
  32. package/src/github/impl/rest/pending-review.js +6 -2
  33. package/src/github/impl/rest/review-comment-edit.js +44 -0
  34. package/src/github/impl/review-comment-edit-utils.js +45 -0
  35. package/src/github/operations/pending-review.js +4 -3
  36. package/src/github/operations/review-comment-edit.js +35 -0
  37. package/src/github/record-submission.js +78 -0
  38. package/src/github/update-posted-comment.js +115 -0
  39. package/src/main.js +24 -38
  40. package/src/routes/mcp.js +1 -0
  41. package/src/routes/pr.js +152 -100
package/README.md CHANGED
@@ -902,6 +902,14 @@ The markdown includes file paths, line numbers, and your comments - everything t
902
902
  - Edit or discard AI suggestions before finalizing
903
903
  - Comments include file and line number for precision
904
904
 
905
+ ### Posted Comments and Review History
906
+
907
+ In PR mode, editing a comment you've already posted marks it **Edited since posted**. Choose **Update on GitHub** to update that same comment in place, including comments in a pending draft review. The submit dialog can also update edited comments after the review succeeds; those edits are never counted as new comments to post.
908
+
909
+ If pair-review cannot confidently identify the original GitHub comment, or GitHub rejects an update, it reports the failure and leaves your local edit intact. It never creates a replacement comment. Dismissing a posted comment is local-only; it does not delete it on GitHub.
910
+
911
+ **Review history** lists submitted reviews newest first, with their state, date, comment/edit counts and summary preview. Open a review to read its full summary, comments as originally sent, and subsequent edits, with links back to GitHub and the diff. Use Back (or Escape) to return to the list; Escape from the list closes history. Legacy backfilled entries are approximate. Publication actions and history are not shown in local mode.
912
+
905
913
  ### GitHub Review Comments
906
914
 
907
915
  When reviewing a PR, pair-review fetches existing inline review comments from GitHub and shows them in the diff alongside AI suggestions (orange) and your own draft comments (purple). External comments render as read-only blue-themed bubbles, with threads preserved (root plus replies). Each comment and each thread has a "Chat about this" button that opens the AI chat panel with the comment as context, so you can quickly ask the agent to investigate, explain, or draft a response.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in-the-loop-labs/pair-review",
3
- "version": "5.3.6",
3
+ "version": "5.4.0",
4
4
  "description": "Your AI-powered code review partner - Close the feedback loop with AI coding agents",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -36,7 +36,7 @@
36
36
  "prepare": "node scripts/build-pierre-diffs.mjs",
37
37
  "generate:skill-prompts": "node scripts/generate-skill-prompts.js",
38
38
  "changeset": "changeset",
39
- "version": "changeset version && pnpm install --lockfile-only && bash scripts/generate-package-lock.sh && node scripts/sync-plugin-versions.js && git add package.json pnpm-lock.yaml package-lock.json CHANGELOG.md .changeset .claude-plugin/marketplace.json plugin/.claude-plugin/plugin.json plugin-code-critic/.claude-plugin/plugin.json plugin-pair-loop/.claude-plugin/plugin.json && git commit -m \"RELEASING: v$(node -p \"require('./package.json').version\")\"",
39
+ "version": "changeset version && pnpm install --lockfile-only && node scripts/sync-plugin-versions.js && git add package.json pnpm-lock.yaml CHANGELOG.md .changeset .claude-plugin/marketplace.json plugin/.claude-plugin/plugin.json plugin-code-critic/.claude-plugin/plugin.json plugin-pair-loop/.claude-plugin/plugin.json && git commit -m \"RELEASING: v$(node -p \"require('./package.json').version\")\"",
40
40
  "release": "npm whoami > /dev/null || { echo 'Error: Not logged in to npm. Run: npm login'; exit 1; } && pnpm run version && changeset tag && npm publish && git push && git push --tags"
41
41
  },
42
42
  "keywords": [
@@ -69,7 +69,7 @@
69
69
  "@agentclientprotocol/sdk": "^0.14.1",
70
70
  "@modelcontextprotocol/sdk": "^1.25.3",
71
71
  "@octokit/rest": "^19.0.11",
72
- "@pierre/diffs": "^1.2.12",
72
+ "@pierre/diffs": "^1.6.2",
73
73
  "better-sqlite3": "^12.11.1",
74
74
  "express": "^4.18.2",
75
75
  "glob": "^13.0.6",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pair-review",
3
- "version": "5.3.6",
3
+ "version": "5.4.0",
4
4
  "description": "pair-review app integration — Open PRs and local changes in the pair-review web UI, run server-side AI analysis, and address review feedback. Requires the pair-review MCP server.",
5
5
  "author": {
6
6
  "name": "in-the-loop-labs",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-critic",
3
- "version": "5.3.6",
3
+ "version": "5.4.0",
4
4
  "description": "AI-powered code review analysis — Run three-level AI analysis directly in your coding agent. Works standalone, no server required.",
5
5
  "author": {
6
6
  "name": "in-the-loop-labs",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pair-loop",
3
- "version": "5.3.6",
3
+ "version": "5.4.0",
4
4
  "description": "Agent-orchestrated review loop — implement, review with pair-review multi-model councils via the headless CLI, triage, fix, and repeat until a final review returns no blockers. MCP-independent.",
5
5
  "author": {
6
6
  "name": "in-the-loop-labs",
package/public/css/pr.css CHANGED
@@ -5342,6 +5342,311 @@ div.external-comment-row {
5342
5342
  font-size: 14px;
5343
5343
  }
5344
5344
 
5345
+ .review-modal-body .hide-posted-comments-option {
5346
+ margin-top: 0;
5347
+ color: var(--color-text-secondary, #57606a);
5348
+ font-size: 13px;
5349
+ cursor: pointer;
5350
+ }
5351
+
5352
+ .hide-posted-override-hint {
5353
+ margin-left: 4px;
5354
+ font-size: 12px;
5355
+ color: var(--color-text-tertiary, #6e7781);
5356
+ }
5357
+
5358
+ .posted-comment-hidden {
5359
+ display: none !important;
5360
+ }
5361
+
5362
+ .posted-comment-icon {
5363
+ display: inline-flex;
5364
+ flex-shrink: 0;
5365
+ color: var(--color-text-secondary, #57606a);
5366
+ opacity: 0.7;
5367
+ }
5368
+
5369
+ a.posted-comment-icon:hover,
5370
+ a.posted-comment-icon:focus-visible {
5371
+ opacity: 1;
5372
+ color: var(--color-accent-fg, #0969da);
5373
+ }
5374
+
5375
+ /* "Edited since posted" note and "Update on GitHub" action */
5376
+ .posted-comment-edited {
5377
+ display: flex;
5378
+ flex-wrap: wrap;
5379
+ align-items: center;
5380
+ gap: 8px;
5381
+ margin-top: 6px;
5382
+ font-size: 12px;
5383
+ color: var(--color-text-secondary, #57606a);
5384
+ }
5385
+
5386
+ .editing-mode .posted-comment-edited {
5387
+ display: none;
5388
+ }
5389
+
5390
+ .posted-comment-edited-label {
5391
+ font-style: italic;
5392
+ }
5393
+
5394
+ .btn-update-on-host {
5395
+ padding: 2px 8px;
5396
+ font-size: 12px;
5397
+ line-height: 18px;
5398
+ border: 1px solid var(--color-border-primary, #d0d7de);
5399
+ border-radius: 6px;
5400
+ background: var(--color-bg-secondary, #f6f8fa);
5401
+ color: var(--color-text-primary, #24292f);
5402
+ cursor: pointer;
5403
+ }
5404
+
5405
+ .btn-update-on-host:hover:not(:disabled) {
5406
+ background: var(--color-bg-tertiary, #eaeef2);
5407
+ }
5408
+
5409
+ .btn-update-on-host:disabled {
5410
+ cursor: progress;
5411
+ opacity: 0.7;
5412
+ }
5413
+
5414
+ .posted-comment-update-error {
5415
+ flex-basis: 100%;
5416
+ color: var(--color-danger, #cf222e);
5417
+ }
5418
+
5419
+ .review-modal-body .update-edited-comments-option {
5420
+ margin-top: 0;
5421
+ color: var(--color-text-secondary, #57606a);
5422
+ font-size: 13px;
5423
+ cursor: pointer;
5424
+ }
5425
+
5426
+ .update-edited-comments-option[hidden],
5427
+ .hide-posted-comments-option[hidden] {
5428
+ display: none;
5429
+ }
5430
+
5431
+ /* Keep these toggle-styled checkboxes keyboard accessible. */
5432
+ .review-modal-body .update-edited-comments-option input,
5433
+ .review-modal-body .hide-posted-comments-option input {
5434
+ display: block;
5435
+ position: absolute;
5436
+ opacity: 0;
5437
+ width: 1px;
5438
+ height: 1px;
5439
+ margin: 0;
5440
+ }
5441
+
5442
+ .review-modal-body .update-edited-comments-option input:focus-visible + .toggle-switch,
5443
+ .review-modal-body .hide-posted-comments-option input:focus-visible + .toggle-switch {
5444
+ outline: 2px solid var(--color-accent-fg, #0969da);
5445
+ outline-offset: 2px;
5446
+ }
5447
+
5448
+ /* Review history modal */
5449
+ .review-history-modal-container {
5450
+ background: var(--color-bg-primary, white);
5451
+ border-radius: 16px;
5452
+ box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
5453
+ max-width: 760px;
5454
+ width: 90%;
5455
+ max-height: 90vh;
5456
+ display: flex;
5457
+ flex-direction: column;
5458
+ }
5459
+
5460
+ .review-history-body {
5461
+ overflow-y: auto;
5462
+ padding: 16px 24px 24px;
5463
+ }
5464
+
5465
+ .review-history-list,
5466
+ .review-history-comments {
5467
+ list-style: none;
5468
+ margin: 0;
5469
+ padding: 0;
5470
+ }
5471
+
5472
+ .review-history-submission {
5473
+ padding: 12px 0;
5474
+ border-bottom: 1px solid var(--color-border-secondary, #d8dee4);
5475
+ }
5476
+
5477
+ .review-history-submission:last-child {
5478
+ border-bottom: none;
5479
+ }
5480
+
5481
+ .review-history-row {
5482
+ position: relative;
5483
+ padding: 0;
5484
+ }
5485
+
5486
+ .review-history-row-button {
5487
+ display: flex;
5488
+ flex-direction: column;
5489
+ gap: 8px;
5490
+ width: 100%;
5491
+ padding: 16px 12px;
5492
+ border: 0;
5493
+ border-radius: 6px;
5494
+ background: transparent;
5495
+ color: var(--color-text-primary, #24292f);
5496
+ font: inherit;
5497
+ text-align: left;
5498
+ cursor: pointer;
5499
+ }
5500
+
5501
+ .review-history-row-button:hover {
5502
+ background: var(--color-bg-secondary, #f6f8fa);
5503
+ }
5504
+
5505
+ .review-history-row-button:focus-visible,
5506
+ .review-history-back:focus-visible {
5507
+ outline: 2px solid var(--color-text-link, #0969da);
5508
+ outline-offset: -2px;
5509
+ }
5510
+
5511
+ .review-history-row .review-history-link {
5512
+ position: absolute;
5513
+ right: 12px;
5514
+ top: 20px;
5515
+ }
5516
+
5517
+ .review-history-row .review-history-submission-header {
5518
+ padding-right: 110px;
5519
+ }
5520
+
5521
+ .review-history-counts {
5522
+ font-size: 12px;
5523
+ color: var(--color-text-secondary, #57606a);
5524
+ }
5525
+
5526
+ .review-history-summary-preview {
5527
+ display: block;
5528
+ width: 100%;
5529
+ overflow: hidden;
5530
+ text-overflow: ellipsis;
5531
+ white-space: nowrap;
5532
+ font-size: 14px;
5533
+ }
5534
+
5535
+ .review-history-back {
5536
+ border: 0;
5537
+ background: transparent;
5538
+ color: var(--color-text-link, #0969da);
5539
+ cursor: pointer;
5540
+ font: inherit;
5541
+ font-size: 13px;
5542
+ margin-right: 12px;
5543
+ padding: 6px;
5544
+ }
5545
+
5546
+ .review-history-submission-header,
5547
+ .review-history-comment-header {
5548
+ display: flex;
5549
+ flex-wrap: wrap;
5550
+ align-items: center;
5551
+ gap: 8px;
5552
+ font-size: 13px;
5553
+ }
5554
+
5555
+ .review-history-time {
5556
+ color: var(--color-text-secondary, #57606a);
5557
+ font-size: 12px;
5558
+ }
5559
+
5560
+ .review-history-link {
5561
+ margin-left: auto;
5562
+ font-size: 12px;
5563
+ color: var(--color-text-link, #0969da);
5564
+ }
5565
+
5566
+ .review-history-chip {
5567
+ display: inline-block;
5568
+ padding: 0 8px;
5569
+ border-radius: 999px;
5570
+ font-size: 12px;
5571
+ line-height: 20px;
5572
+ border: 1px solid var(--color-border-primary, #d0d7de);
5573
+ background: var(--color-bg-secondary, #f6f8fa);
5574
+ color: var(--color-text-primary, #24292f);
5575
+ }
5576
+
5577
+ .review-history-chip-approve {
5578
+ border-color: var(--color-success, #1a7f37);
5579
+ color: var(--color-success, #1a7f37);
5580
+ }
5581
+
5582
+ .review-history-chip-request-changes {
5583
+ border-color: var(--color-danger, #cf222e);
5584
+ color: var(--color-danger, #cf222e);
5585
+ }
5586
+
5587
+ .review-history-chip-edited,
5588
+ .review-history-chip-dismissed,
5589
+ .review-history-chip-draft {
5590
+ color: var(--color-text-secondary, #57606a);
5591
+ }
5592
+
5593
+ .review-history-summary {
5594
+ margin-top: 8px;
5595
+ font-size: 14px;
5596
+ }
5597
+
5598
+ .review-history-comments {
5599
+ margin-top: 8px;
5600
+ display: flex;
5601
+ flex-direction: column;
5602
+ gap: 6px;
5603
+ }
5604
+
5605
+ .review-history-comment {
5606
+ padding: 16px;
5607
+ border: 1px solid var(--color-border-secondary, #d8dee4);
5608
+ border-radius: 8px;
5609
+ }
5610
+
5611
+ .review-history-comment[data-jump-comment-id] {
5612
+ cursor: pointer;
5613
+ }
5614
+
5615
+ .review-history-comment[data-jump-comment-id]:hover,
5616
+ .review-history-comment[data-jump-comment-id]:focus-visible {
5617
+ background: var(--color-bg-secondary, #f6f8fa);
5618
+ }
5619
+
5620
+ .review-history-comment-file {
5621
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
5622
+ font-size: 12px;
5623
+ }
5624
+
5625
+ .review-history-comment-line,
5626
+ .review-history-no-comments,
5627
+ .review-history-empty,
5628
+ .review-history-loading {
5629
+ color: var(--color-text-secondary, #57606a);
5630
+ font-size: 12px;
5631
+ }
5632
+
5633
+ .review-history-comment-body {
5634
+ margin-top: 16px;
5635
+ }
5636
+
5637
+ .review-history-comment-body > :last-child {
5638
+ margin-bottom: 0;
5639
+ }
5640
+
5641
+ .review-history-error {
5642
+ color: var(--color-danger, #cf222e);
5643
+ }
5644
+
5645
+ [data-theme="dark"] .review-history-modal-container {
5646
+ background: #0d1117;
5647
+ box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
5648
+ }
5649
+
5345
5650
  .review-modal-footer {
5346
5651
  padding: 16px 24px;
5347
5652
  border-top: 1px solid #d1d9e0;
@@ -7252,6 +7557,11 @@ body:not([data-theme="dark"]) .theme-icon-light {
7252
7557
  z-index: 11;
7253
7558
  }
7254
7559
 
7560
+ /* Open comment filter menu must overlay the sections below the segment row */
7561
+ .ai-panel > .segment-control.comment-filter-open {
7562
+ z-index: 11;
7563
+ }
7564
+
7255
7565
  /* Prevent text selection during drag */
7256
7566
  body.resizing {
7257
7567
  user-select: none;
@@ -8858,8 +9168,15 @@ body.resizing * {
8858
9168
  display: none;
8859
9169
  }
8860
9170
 
8861
- /* Filter Toggle Button - shows dismissed user comments */
8862
- .filter-toggle-btn {
9171
+ /* Comment filter menu: a funnel at the right of the segment row that opens
9172
+ labeled options for user comments (show dismissed, show posted). */
9173
+ .comment-filter {
9174
+ position: relative;
9175
+ flex-shrink: 0;
9176
+ }
9177
+
9178
+ .comment-filter-btn {
9179
+ position: relative;
8863
9180
  display: flex;
8864
9181
  align-items: center;
8865
9182
  justify-content: center;
@@ -8872,28 +9189,105 @@ body.resizing * {
8872
9189
  color: var(--color-text-tertiary);
8873
9190
  cursor: pointer;
8874
9191
  transition: var(--transition-ui-fast);
8875
- flex-shrink: 0;
8876
9192
  }
8877
9193
 
8878
- .filter-toggle-btn:hover {
9194
+ .comment-filter-btn:hover,
9195
+ .comment-filter-btn[aria-expanded="true"] {
8879
9196
  color: var(--color-text-secondary);
8880
9197
  background: var(--color-bg-tertiary);
8881
9198
  border-color: var(--color-border-secondary);
8882
9199
  }
8883
9200
 
8884
- .filter-toggle-btn.active {
9201
+ .comment-filter-btn svg {
9202
+ width: 14px;
9203
+ height: 14px;
9204
+ }
9205
+
9206
+ /* Flat dot: some filter option differs from its default */
9207
+ .comment-filter-dot {
9208
+ display: none;
9209
+ position: absolute;
9210
+ top: 3px;
9211
+ right: 3px;
9212
+ width: 6px;
9213
+ height: 6px;
9214
+ border-radius: 50%;
9215
+ background: var(--comment-primary);
9216
+ }
9217
+
9218
+ .comment-filter-btn.has-active-filter {
8885
9219
  color: var(--comment-primary);
8886
- background: var(--comment-subtle);
8887
- border-color: var(--comment-border);
8888
9220
  }
8889
9221
 
8890
- .filter-toggle-btn.hidden {
9222
+ .comment-filter-btn.has-active-filter .comment-filter-dot {
9223
+ display: block;
9224
+ }
9225
+
9226
+ .comment-filter-menu {
9227
+ position: absolute;
9228
+ top: calc(100% + 4px);
9229
+ right: 0;
9230
+ z-index: 100;
9231
+ min-width: 160px;
9232
+ padding: 6px 0;
9233
+ background: var(--color-bg-primary);
9234
+ border: 1px solid var(--color-border-primary);
9235
+ border-radius: var(--radius-sm);
9236
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
9237
+ }
9238
+
9239
+ .comment-filter-menu[hidden] {
8891
9240
  display: none;
8892
9241
  }
8893
9242
 
8894
- .filter-toggle-btn svg {
8895
- width: 14px;
8896
- height: 14px;
9243
+ .comment-filter-menu-title {
9244
+ padding: 2px 12px 6px;
9245
+ font-size: 11px;
9246
+ font-weight: 600;
9247
+ color: var(--color-text-tertiary);
9248
+ text-transform: uppercase;
9249
+ letter-spacing: 0.02em;
9250
+ }
9251
+
9252
+ .comment-filter-option {
9253
+ display: flex;
9254
+ align-items: center;
9255
+ gap: 8px;
9256
+ padding: 4px 12px;
9257
+ font-size: 13px;
9258
+ color: var(--color-text-primary);
9259
+ cursor: pointer;
9260
+ white-space: nowrap;
9261
+ }
9262
+
9263
+ .comment-filter-option:hover {
9264
+ background: var(--color-bg-tertiary);
9265
+ }
9266
+
9267
+ .comment-filter-option input {
9268
+ margin: 0;
9269
+ accent-color: var(--comment-primary);
9270
+ }
9271
+
9272
+ /* Muted line at the end of the user comment list when filters hide some */
9273
+ .hidden-comments-notice {
9274
+ padding: 8px 12px;
9275
+ font-size: 12px;
9276
+ color: var(--color-text-tertiary);
9277
+ text-align: center;
9278
+ }
9279
+
9280
+ .hidden-comments-show {
9281
+ padding: 0;
9282
+ background: none;
9283
+ border: none;
9284
+ font: inherit;
9285
+ color: var(--color-text-link, var(--comment-primary));
9286
+ cursor: pointer;
9287
+ }
9288
+
9289
+ .hidden-comments-show:hover {
9290
+ text-decoration: underline;
8897
9291
  }
8898
9292
 
8899
9293
  /* Level Filter Pills */
@@ -9921,7 +10315,7 @@ body.tour-active {
9921
10315
  Zone is invisible when empty - styling only applied when has content via :has() */
9922
10316
 
9923
10317
  /* Conditional styling - only show background/border when zone has actual content */
9924
- .file-comments-zone:has(.file-comment-card),
10318
+ .file-comments-zone:has(.file-comment-card:not(.posted-comment-hidden)),
9925
10319
  .file-comments-zone:has(.file-comment-form),
9926
10320
  .file-comments-zone:has(.external-comment-row) {
9927
10321
  background: var(--file-comment-bg);
@@ -9936,7 +10330,7 @@ body.tour-active {
9936
10330
  }
9937
10331
 
9938
10332
  /* Only add padding when container has visible content */
9939
- .file-comments-container:has(.file-comment-card),
10333
+ .file-comments-container:has(.file-comment-card:not(.posted-comment-hidden)),
9940
10334
  .file-comments-container:has(.file-comment-form),
9941
10335
  .file-comments-container:has(.external-comment-row) {
9942
10336
  padding: 12px 16px;