prreviewbuddy 0.48.0 → 0.49.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.49.0
4
+
5
+ **Change a review from the review itself.** The **⋯** menu at the top of a review now has
6
+ everything the card's menu on the reviews list has: **Mark reviewed** or **Mark in progress**,
7
+ **Mark waiting**, **Mark done**, **Move to active**, and **Add to review queue** or **Remove from
8
+ review queue**, as well as Save, Copy review ID and Delete. You no longer have to go back to the
9
+ list to park or queue the review you are reading. Waiting, Done and the queue belong to the branch,
10
+ so they are offered on its newest review; an older review of the same branch points you to it.
11
+
12
+ **The top bar says where the review stands.** It shows the files, the size of the change, whether
13
+ the review is up to date, and two labels: **Reviewed** or **In progress**, and **Waiting** or
14
+ **Done** when the review is parked. None of them are buttons. **Check for updates** has moved into
15
+ the **⋯** menu, because the page already checks by itself every minute while you are looking at it
16
+ and whenever you come back to the tab. Its answer, such as "No change", appears where the review's
17
+ freshness is shown.
18
+
19
+ **Check for updates works more than once.** After one check it stayed greyed out until you reloaded
20
+ the page. It now becomes available again as soon as the check finishes, and pressing it while the
21
+ page is checking by itself no longer does nothing: it waits for that check and then runs its own.
22
+
23
+ **The review page keeps up while it is open.** If a Waiting review's branch gets new commits while
24
+ you are looking at it, the page now says **Changed while waiting** within a minute, without a
25
+ reload, and offers **Mark waiting** again. Changes made from the reviews list in another tab show
26
+ up the same way. Adding a review to a full review queue from its page now says the queue is full
27
+ instead of appearing to work.
28
+
29
+ **Reviewed reviews stay in your queue.** Marking a review **Reviewed** no longer takes it out of
30
+ the review queue, from the reviews list or from the review itself. Reviewed records that you have
31
+ been through it, not that you are finished with it; **Waiting** and **Done** are how you say that,
32
+ and they still take a review out of the queue. `prreviewbuddy review --queue` now queues a Reviewed
33
+ review instead of refusing it, and, like adding from the workspace, moves a Waiting or Done review
34
+ back to Active when it goes in.
35
+
36
+ **Buddy AI has its own tab.** It is no longer a button in the top bar. When Buddy AI's panel is
37
+ closed, a **Buddy AI** tab sits on the right edge of the window; press it to open the panel. The
38
+ double arrow in the panel's header closes it.
39
+
3
40
  ## 0.48.0
4
41
 
5
42
  **Active, Waiting and Done.** A review can now be marked **Waiting**, for when you have done your
@@ -4089,19 +4089,6 @@ function queueRemove(id) {
4089
4089
  return updateQueue((current) => current.includes(id) ? current.filter((queued) => queued !== id) : null);
4090
4090
  }
4091
4091
  /**
4092
- * The invariant, as one named thing: the queue holds unfinished work only.
4093
- *
4094
- * Removing on completion is half of it. The other half is that this **does nothing** when
4095
- * `complete` is false, and that half only exists as a written rule -- there is no line of code for
4096
- * it to be visible in. Re-adding there would make membership something inferred from status rather
4097
- * than chosen, so a reviewer who took a review out of the queue and later moved it back to In
4098
- * progress would find it queued again with no idea why.
4099
- */
4100
- function dequeueOnComplete(id, complete) {
4101
- if (!complete) return;
4102
- queueRemove(id);
4103
- }
4104
- /**
4105
4092
  * A token for the index's revision, equality only.
4106
4093
  *
4107
4094
  * The queue changes only when a person deliberately changes it, so unlike a running job's progress
@@ -4143,14 +4130,17 @@ function normalise(ids) {
4143
4130
  var LIFECYCLES = [
4144
4131
  {
4145
4132
  id: "active",
4133
+ name: "Active",
4146
4134
  action: "Move to active"
4147
4135
  },
4148
4136
  {
4149
4137
  id: "waiting",
4138
+ name: "Waiting",
4150
4139
  action: "Mark waiting"
4151
4140
  },
4152
4141
  {
4153
4142
  id: "done",
4143
+ name: "Done",
4154
4144
  action: "Mark done"
4155
4145
  }
4156
4146
  ];
@@ -4170,6 +4160,23 @@ function parseLifecycle(raw) {
4170
4160
  function lifecycleAction(lifecycle) {
4171
4161
  return LIFECYCLES.find((entry) => entry.id === lifecycle).action;
4172
4162
  }
4163
+ /**
4164
+ * The review page's lifecycle pill, or absent for Active, which says nothing (as an open pull
4165
+ * request says nothing). A parked review that has changed since reads as the card's chip does, so
4166
+ * the page and the list give one answer about the same review.
4167
+ */
4168
+ function lifecyclePill(lifecycle, activity) {
4169
+ if (!lifecycle) return void 0;
4170
+ const chip = lifecycleChip(lifecycle, activity);
4171
+ if (chip !== void 0) return {
4172
+ text: chip,
4173
+ changed: true
4174
+ };
4175
+ return {
4176
+ text: LIFECYCLES.find((entry) => entry.id === lifecycle.state).name,
4177
+ changed: false
4178
+ };
4179
+ }
4173
4180
  var ACTIVITY_LABELS = {
4174
4181
  created: "Created",
4175
4182
  updated: "Updated",
@@ -4658,9 +4665,8 @@ function groupByLineage(reviews) {
4658
4665
  * on an old review is "then what is the current one", and answering it by sending them to the
4659
4666
  * index costs them the page they were reading. See `RelatedReview` for what may travel and why.
4660
4667
  */
4661
- function lineagePosition(workspace) {
4668
+ function lineagePosition(workspace, all = recentWorkspaces(Number.MAX_SAFE_INTEGER)) {
4662
4669
  const review = summarise(workspace);
4663
- const all = recentWorkspaces(Number.MAX_SAFE_INTEGER);
4664
4670
  return {
4665
4671
  ...positionInLineage(review, all),
4666
4672
  reviews: relatedReviews(review, all)
@@ -7650,9 +7656,10 @@ function compactQueue(stored) {
7650
7656
  /**
7651
7657
  * Put one review on the queue, the way the index's Add does, and say how that went.
7652
7658
  *
7653
- * **A completed review is left out**, not queued and not reopened. The queue holds unfinished work
7654
- * only -- `dequeueOnComplete` is the other half of that rule -- and quietly moving somebody's review
7655
- * back to In progress because a command mentioned it is a status change nobody asked for.
7659
+ * **A Reviewed review is queued like any other.** Reviewed says what the reviewer has done with it,
7660
+ * not that the work is over; that is Done. A Waiting or Done review that goes in is put back in
7661
+ * Active, as it is from the page (`activateQueued`), because asking for it in the queue is asking
7662
+ * to work on it again.
7656
7663
  *
7657
7664
  * Already queued is `already`, not a move: the same rule `queueAdd` keeps, for the same reason.
7658
7665
  *
@@ -7660,11 +7667,9 @@ function compactQueue(stored) {
7660
7667
  * was queued would otherwise hold a place, and a live review could be refused as "full" by it.
7661
7668
  */
7662
7669
  function queueForReview(id) {
7663
- const workspace = loadWorkspace(id);
7664
- if (!workspace) return "gone";
7665
- if (workspace.completedAt !== void 0) return "complete";
7670
+ if (!loadWorkspace(id)) return "gone";
7666
7671
  let result = "added";
7667
- return updateQueue((current) => {
7672
+ const stored = updateQueue((current) => {
7668
7673
  const live = current.filter(isLive);
7669
7674
  const unchanged = live.length === current.length ? null : live;
7670
7675
  if (live.includes(id)) {
@@ -7676,7 +7681,29 @@ function queueForReview(id) {
7676
7681
  return unchanged;
7677
7682
  }
7678
7683
  return [...live, id];
7679
- }) === null ? "unsaved" : result;
7684
+ });
7685
+ if (stored === null) return "unsaved";
7686
+ if (result === "added") activateQueued([id], stored);
7687
+ return result;
7688
+ }
7689
+ /**
7690
+ * Queueing a review puts it back in Active.
7691
+ *
7692
+ * The queue is work the reviewer wants surfaced next, and Waiting and Done both say the opposite; a
7693
+ * queued review folded away in Done would be a contradiction the page then has to draw. Parking
7694
+ * takes a review out of the queue, and this is the same rule read the other way. Only what actually
7695
+ * went in: a review refused because the queue was full keeps the lifecycle it had.
7696
+ *
7697
+ * Every way in calls this: a card, the bulk bar, the review's own page and `--queue`.
7698
+ */
7699
+ function activateQueued(ids, queue) {
7700
+ const queued = new Set(queue);
7701
+ for (const one of ids) {
7702
+ if (!queued.has(one) || loadWorkspace(one)?.lifecycle === void 0) continue;
7703
+ mutateWorkspace(one, (current) => {
7704
+ current.lifecycle = void 0;
7705
+ });
7706
+ }
7680
7707
  }
7681
7708
  function isLive(id) {
7682
7709
  return loadWorkspace(id) !== null;
@@ -12775,4 +12802,4 @@ function lineageIds(id) {
12775
12802
  return [.../* @__PURE__ */ new Set([id, ...lineage.map((review) => review.id)])];
12776
12803
  }
12777
12804
  //#endregion
12778
- export { queueForReview as $, mutateWorkspace as $t, createPrState as A, describeAuthorship as An, allJobs as At, toneOf as B, CONFIG_PATH as Bn, purposeOf as Bt, readEvents as C, doneVerb as Cn, forgeFor as Ct, announceJob as D, questionsOutstanding as Dn, checkReview as Dt, telemetryUploadConsent as E, issuesOutstanding as En, checkCodeFreshness as Et, markAllRead as F, resolveAgent as Fn, saveJob as Ft, extractJsonText as G, agentFor as Gn, groupByLineage as Gt, withUsageRecorded as H, AGENT_IDS as Hn, driverGone as Ht, markRead as I, resolveModel as In, PHASES as It, readMarker as J, AgentUnavailableError as Jn, latestKissRun as Jt, ReviewBeingDeletedError as K, detectAgents as Kn, indexKeptIds as Kt, pruneNotifications as L, clearAgentPreference as Ln, isLiveJob as Lt, eventName as M, displayRef as Mn, fail as Mt, headline as N, isCommitReview as Nn, isTerminal as Nt, branchOf as O, reviewerDispositions as On, followedBranch as Ot, listNotifications as P, git as Pn, loadJob as Pt, compactQueue as Q, matchingWorkspaceIds as Qt, readNotification as R, readAgentPreference as Rn, phasesFor as Rt, startJob as S, readQueue as Sn, forgeResolver as St, recordTelemetryUploadConsent as T, isQuestionOutstanding as Tn, fillFileUrlTemplate as Tt, EXPLAIN_SIMPLY_PROMPT as U, DEFAULT_AGENT_ID as Un, isClaimed as Ut, unreadCount as V, STORE_ROOT as Vn, clearClaim as Vt, asString as W, agentById as Wn, followedRefName as Wt, modelHelpLines as X, lineagePosition as Xt, removeWorktree as Y, lineageKeyFor as Yt, relativeTime as Z, loadWorkspace as Zt, agentEnvOf as _, dequeueOnComplete as _n, parseWorkspacePort as _t, wasBlocked as a, summarise as an, reviewsUrl as at, reanalyseReview as b, queueRemove as bn, writePortPreference as bt, RefreshUnavailableError as c, workspaceStamps as cn, stopServer as ct, refreshPrContext as d, isLifecycle as dn, BUILD_VERSION as dt, positionInLineage as en, readIndexToken as et, isUnchanged as f, lifecycleAction as fn, PACKAGE_NAME as ft, runningJobs as g, sectionOf as gn, MIN_WORKSPACE_PORT as gt, liveUpdateFor as h, parseLifecycle as hn, MAX_WORKSPACE_PORT as ht, liveJobsFor as i, reviewedRepositories as in, readServerRecord as it, createPrUpdate as j, resolveTarget as jn, endedAt as jt, subjectOf as k, processDiscussion as kn, reviewedShaOf as kt, mergeUpdateInto as l, LIFECYCLES as ln, workspaceUrl as lt, UpdateAlreadyRunningError as m, offersLifecycle as mn, DEFAULT_WORKSPACE_PORT as mt, deleteReview as n, recentWorkspaces as nn, clearServerRecord as nt, discardJob as o, touchWorkspace as on, serverEntryExists as ot, askCheckout as p, lifecycleChip as pn, feedbackUrl as pt, MANAGED_ROOT as q, AgentCancelledError as qn, indexReviewGroups as qt, lineageIds as r, reviewedCommit as rn, ensureServer as rt, FETCH_TIMEOUT_MS as s, workspaceRevision as sn, spawnServer as st, deleteLineage as t, previousKissResult as tn, bootstrapUrl as tt, updateReview as u, activityLabel as un, writeServerRecord as ut, recordKissRun as v, queueAdd as vn, resolveWorkspacePort as vt, record as w, isIssueOutstanding as wn, remoteHost as wt, runJob as x, queueStamp as xn, claimRequestUrl as xt, startKissJob as y, queueAddMany as yn, statedWorkspacePort as yt, removeNotification as z, writeAgentPreference as zn, progressSteps as zt };
12805
+ export { compactQueue as $, matchingWorkspaceIds as $t, createPrState as A, processDiscussion as An, reviewedShaOf as At, toneOf as B, writeAgentPreference as Bn, progressSteps as Bt, readEvents as C, readQueue as Cn, forgeResolver as Ct, announceJob as D, issuesOutstanding as Dn, checkCodeFreshness as Dt, telemetryUploadConsent as E, isQuestionOutstanding as En, fillFileUrlTemplate as Et, markAllRead as F, git as Fn, loadJob as Ft, extractJsonText as G, agentById as Gn, followedRefName as Gt, withUsageRecorded as H, STORE_ROOT as Hn, clearClaim as Ht, markRead as I, resolveAgent as In, saveJob as It, readMarker as J, AgentCancelledError as Jn, indexReviewGroups as Jt, ReviewBeingDeletedError as K, agentFor as Kn, groupByLineage as Kt, pruneNotifications as L, resolveModel as Ln, PHASES as Lt, eventName as M, resolveTarget as Mn, endedAt as Mt, headline as N, displayRef as Nn, fail as Nt, branchOf as O, questionsOutstanding as On, checkReview as Ot, listNotifications as P, isCommitReview as Pn, isTerminal as Pt, activateQueued as Q, loadWorkspace as Qt, readNotification as R, clearAgentPreference as Rn, isLiveJob as Rt, startJob as S, queueStamp as Sn, claimRequestUrl as St, recordTelemetryUploadConsent as T, isIssueOutstanding as Tn, remoteHost as Tt, EXPLAIN_SIMPLY_PROMPT as U, AGENT_IDS as Un, driverGone as Ut, unreadCount as V, CONFIG_PATH as Vn, purposeOf as Vt, asString as W, DEFAULT_AGENT_ID as Wn, isClaimed as Wt, modelHelpLines as X, lineageKeyFor as Xt, removeWorktree as Y, AgentUnavailableError as Yn, latestKissRun as Yt, relativeTime as Z, lineagePosition as Zt, agentEnvOf as _, parseLifecycle as _n, MIN_WORKSPACE_PORT as _t, wasBlocked as a, reviewedRepositories as an, readServerRecord as at, reanalyseReview as b, queueAddMany as bn, statedWorkspacePort as bt, RefreshUnavailableError as c, workspaceRevision as cn, spawnServer as ct, refreshPrContext as d, activityLabel as dn, writeServerRecord as dt, mutateWorkspace as en, queueForReview as et, isUnchanged as f, isLifecycle as fn, BUILD_VERSION as ft, runningJobs as g, offersLifecycle as gn, MAX_WORKSPACE_PORT as gt, liveUpdateFor as h, lifecyclePill as hn, DEFAULT_WORKSPACE_PORT as ht, liveJobsFor as i, reviewedCommit as in, ensureServer as it, createPrUpdate as j, describeAuthorship as jn, allJobs as jt, subjectOf as k, reviewerDispositions as kn, followedBranch as kt, mergeUpdateInto as l, workspaceStamps as ln, stopServer as lt, UpdateAlreadyRunningError as m, lifecycleChip as mn, feedbackUrl as mt, deleteReview as n, previousKissResult as nn, bootstrapUrl as nt, discardJob as o, summarise as on, reviewsUrl as ot, askCheckout as p, lifecycleAction as pn, PACKAGE_NAME as pt, MANAGED_ROOT as q, detectAgents as qn, indexKeptIds as qt, lineageIds as r, recentWorkspaces as rn, clearServerRecord as rt, FETCH_TIMEOUT_MS as s, touchWorkspace as sn, serverEntryExists as st, deleteLineage as t, positionInLineage as tn, readIndexToken as tt, updateReview as u, LIFECYCLES as un, workspaceUrl as ut, recordKissRun as v, sectionOf as vn, parseWorkspacePort as vt, record as w, doneVerb as wn, forgeFor as wt, runJob as x, queueRemove as xn, writePortPreference as xt, startKissJob as y, queueAdd as yn, resolveWorkspacePort as yt, removeNotification as z, readAgentPreference as zn, phasesFor as zt };
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as queueForReview, $t as mutateWorkspace, At as allJobs, Bn as CONFIG_PATH, Bt as purposeOf, Dt as checkReview, E as telemetryUploadConsent, Fn as resolveAgent, Gt as groupByLineage, Hn as AGENT_IDS, Ht as driverGone, In as resolveModel, It as PHASES, J as readMarker, Kn as detectAgents, Mn as displayRef, Nt as isTerminal, Pn as git, Pt as loadJob, Qt as matchingWorkspaceIds, Rn as readAgentPreference, S as startJob, St as forgeResolver, T as recordTelemetryUploadConsent, Un as DEFAULT_AGENT_ID, Ut as isClaimed, Vn as STORE_ROOT, Vt as clearClaim, Wn as agentById, Wt as followedRefName, X as modelHelpLines, Y as removeWorktree, Yt as lineageKeyFor, Z as relativeTime, Zt as loadWorkspace, _t as parseWorkspacePort, a as wasBlocked, an as summarise, at as reviewsUrl, b as reanalyseReview, bt as writePortPreference, ct as stopServer, dt as BUILD_VERSION, en as positionInLineage, et as readIndexToken, ft as PACKAGE_NAME, g as runningJobs, gt as MIN_WORKSPACE_PORT, h as liveUpdateFor, ht as MAX_WORKSPACE_PORT, i as liveJobsFor, in as reviewedRepositories, jn as resolveTarget, l as mergeUpdateInto, lt as workspaceUrl, m as UpdateAlreadyRunningError, mt as DEFAULT_WORKSPACE_PORT, n as deleteReview$1, nn as recentWorkspaces, q as MANAGED_ROOT, rt as ensureServer, tt as bootstrapUrl, u as updateReview, v as recordKissRun, w as record$1, x as runJob, yt as statedWorkspacePort, zn as writeAgentPreference, zt as progressSteps } from "./delete_review-D52wkt66.js";
2
+ import { $t as matchingWorkspaceIds, Bn as writeAgentPreference, Bt as progressSteps, Ct as forgeResolver, E as telemetryUploadConsent, Fn as git, Ft as loadJob, Gn as agentById, Gt as followedRefName, Hn as STORE_ROOT, Ht as clearClaim, In as resolveAgent, J as readMarker, Kt as groupByLineage, Ln as resolveModel, Lt as PHASES, Mn as resolveTarget, Nn as displayRef, Ot as checkReview, Pt as isTerminal, Qt as loadWorkspace, S as startJob, T as recordTelemetryUploadConsent, Un as AGENT_IDS, Ut as driverGone, Vn as CONFIG_PATH, Vt as purposeOf, Wn as DEFAULT_AGENT_ID, Wt as isClaimed, X as modelHelpLines, Xt as lineageKeyFor, Y as removeWorktree, Z as relativeTime, _t as MIN_WORKSPACE_PORT, a as wasBlocked, an as reviewedRepositories, b as reanalyseReview, bt as statedWorkspacePort, en as mutateWorkspace, et as queueForReview, ft as BUILD_VERSION, g as runningJobs, gt as MAX_WORKSPACE_PORT, h as liveUpdateFor, ht as DEFAULT_WORKSPACE_PORT, i as liveJobsFor, it as ensureServer, jt as allJobs, l as mergeUpdateInto, lt as stopServer, m as UpdateAlreadyRunningError, n as deleteReview$1, nt as bootstrapUrl, on as summarise, ot as reviewsUrl, pt as PACKAGE_NAME, q as MANAGED_ROOT, qn as detectAgents, rn as recentWorkspaces, tn as positionInLineage, tt as readIndexToken, u as updateReview, ut as workspaceUrl, v as recordKissRun, vt as parseWorkspacePort, w as record$1, x as runJob, xt as writePortPreference, zn as readAgentPreference } from "./delete_review-BBjXPfMV.js";
3
3
  import { basename, dirname, join, resolve } from "node:path";
4
4
  import { spawn } from "node:child_process";
5
5
  import { existsSync, mkdirSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
@@ -1455,7 +1455,6 @@ function batchQueueLines(rows) {
1455
1455
  }
1456
1456
  function notQueuedBecause(subject, result) {
1457
1457
  switch (result) {
1458
- case "complete": return `${subject} is marked complete. Move it back to In progress in the workspace to queue it.`;
1459
1458
  case "full": return `${subject}, because the review queue is full. It holds 50 reviews at most.`;
1460
1459
  default: return `${subject}, because the review queue could not be saved.`;
1461
1460
  }
@@ -1468,7 +1467,6 @@ function reviewQueued(result) {
1468
1467
  switch (result) {
1469
1468
  case "added": return "Added to review queue.";
1470
1469
  case "already": return "Already in your review queue.";
1471
- case "complete": return "Not added to your review queue: this review is marked complete. Move it back to In progress in the workspace to queue it.";
1472
1470
  case "full": return `Not added to your review queue: it is full, and holds 50 reviews at most.`;
1473
1471
  default: return "Not added to your review queue: the queue could not be saved.";
1474
1472
  }