@in-the-loop-labs/pair-review 5.2.3 → 5.3.1

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 (49) hide show
  1. package/README.md +11 -3
  2. package/package.json +1 -1
  3. package/plugin/.claude-plugin/plugin.json +1 -1
  4. package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
  5. package/plugin-code-critic/skills/analyze/references/level1-thorough.md +52 -121
  6. package/plugin-code-critic/skills/analyze/references/level2-thorough.md +49 -113
  7. package/plugin-code-critic/skills/analyze/references/level3-thorough.md +46 -195
  8. package/plugin-code-critic/skills/analyze/references/orchestration-thorough.md +56 -112
  9. package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
  10. package/public/css/analysis-config.css +29 -0
  11. package/public/css/pr.css +208 -0
  12. package/public/js/components/AIPanel.js +14 -9
  13. package/public/js/components/ChatPanel.js +790 -54
  14. package/public/js/components/ConfirmDialog.js +70 -2
  15. package/public/js/modules/pierre-bridge.js +58 -97
  16. package/public/js/modules/suggestion-manager.js +9 -121
  17. package/public/js/pr.js +15 -28
  18. package/public/js/utils/scroll-into-view.js +18 -4
  19. package/src/ai/analyzer.js +30 -5
  20. package/src/ai/antigravity-provider.js +7 -6
  21. package/src/ai/claude-provider.js +4 -8
  22. package/src/ai/codex-provider.js +3 -4
  23. package/src/ai/index.js +2 -0
  24. package/src/ai/muse-provider.js +3 -4
  25. package/src/ai/omp-provider.js +27 -12
  26. package/src/ai/pi-provider.js +12 -6
  27. package/src/ai/prompts/baseline/consolidation/thorough.js +56 -43
  28. package/src/ai/prompts/baseline/level1/thorough.js +76 -138
  29. package/src/ai/prompts/baseline/level2/thorough.js +76 -129
  30. package/src/ai/prompts/baseline/level3/thorough.js +67 -212
  31. package/src/ai/prompts/baseline/orchestration/thorough.js +79 -130
  32. package/src/ai/prompts/render-for-skill.js +5 -0
  33. package/src/ai/prompts/shared/adversarial-verification.js +68 -0
  34. package/src/ai/provider.js +60 -1
  35. package/src/ai/stream-parser.js +22 -1
  36. package/src/chat/acp-bridge.js +11 -0
  37. package/src/chat/chat-models.js +348 -0
  38. package/src/chat/chat-providers.js +17 -0
  39. package/src/chat/claude-code-bridge.js +9 -0
  40. package/src/chat/codex-bridge.js +6 -1
  41. package/src/chat/omp-bridge.js +5 -0
  42. package/src/chat/pi-bridge.js +20 -5
  43. package/src/chat/session-manager.js +158 -63
  44. package/src/config.js +92 -5
  45. package/src/git/worktree.js +29 -10
  46. package/src/github/client.js +30 -10
  47. package/src/hooks/payloads.js +5 -1
  48. package/src/routes/chat.js +83 -11
  49. package/src/setup/pr-setup.js +54 -1
package/public/css/pr.css CHANGED
@@ -10572,6 +10572,171 @@ body.resizing * {
10572
10572
  color: var(--chat-primary, #0969da);
10573
10573
  }
10574
10574
 
10575
+ /* Model picker — sits between the provider picker and the session picker.
10576
+ The header is narrow, so the button truncates rather than wrapping. */
10577
+ .chat-panel__model-picker {
10578
+ position: relative;
10579
+ flex: 0 1 auto;
10580
+ min-width: 0;
10581
+ }
10582
+
10583
+ .chat-panel__model-picker-btn {
10584
+ display: flex;
10585
+ align-items: center;
10586
+ gap: 4px;
10587
+ max-width: 100%;
10588
+ font-size: 12px;
10589
+ font-weight: 500;
10590
+ color: var(--color-text-secondary, #57606a);
10591
+ background: transparent;
10592
+ border: none;
10593
+ border-radius: 6px;
10594
+ padding: 4px 6px;
10595
+ cursor: pointer;
10596
+ transition: background 0.15s ease, color 0.15s ease;
10597
+ }
10598
+
10599
+ .chat-panel__model-picker-btn:hover {
10600
+ background: var(--color-bg-tertiary, rgba(128, 128, 128, 0.1));
10601
+ color: var(--chat-text);
10602
+ }
10603
+
10604
+ .chat-panel__model-text {
10605
+ overflow: hidden;
10606
+ text-overflow: ellipsis;
10607
+ white-space: nowrap;
10608
+ }
10609
+
10610
+ .chat-panel__model-chevron {
10611
+ flex-shrink: 0;
10612
+ opacity: 0.5;
10613
+ transition: transform 0.15s ease;
10614
+ }
10615
+
10616
+ .chat-panel__model-picker-btn--open .chat-panel__model-chevron {
10617
+ transform: rotate(180deg);
10618
+ }
10619
+
10620
+ /* Model dropdown — position:fixed to escape the chat panel's overflow:hidden,
10621
+ like the session dropdown. Placed by _positionModelDropdown(). */
10622
+ .chat-panel__model-dropdown {
10623
+ position: fixed;
10624
+ min-width: 320px;
10625
+ width: max-content;
10626
+ max-width: min(420px, calc(100vw - 32px));
10627
+ background: var(--color-bg-primary, #fff);
10628
+ border: 1px solid var(--color-border-primary, #d0d7de);
10629
+ border-radius: 8px;
10630
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
10631
+ max-height: 320px;
10632
+ overflow-y: auto;
10633
+ z-index: 1000;
10634
+ padding: 4px;
10635
+ }
10636
+
10637
+ .chat-panel__model-empty {
10638
+ padding: 16px;
10639
+ text-align: center;
10640
+ color: var(--color-text-tertiary);
10641
+ font-size: 12px;
10642
+ }
10643
+
10644
+ .chat-panel__model-item {
10645
+ display: flex;
10646
+ align-items: flex-start;
10647
+ justify-content: space-between;
10648
+ gap: 8px;
10649
+ width: 100%;
10650
+ padding: 8px 12px;
10651
+ border: none;
10652
+ background: transparent;
10653
+ text-align: left;
10654
+ border-radius: 6px;
10655
+ cursor: pointer;
10656
+ transition: background 0.15s ease;
10657
+ font-size: 13px;
10658
+ color: var(--color-text-primary, #1f2328);
10659
+ }
10660
+
10661
+ .chat-panel__model-item:hover {
10662
+ background: var(--color-bg-tertiary, rgba(128, 128, 128, 0.08));
10663
+ }
10664
+
10665
+ .chat-panel__model-item--active {
10666
+ background: var(--color-bg-secondary, #f6f8fa);
10667
+ }
10668
+
10669
+ .chat-panel__model-item-body {
10670
+ display: flex;
10671
+ flex-direction: column;
10672
+ gap: 2px;
10673
+ min-width: 0;
10674
+ flex: 1;
10675
+ }
10676
+
10677
+ /* The name is the primary information: it takes the row, and the badge wraps
10678
+ below it when the row gets tight instead of squeezing the name. */
10679
+ .chat-panel__model-item-head {
10680
+ display: flex;
10681
+ align-items: center;
10682
+ flex-wrap: wrap;
10683
+ gap: 2px 6px;
10684
+ min-width: 0;
10685
+ }
10686
+
10687
+ .chat-panel__model-item-name {
10688
+ flex: 0 1 auto;
10689
+ min-width: 0;
10690
+ overflow: hidden;
10691
+ text-overflow: ellipsis;
10692
+ white-space: nowrap;
10693
+ font-weight: 500;
10694
+ }
10695
+
10696
+ .chat-panel__model-item-subtitle {
10697
+ font-size: 11px;
10698
+ line-height: 1.35;
10699
+ color: var(--color-text-tertiary, #656d76);
10700
+ }
10701
+
10702
+ .chat-panel__model-badge {
10703
+ flex: 0 0 auto;
10704
+ white-space: nowrap;
10705
+ font-size: 9px;
10706
+ font-weight: 600;
10707
+ letter-spacing: 0.03em;
10708
+ text-transform: uppercase;
10709
+ padding: 1px 5px;
10710
+ border-radius: 4px;
10711
+ color: var(--color-text-secondary, #57606a);
10712
+ background: var(--color-bg-tertiary, #eaeef2);
10713
+ border: 1px solid var(--color-border-primary, #d0d7de);
10714
+ }
10715
+
10716
+ .chat-panel__model-badge--fast {
10717
+ color: #1a7f37;
10718
+ background: #dafbe1;
10719
+ border-color: #aceebb;
10720
+ }
10721
+
10722
+ .chat-panel__model-badge--balanced {
10723
+ color: #0969da;
10724
+ background: #ddf4ff;
10725
+ border-color: #b6e3ff;
10726
+ }
10727
+
10728
+ .chat-panel__model-badge--thorough {
10729
+ color: #8250df;
10730
+ background: #fbefff;
10731
+ border-color: #e6ceff;
10732
+ }
10733
+
10734
+ .chat-panel__model-check {
10735
+ flex-shrink: 0;
10736
+ margin-top: 2px;
10737
+ color: var(--chat-primary, #0969da);
10738
+ }
10739
+
10575
10740
  /* Session picker wrapper (dropdown container) */
10576
10741
  .chat-panel__session-picker {
10577
10742
  position: relative;
@@ -10720,6 +10885,49 @@ body.resizing * {
10720
10885
  background: var(--color-bg-secondary, #161b22);
10721
10886
  }
10722
10887
 
10888
+ /* Dark theme: model picker + dropdown */
10889
+ [data-theme="dark"] .chat-panel__model-dropdown {
10890
+ background: var(--color-bg-primary, #0d1117);
10891
+ border-color: var(--color-border-primary, #30363d);
10892
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
10893
+ }
10894
+
10895
+ [data-theme="dark"] .chat-panel__model-item {
10896
+ color: var(--color-text-primary, #e6edf3);
10897
+ }
10898
+
10899
+ [data-theme="dark"] .chat-panel__model-item--active {
10900
+ background: var(--color-bg-secondary, #161b22);
10901
+ }
10902
+
10903
+ [data-theme="dark"] .chat-panel__model-item-subtitle {
10904
+ color: var(--color-text-tertiary, #8b949e);
10905
+ }
10906
+
10907
+ [data-theme="dark"] .chat-panel__model-badge {
10908
+ color: var(--color-text-secondary, #8b949e);
10909
+ background: var(--color-bg-tertiary, #1c2128);
10910
+ border-color: var(--color-border-primary, #30363d);
10911
+ }
10912
+
10913
+ [data-theme="dark"] .chat-panel__model-badge--fast {
10914
+ color: #3fb950;
10915
+ background: rgba(63, 185, 80, 0.12);
10916
+ border-color: rgba(63, 185, 80, 0.3);
10917
+ }
10918
+
10919
+ [data-theme="dark"] .chat-panel__model-badge--balanced {
10920
+ color: #58a6ff;
10921
+ background: rgba(88, 166, 255, 0.12);
10922
+ border-color: rgba(88, 166, 255, 0.3);
10923
+ }
10924
+
10925
+ [data-theme="dark"] .chat-panel__model-badge--thorough {
10926
+ color: #bc8cff;
10927
+ background: rgba(188, 140, 255, 0.12);
10928
+ border-color: rgba(188, 140, 255, 0.3);
10929
+ }
10930
+
10723
10931
  /* History button (icon-only, in actions) */
10724
10932
  .chat-panel__history-btn {
10725
10933
  display: flex;
@@ -1193,8 +1193,9 @@ class AIPanel {
1193
1193
  // Resolve the diff side: explicit arg wins, else the finding's own side,
1194
1194
  // else RIGHT. Deletions live on the LEFT, so a hardcoded RIGHT would
1195
1195
  // reveal the wrong line for deletion-side findings.
1196
+ const finding = this.findings?.find(f => String(f.id) === String(findingId));
1196
1197
  const resolvedSide = side
1197
- || this.findings?.find(f => String(f.id) === String(findingId))?.side
1198
+ || finding?.side
1198
1199
  || 'RIGHT';
1199
1200
  // Expand the file first if it's collapsed
1200
1201
  const expansion = this.expandFileIfCollapsed(file);
@@ -1208,12 +1209,13 @@ class AIPanel {
1208
1209
  }
1209
1210
 
1210
1211
  const doScroll = async () => {
1211
- // Reveal the target line first — for Pierre-rendered files this
1212
- // materializes deferred diffs and expands collapsed gaps.
1212
+ // Pierre suggestions anchor at line_end; legacy suggestions anchor
1213
+ // at line_start. Reveal both endpoints so either card has a row.
1213
1214
  if (file && line && window.prManager?.ensureLinesVisible) {
1214
1215
  await window.prManager.ensureLinesVisible([
1215
- { file, line_start: parseInt(line, 10), line_end: parseInt(line, 10), side: resolvedSide }
1216
+ { file, line_start: finding?.line_start || parseInt(line, 10), line_end: finding?.line_end || parseInt(line, 10), side: resolvedSide }
1216
1217
  ]);
1218
+ if (myGen !== this._navGen) return;
1217
1219
  }
1218
1220
 
1219
1221
  let targetSuggestion = null;
@@ -1264,7 +1266,7 @@ class AIPanel {
1264
1266
 
1265
1267
  // A newer navigation took over while we awaited — let it win.
1266
1268
  if (myGen !== this._navGen) return;
1267
- doScroll();
1269
+ await doScroll();
1268
1270
  }
1269
1271
 
1270
1272
  /**
@@ -1296,8 +1298,9 @@ class AIPanel {
1296
1298
  const myGen = ++this._navGen;
1297
1299
  // Resolve the diff side: explicit arg wins, else the comment's own side,
1298
1300
  // else RIGHT.
1301
+ const comment = this.comments?.find(c => String(c.id) === String(commentId));
1299
1302
  const resolvedSide = side
1300
- || this.comments?.find(c => String(c.id) === String(commentId))?.side
1303
+ || comment?.side
1301
1304
  || 'RIGHT';
1302
1305
  // Expand the file first if it's collapsed
1303
1306
  const expansion = this.expandFileIfCollapsed(file);
@@ -1309,17 +1312,19 @@ class AIPanel {
1309
1312
  }
1310
1313
 
1311
1314
  const doScroll = async () => {
1315
+ // Comments anchor at line_start. Reveal the full selected range,
1316
+ // including an ending line that may be in another collapsed gap.
1312
1317
  if (file && line && window.prManager?.ensureLinesVisible) {
1313
1318
  await window.prManager.ensureLinesVisible([
1314
- { file, line_start: parseInt(line, 10), line_end: parseInt(line, 10), side: resolvedSide }
1319
+ { file, line_start: comment?.line_start || parseInt(line, 10), line_end: comment?.line_end || parseInt(line, 10), side: resolvedSide }
1315
1320
  ]);
1321
+ if (myGen !== this._navGen) return;
1316
1322
  }
1317
1323
 
1318
1324
  let targetElement = null;
1319
1325
  let isFileLevel = false;
1320
1326
 
1321
1327
  // Check if this is a file-level comment
1322
- const comment = this.comments.find(c => String(c.id) === String(commentId));
1323
1328
  if (comment && (comment.is_file_level === 1 || comment.is_file_level === true)) {
1324
1329
  isFileLevel = true;
1325
1330
  }
@@ -1377,7 +1382,7 @@ class AIPanel {
1377
1382
 
1378
1383
  // A newer navigation took over while we awaited — let it win.
1379
1384
  if (myGen !== this._navGen) return;
1380
- doScroll();
1385
+ await doScroll();
1381
1386
  }
1382
1387
 
1383
1388
  /**