@disintegrator/raven-paseo 0.0.2 → 0.0.3
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/OVERVIEW.md +7 -0
- package/client/index.js +234 -31
- package/client/index.js.map +7 -7
- package/package.json +1 -1
- package/server/index.js +165 -2
- package/server/index.js.map +8 -8
package/OVERVIEW.md
CHANGED
|
@@ -66,6 +66,13 @@ folded. Clicking a pull request number opens its commit: the message, who wrote
|
|
|
66
66
|
changed, and the pull request's description, which is fetched from GitHub with the `gh` command and
|
|
67
67
|
cached. The Line history button in the header turns the lane off.
|
|
68
68
|
|
|
69
|
+
Lines of inquiry can be written out to explain the change: a question, its answer in a few
|
|
70
|
+
sentences, and the places in the code that show it, each with a note. They are listed at the top of
|
|
71
|
+
the outline; click one to walk it as a line of panes, each note under the lines it is about. An
|
|
72
|
+
agent writes them through raven's MCP server, when asked how something works. You add your own
|
|
73
|
+
with **Keep as a note** where you would write a comment. A note explains: it is not a comment, and
|
|
74
|
+
is never sent. One whose lines have changed since says so.
|
|
75
|
+
|
|
69
76
|
Comments sit under their line. Send them to an agent in the workspace, with file and line context, or
|
|
70
77
|
copy them as Markdown.
|
|
71
78
|
|
package/client/index.js
CHANGED
|
@@ -58,11 +58,11 @@ function keyLookup(segments, side) {
|
|
|
58
58
|
const spans = segments.flatMap((s) => s[side] ? [{ key: s.key, from: s[side][0], to: s[side][1] }] : []).sort((a, b) => a.from - b.from);
|
|
59
59
|
return (line) => spans.find((s) => line >= s.from && line <= s.to)?.key;
|
|
60
60
|
}
|
|
61
|
-
function diffRows(view, context = 3) {
|
|
61
|
+
function diffRows(view, context = 3, also) {
|
|
62
62
|
const rows = allRows(view);
|
|
63
63
|
const keep = Array.from({ length: rows.length }, () => false);
|
|
64
64
|
rows.forEach((r, idx) => {
|
|
65
|
-
if (r.type === "context")
|
|
65
|
+
if (r.type === "context" && !also?.(r))
|
|
66
66
|
return;
|
|
67
67
|
for (let k = Math.max(0, idx - context);k <= Math.min(rows.length - 1, idx + context); k++)
|
|
68
68
|
keep[k] = true;
|
|
@@ -3784,6 +3784,7 @@ function themeVars(t) {
|
|
|
3784
3784
|
"--ok": t.statusSuccess,
|
|
3785
3785
|
"--warn": t.statusWarning,
|
|
3786
3786
|
"--bad": t.statusDanger,
|
|
3787
|
+
"--note": t.dark ? "#8ab4f8" : "#1d4ed8",
|
|
3787
3788
|
"--add": t.dark ? "#4ade80" : "#15803d",
|
|
3788
3789
|
"--del": t.dark ? "#ef4444" : "#b91c1c",
|
|
3789
3790
|
"--add-bg": t.dark ? "rgba(74,222,128,.09)" : "rgba(21,128,61,.08)",
|
|
@@ -3834,8 +3835,8 @@ var STYLE = `
|
|
|
3834
3835
|
.raven-root .seg.wseg button{font-family:var(--mono);font-size:11.5px;padding:0 7px}
|
|
3835
3836
|
/* The diff of this file folds nothing: the two ways of showing it are one. */
|
|
3836
3837
|
.raven-root .seg.vseg[data-same]{opacity:.6}
|
|
3837
|
-
.raven-root .count{min-width:18px;height:18px;padding:0 5px;
|
|
3838
|
-
.raven-root .tag{display:inline-flex;align-items:center;height:19px;padding:0 6px;
|
|
3838
|
+
.raven-root .count{min-width:18px;height:18px;padding:0 5px;background:var(--s3);font-size:11px;display:inline-flex;align-items:center;justify-content:center}
|
|
3839
|
+
.raven-root .tag{display:inline-flex;align-items:center;height:19px;padding:0 6px;font:600 11px/1 var(--ui);background:var(--s2);color:var(--fg2);white-space:nowrap;flex:none}
|
|
3839
3840
|
.raven-root .tag.good{background:color-mix(in srgb,var(--ok) 18%,transparent);color:var(--ok)}
|
|
3840
3841
|
.raven-root .tag.warn{background:color-mix(in srgb,var(--warn) 20%,transparent);color:var(--warn)}
|
|
3841
3842
|
.raven-root .tag.asking{background:transparent;box-shadow:inset 0 0 0 1px var(--line2);font-weight:500;flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;display:inline-block;line-height:19px}
|
|
@@ -3854,18 +3855,18 @@ var STYLE = `
|
|
|
3854
3855
|
.raven-root .acts{margin-left:0;justify-content:flex-start;overflow-x:auto;scrollbar-width:none}
|
|
3855
3856
|
.raven-root .cap{flex-wrap:wrap}
|
|
3856
3857
|
}
|
|
3857
|
-
.raven-root .basebar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:8px;padding:6px 10px;
|
|
3858
|
+
.raven-root .basebar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:8px;padding:6px 10px;background:color-mix(in srgb,var(--accent2) 10%,transparent);font-size:12px;line-height:1.45}
|
|
3858
3859
|
.raven-root .basebar .btn .muted{font-size:11px}
|
|
3859
3860
|
.raven-root .waitbar{background:color-mix(in srgb,var(--warn) 14%,transparent)}
|
|
3860
3861
|
.raven-root .copybar .sign{margin-left:auto;display:flex;align-items:center;gap:6px;white-space:nowrap;color:var(--fg2)}
|
|
3861
3862
|
.raven-root .copybar input{font:inherit;padding:2px 6px;border-radius:5px;border:1px solid var(--line2);background:var(--s0);color:var(--fg)}
|
|
3862
3863
|
.raven-root .note.theirs{box-shadow:inset 2px 0 0 var(--accent2)}
|
|
3863
3864
|
.raven-root .waitbar .btn{margin-left:auto}
|
|
3864
|
-
.raven-root .
|
|
3865
|
-
.raven-root .
|
|
3866
|
-
.raven-root .
|
|
3865
|
+
.raven-root .finished{grid-row:1/-1;align-self:center;justify-self:center;display:flex;flex-direction:column;gap:6px;width:100%;max-width:60ch;padding:24px}
|
|
3866
|
+
.raven-root .finished h1{font-size:20px;font-weight:650}
|
|
3867
|
+
.raven-root .finished p{line-height:1.55}
|
|
3867
3868
|
.raven-root .base-note{flex-basis:100%;color:var(--warn)}
|
|
3868
|
-
.raven-root .bar{display:flex;gap:2px;height:6px;margin-top:9px;
|
|
3869
|
+
.raven-root .bar{display:flex;gap:2px;height:6px;margin-top:9px;overflow:hidden;background:var(--s2)}
|
|
3869
3870
|
.raven-root .bar i{display:block;background:var(--accent)}
|
|
3870
3871
|
.raven-root .cap{display:flex;justify-content:space-between;gap:14px;color:var(--fg2);font-size:12px;margin-top:4px}
|
|
3871
3872
|
.raven-root .journey{display:flex;align-items:center;gap:6px;margin-top:7px;overflow-x:auto;white-space:nowrap;font-size:12px}
|
|
@@ -3888,7 +3889,7 @@ var STYLE = `
|
|
|
3888
3889
|
/* A pane's wrapper is as tall as the lanes it spans. The pane sticks to the top of the view inside it,
|
|
3889
3890
|
so on every line that grows from a pane, that pane stays in sight on the left. */
|
|
3890
3891
|
.raven-root .span{position:absolute}
|
|
3891
|
-
.raven-root .span>.pane{position:sticky;top:0;height:var(--vh,100%);border:1px solid var(--line2);
|
|
3892
|
+
.raven-root .span>.pane{position:sticky;top:0;height:var(--vh,100%);border:1px solid var(--line2);overflow:hidden}
|
|
3892
3893
|
.raven-root .plane>.pane.ghost{position:absolute}
|
|
3893
3894
|
.raven-root .pane.p-out{flex:0 0 var(--ow,280px);height:var(--vh,100%);position:sticky;left:0;top:0;z-index:7;border-right:1px solid var(--line)}
|
|
3894
3895
|
.raven-root .links{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}
|
|
@@ -3899,10 +3900,10 @@ var STYLE = `
|
|
|
3899
3900
|
.raven-root .shade{display:none}
|
|
3900
3901
|
.raven-root.map .shade{display:grid;place-items:center;position:absolute;inset:0;z-index:6;cursor:zoom-in;background:color-mix(in srgb,var(--s0) 30%,transparent)}
|
|
3901
3902
|
.raven-root.map .shade:hover{background:color-mix(in srgb,var(--accent2) 16%,transparent)}
|
|
3902
|
-
.raven-root .shade-lab{max-width:92%;padding:.35em .7em;border:1px solid var(--line2);
|
|
3903
|
+
.raven-root .shade-lab{max-width:92%;padding:.35em .7em;border:1px solid var(--line2);background:var(--s0);color:var(--fg);font:600 calc(14px / var(--scale,1))/1.3 var(--mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
3903
3904
|
.raven-root.map .span>.pane.focus{outline:calc(2px / var(--scale,1)) solid var(--accent2)}
|
|
3904
3905
|
/* On the map a wrapper shows as a band: how far down the lines that grew from its pane reach. */
|
|
3905
|
-
.raven-root.map .span{
|
|
3906
|
+
.raven-root.map .span{background:color-mix(in srgb,var(--fg3) 12%,transparent)}
|
|
3906
3907
|
.raven-root .shade-x{display:none}
|
|
3907
3908
|
.raven-root.map .shade-x{display:grid;place-items:center;position:absolute;top:calc(8px / var(--scale,1));right:calc(8px / var(--scale,1));width:calc(24px / var(--scale,1));height:calc(24px / var(--scale,1));border:calc(1px / var(--scale,1)) solid var(--line2);border-radius:calc(6px / var(--scale,1));background:var(--s0);color:var(--fg2);font:calc(16px / var(--scale,1))/1 var(--ui);cursor:pointer}
|
|
3908
3909
|
.raven-root.map .shade-x:hover{background:var(--bad);border-color:var(--bad);color:var(--s0)}
|
|
@@ -3930,7 +3931,7 @@ var STYLE = `
|
|
|
3930
3931
|
.raven-root .main{padding:12px 18px 80px}
|
|
3931
3932
|
/* Stands where the first side trip will open, as wide as a pane. */
|
|
3932
3933
|
.raven-root .plane>.pane.ghost{border:0;background:none;display:grid;place-items:center start;padding:20px 28px}
|
|
3933
|
-
.raven-root .ghost div{max-width:36ch;padding:14px 16px;border:1px dashed var(--line2);
|
|
3934
|
+
.raven-root .ghost div{max-width:36ch;padding:14px 16px;border:1px dashed var(--line2);color:var(--fg2);line-height:1.55}
|
|
3934
3935
|
.raven-root .x{width:22px;height:22px;border-radius:6px;display:inline-grid;place-items:center;color:var(--fg2);font-size:16px;flex:none}
|
|
3935
3936
|
.raven-root .x:hover{background:var(--s2);color:var(--fg)}
|
|
3936
3937
|
|
|
@@ -3960,8 +3961,8 @@ var STYLE = `
|
|
|
3960
3961
|
.raven-root .sk-a{display:flex;gap:10px;font-size:12px;margin-top:1px}
|
|
3961
3962
|
|
|
3962
3963
|
.raven-root .crumb{color:var(--fg2);font-size:12px;margin-bottom:6px}
|
|
3963
|
-
.raven-root .fb{border:1px solid var(--line2);
|
|
3964
|
-
.raven-root .fb-h{display:flex;align-items:center;gap:8px;padding:5px 10px;border-bottom:1px solid var(--line);background:var(--s0);min-height:34px;position:sticky;top:-12px;z-index:2
|
|
3964
|
+
.raven-root .fb{border:1px solid var(--line2);margin-bottom:12px;background:var(--s0)}
|
|
3965
|
+
.raven-root .fb-h{display:flex;align-items:center;gap:8px;padding:5px 10px;border-bottom:1px solid var(--line);background:var(--s0);min-height:34px;position:sticky;top:-12px;z-index:2}
|
|
3965
3966
|
.raven-root .path{display:flex;font-family:var(--mono);font-size:var(--code-size);white-space:nowrap;min-width:0}
|
|
3966
3967
|
.raven-root .path .dir{color:var(--fg3);overflow:hidden;text-overflow:ellipsis;min-width:0}
|
|
3967
3968
|
.raven-root .path b{flex:none}
|
|
@@ -4003,7 +4004,7 @@ var STYLE = `
|
|
|
4003
4004
|
@keyframes pr-flash{from{background-color:color-mix(in srgb,var(--accent2) 45%,transparent)}}
|
|
4004
4005
|
.raven-root .cbtn{position:absolute;left:calc(var(--lane,0px) + 3px);top:1px;width:17px;height:17px;border-radius:4px;background:var(--accent);color:var(--on-accent);font:600 13px/17px var(--ui);text-align:center;opacity:0}
|
|
4005
4006
|
.raven-root .ln:hover .cbtn,.raven-root .cbtn:focus-visible{opacity:1}
|
|
4006
|
-
.raven-root .id{cursor:pointer
|
|
4007
|
+
.raven-root .id{cursor:pointer}
|
|
4007
4008
|
.raven-root .id:hover{background:color-mix(in srgb,var(--accent2) 24%,transparent);text-decoration:underline;text-underline-offset:3px}
|
|
4008
4009
|
.raven-root .id.on{background:color-mix(in srgb,var(--accent2) 24%,transparent)}
|
|
4009
4010
|
.raven-root .tok-keyword,.raven-root .tok-operatorKeyword,.raven-root .tok-modifier,.raven-root .tok-controlKeyword{color:var(--k)}
|
|
@@ -4012,8 +4013,27 @@ var STYLE = `
|
|
|
4012
4013
|
.raven-root .tok-number,.raven-root .tok-bool,.raven-root .tok-null,.raven-root .tok-atom,.raven-root .tok-literal,.raven-root .tok-propertyName{color:var(--n)}
|
|
4013
4014
|
.raven-root .tok-definition{color:var(--f)}
|
|
4014
4015
|
.raven-root .tok-typeName,.raven-root .tok-className,.raven-root .tok-namespace{color:var(--t)}
|
|
4015
|
-
.raven-root .note,.raven-root .composer{margin:4px 0 6px calc(104px + var(--lane,0px));max-width:min(74ch,calc(100% - 120px));padding:7px 10px;border:1px solid var(--line2);
|
|
4016
|
+
.raven-root .note,.raven-root .composer{margin:4px 0 6px calc(104px + var(--lane,0px));max-width:min(74ch,calc(100% - 120px));padding:7px 10px;border:1px solid var(--line2);background:var(--s1);font-family:var(--ui);font-size:13px;white-space:normal;line-height:1.45}
|
|
4016
4017
|
.raven-root .note.sent{opacity:.7}
|
|
4018
|
+
/* A note that explains the code: written into the review, by an agent or anybody. It is no comment. */
|
|
4019
|
+
.raven-root .expl{margin:4px 0 6px calc(104px + var(--lane,0px));max-width:min(78ch,calc(100% - 120px));padding:7px 10px;background:color-mix(in srgb,var(--note) 9%,var(--s0));box-shadow:inset 3px 0 0 var(--note);font-family:var(--ui);font-size:13px;line-height:1.5;white-space:normal}
|
|
4020
|
+
.raven-root .code.one .expl{margin-left:calc(72px + var(--lane,0px))}
|
|
4021
|
+
.raven-root .fb>.expl,.raven-root .body>.expl{margin:8px 10px;max-width:78ch}
|
|
4022
|
+
.raven-root .expl-h{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--fg2);margin-bottom:3px}
|
|
4023
|
+
.raven-root .expl-h span:nth-child(2){font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
4024
|
+
.raven-root .expl-h>*{flex:none;white-space:nowrap}.raven-root .expl-h>span:nth-child(2){flex:0 1 auto}.raven-root .expl-h>.sp{flex:1}
|
|
4025
|
+
.raven-root .tag.exp{background:color-mix(in srgb,var(--note) 22%,transparent);color:var(--note)}
|
|
4026
|
+
.raven-root .expl p+p{margin-top:6px}
|
|
4027
|
+
.raven-root .expl code,.raven-root .iq-s code{font-family:var(--mono);font-size:.92em;padding:0 3px;background:var(--s2)}
|
|
4028
|
+
.raven-root .expl-w{color:var(--warn);font-size:12px;margin-bottom:3px}
|
|
4029
|
+
.raven-root .expl.stale .expl-b{opacity:.75}
|
|
4030
|
+
.raven-root .expl-f{display:flex;gap:14px;margin-top:5px;font-size:12px}
|
|
4031
|
+
.raven-root .iq{display:flex;justify-content:space-between;gap:8px;align-items:baseline;width:100%;padding:3px 8px;border-radius:6px;text-align:left;box-shadow:inset 2px 0 0 var(--note)}
|
|
4032
|
+
.raven-root .iq:hover,.raven-root .iq.cur{background:var(--s2)}
|
|
4033
|
+
.raven-root .iq-b{margin:2px 0 6px 10px;padding:2px 8px 4px;border-left:2px solid var(--line2);font-size:12.5px;line-height:1.45;display:grid;gap:5px;justify-items:start}
|
|
4034
|
+
.raven-root .iq-s p+p{margin-top:5px}
|
|
4035
|
+
.raven-root .iq-l{margin:0;padding-left:20px;font-family:var(--mono);font-size:11.5px}
|
|
4036
|
+
.raven-root .iq-l .stale{color:var(--warn)}
|
|
4017
4037
|
.raven-root .note-h{font-size:12px;font-weight:600;color:var(--fg2);margin-bottom:2px;display:flex;gap:8px}
|
|
4018
4038
|
.raven-root .composer textarea{display:block;width:100%;min-height:60px;resize:vertical}
|
|
4019
4039
|
.raven-root .crow{display:flex;gap:8px;margin-top:7px}
|
|
@@ -4023,10 +4043,10 @@ var STYLE = `
|
|
|
4023
4043
|
.raven-root .sy{padding:12px 14px 2px}
|
|
4024
4044
|
.raven-root .sy-name{font:600 15px/1.3 var(--mono);word-break:break-all}
|
|
4025
4045
|
.raven-root .sy-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
|
|
4026
|
-
.raven-root .sig{margin:10px 0 0;padding:6px 10px;
|
|
4046
|
+
.raven-root .sig{margin:10px 0 0;padding:6px 10px;box-shadow:inset 2px 0 0 var(--accent2);background:var(--s1);font:var(--code-size)/var(--code-line) var(--mono);white-space:pre-wrap;overflow-wrap:anywhere;max-height:12em;overflow:auto}
|
|
4027
4047
|
.raven-root .doc{margin:8px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;max-width:72ch;color:var(--fg2);max-height:9em;overflow:auto}
|
|
4028
4048
|
.raven-root .srv .why td{border-top:0;padding-top:0;color:var(--fg2);font-size:12px;line-height:1.5}
|
|
4029
|
-
.raven-root .eg{margin:6px 0 0;padding:10px 12px;border:1px solid var(--line);
|
|
4049
|
+
.raven-root .eg{margin:6px 0 0;padding:10px 12px;border:1px solid var(--line);background:var(--s1);font:12px/1.5 var(--mono);overflow:auto;white-space:pre}
|
|
4030
4050
|
.raven-root ul.plain{margin:4px 0 0;padding-left:18px}
|
|
4031
4051
|
.raven-root .small{font-size:12px;line-height:1.5}
|
|
4032
4052
|
.raven-root .box.ask p{margin:0 0 6px}
|
|
@@ -4049,7 +4069,7 @@ var STYLE = `
|
|
|
4049
4069
|
.raven-root .hist.folded .hist-h{opacity:.6}
|
|
4050
4070
|
.raven-root .hist.cur{box-shadow:inset 3px 0 0 var(--accent2);padding-left:9px}
|
|
4051
4071
|
.raven-root .sec .hist summary{padding:2px 0 0;font-weight:400}
|
|
4052
|
-
.raven-root .hdiff{margin-top:4px;border:1px solid var(--line);
|
|
4072
|
+
.raven-root .hdiff{margin-top:4px;border:1px solid var(--line);overflow:auto;background:var(--s0);font:var(--code-size)/var(--code-line) var(--mono)}
|
|
4053
4073
|
.raven-root .hdiff>div{white-space:pre-wrap;overflow-wrap:anywhere;padding:0 8px}
|
|
4054
4074
|
.raven-root .hdiff .ha{background:var(--add-bg)}
|
|
4055
4075
|
.raven-root .hdiff .hd{background:var(--del-bg)}
|
|
@@ -4063,13 +4083,13 @@ var STYLE = `
|
|
|
4063
4083
|
.raven-root .loc.open{background:color-mix(in srgb,var(--accent2) 18%,transparent)}
|
|
4064
4084
|
.raven-root .where{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-family:var(--mono);font-size:11.5px;color:var(--fg2)}
|
|
4065
4085
|
.raven-root .txt{display:block;margin-top:1px;font-family:var(--mono);font-size:var(--code-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
4066
|
-
.raven-root .pv{margin:6px 0 8px;border:1px solid var(--line);
|
|
4067
|
-
.raven-root .box{margin:8px 0;padding:8px 10px;
|
|
4086
|
+
.raven-root .pv{margin:6px 0 8px;border:1px solid var(--line);overflow:hidden;background:var(--s0)}
|
|
4087
|
+
.raven-root .box{margin:8px 0;padding:8px 10px;font-size:12px;line-height:1.5}
|
|
4068
4088
|
.raven-root .box.warn{background:color-mix(in srgb,var(--warn) 16%,transparent)}
|
|
4069
4089
|
.raven-root .box.info{background:var(--s1);border:1px solid var(--line)}
|
|
4070
4090
|
|
|
4071
4091
|
.raven-root .scrim{position:absolute;inset:0;z-index:60;background:rgba(0,0,0,.45);display:grid;place-items:center;padding:16px}
|
|
4072
|
-
.raven-root .sheet{width:min(860px,100%);max-height:88%;overflow:auto;background:var(--s0);border:1px solid var(--line2);
|
|
4092
|
+
.raven-root .sheet{width:min(860px,100%);max-height:88%;overflow:auto;background:var(--s0);border:1px solid var(--line2);box-shadow:var(--shadow);padding:16px 18px 18px}
|
|
4073
4093
|
.raven-root .sheet-h{display:flex;align-items:center;gap:12px;margin-bottom:8px}
|
|
4074
4094
|
.raven-root .sheet-h h2{font-size:16px;font-weight:650}
|
|
4075
4095
|
.raven-root .sheet h3{font-size:13px;font-weight:600;margin:14px 0 6px}
|
|
@@ -4079,8 +4099,8 @@ var STYLE = `
|
|
|
4079
4099
|
.raven-root .rt th{font-size:12px;font-weight:600;color:var(--fg2);border-top:0}
|
|
4080
4100
|
.raven-root .form{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
|
4081
4101
|
.raven-root .form input[type=text]{flex:1 1 240px;font-family:var(--mono);font-size:12px}
|
|
4082
|
-
.raven-root .cm{border:1px solid var(--line2);
|
|
4083
|
-
.raven-root .toast{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:80;max-width:min(680px,92%);padding:8px 14px;
|
|
4102
|
+
.raven-root .cm{border:1px solid var(--line2);padding:8px 10px;margin-bottom:8px}
|
|
4103
|
+
.raven-root .toast{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);z-index:80;max-width:min(680px,92%);padding:8px 14px;background:var(--fg);color:var(--s0);line-height:1.4;box-shadow:var(--shadow)}
|
|
4084
4104
|
.raven-root .empty{padding:40px 20px;color:var(--fg2);text-align:center;line-height:1.6}
|
|
4085
4105
|
@media (prefers-reduced-motion:reduce){.raven-root *{animation:none!important}}
|
|
4086
4106
|
`;
|
|
@@ -4162,7 +4182,8 @@ function mountReview(container, client, initialTheme) {
|
|
|
4162
4182
|
state: { viewed: {}, comments: [], overrides: {} },
|
|
4163
4183
|
views: new Map,
|
|
4164
4184
|
tokens: new Map,
|
|
4165
|
-
blames: new Map
|
|
4185
|
+
blames: new Map,
|
|
4186
|
+
inquiries: []
|
|
4166
4187
|
},
|
|
4167
4188
|
canvas: {
|
|
4168
4189
|
mode: "outline",
|
|
@@ -4186,6 +4207,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4186
4207
|
lane: 0,
|
|
4187
4208
|
lanes: 1,
|
|
4188
4209
|
find: { open: false, q: "", hits: [], at: -1 },
|
|
4210
|
+
inquiry: "",
|
|
4189
4211
|
shelfOpen: false,
|
|
4190
4212
|
error: "",
|
|
4191
4213
|
done: false
|
|
@@ -4291,6 +4313,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4291
4313
|
S.data.state = state;
|
|
4292
4314
|
S.data.views.clear();
|
|
4293
4315
|
S.data.blames.clear();
|
|
4316
|
+
S.data.inquiries = await client.call("notes.get", { changeSetId: id() }).then((r) => r.inquiries, () => []);
|
|
4294
4317
|
S.data.tokens.clear();
|
|
4295
4318
|
if (!canvasLoaded && !canvasRefused) {
|
|
4296
4319
|
try {
|
|
@@ -4322,6 +4345,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4322
4345
|
S.view.error = "";
|
|
4323
4346
|
watchServers(true);
|
|
4324
4347
|
watchAnswers();
|
|
4348
|
+
watchNotes();
|
|
4325
4349
|
} catch (err) {
|
|
4326
4350
|
S.view.error = err instanceof Error ? err.message : String(err);
|
|
4327
4351
|
}
|
|
@@ -4527,6 +4551,108 @@ function mountReview(container, client, initialTheme) {
|
|
|
4527
4551
|
if (!S.view.done)
|
|
4528
4552
|
answersTimer = setTimeout(() => void watchAnswers(), ANSWER_POLL_MS);
|
|
4529
4553
|
}
|
|
4554
|
+
const NOTES_POLL_MS = 5000;
|
|
4555
|
+
let notesTimer;
|
|
4556
|
+
async function watchNotes() {
|
|
4557
|
+
clearTimeout(notesTimer);
|
|
4558
|
+
if (!live || S.view.done || !S.data.summary)
|
|
4559
|
+
return;
|
|
4560
|
+
const change = S.data.summary.id;
|
|
4561
|
+
try {
|
|
4562
|
+
const { inquiries } = await client.call("notes.get", { changeSetId: change });
|
|
4563
|
+
if (S.data.summary?.id === change && JSON.stringify(inquiries) !== JSON.stringify(S.data.inquiries)) {
|
|
4564
|
+
const known = new Set(S.data.inquiries.map((q) => `${q.id} ${q.at}`));
|
|
4565
|
+
const fresh = inquiries.filter((q) => !known.has(`${q.id} ${q.at}`));
|
|
4566
|
+
S.data.inquiries = inquiries;
|
|
4567
|
+
showNotes();
|
|
4568
|
+
if (fresh.length)
|
|
4569
|
+
toast(`${fresh.at(-1).author} wrote out a line of inquiry: "${fresh.at(-1).title}". It is at the top of the outline.`);
|
|
4570
|
+
}
|
|
4571
|
+
} catch {}
|
|
4572
|
+
if (!S.view.done)
|
|
4573
|
+
notesTimer = setTimeout(() => void watchNotes(), NOTES_POLL_MS);
|
|
4574
|
+
}
|
|
4575
|
+
function showNotes() {
|
|
4576
|
+
renderOutline();
|
|
4577
|
+
for (const r of S.canvas.roots)
|
|
4578
|
+
if (r.path)
|
|
4579
|
+
redrawInPlace(r);
|
|
4580
|
+
for (const r of S.canvas.roots) {
|
|
4581
|
+
for (const p of S.canvas.trails.get(keyOf(r.path))) {
|
|
4582
|
+
const body = p.target.kind === "place" ? $(".body", paneEls.get(p.id)) : null;
|
|
4583
|
+
if (body)
|
|
4584
|
+
fillTrip(p, body);
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
}
|
|
4588
|
+
const notesOf = (path) => S.data.inquiries.flatMap((q) => q.stops.flatMap((stop, i) => stop.path === path ? [{ q, stop, i }] : []));
|
|
4589
|
+
const prose = (body) => body.split(/\n\s*\n/).map((para) => h("p", null, para.split("`").map((part, i) => i % 2 ? h("code", { text: part }) : part)));
|
|
4590
|
+
function explEl(q, stop, i) {
|
|
4591
|
+
const lines = stop.line === undefined ? "this file" : stop.endLine ? `lines ${stop.line} to ${stop.endLine}` : `line ${stop.line}`;
|
|
4592
|
+
return h(`div.expl${stop.stale ? ".stale" : ""}`, { data: { stop: stop.id } }, h("div.expl-h", null, h("span.tag.exp", { text: "explained" }), h("span", { title: q.title, text: `${q.title}, ${i + 1} of ${q.stops.length}: ${lines}` }), h("span.sp"), h("span.muted", { text: stop.author ?? q.author }), live ? h("button.link", { title: "Remove this note", onclick: () => void removeInquiry(q, stop.id) }, "Remove") : null), stop.stale ? h("div.expl-w", { text: stop.line === undefined ? "This file has gone since this was written." : "These lines have changed since this was written." }) : null, h("div.expl-b", null, prose(stop.body)), q.stops.length > 1 ? h("div.expl-f", null, i > 0 ? h("button.link", { onclick: () => walk(q, i - 1) }, "Previous stop") : null, i < q.stops.length - 1 ? h("button.link", { onclick: () => walk(q, i + 1) }, "Next stop") : null) : null);
|
|
4593
|
+
}
|
|
4594
|
+
function walk(q, at = 0) {
|
|
4595
|
+
const first = q.stops[0];
|
|
4596
|
+
if (!first)
|
|
4597
|
+
return;
|
|
4598
|
+
const rooted = fileOf(first.path)?.disposition === "shown";
|
|
4599
|
+
if (rooted && first.path !== S.canvas.path)
|
|
4600
|
+
goFile(first.path);
|
|
4601
|
+
S.view.inquiry = q.id;
|
|
4602
|
+
let from = "home";
|
|
4603
|
+
const panes = [];
|
|
4604
|
+
for (const [i, stop] of q.stops.entries()) {
|
|
4605
|
+
if (i === 0 && rooted) {
|
|
4606
|
+
panes.push("home");
|
|
4607
|
+
continue;
|
|
4608
|
+
}
|
|
4609
|
+
const { pane, existing } = S.canvas.trails.open(homeKey(), { kind: "place", path: stop.path, line: stop.line ?? 1 }, from);
|
|
4610
|
+
if (!live && !existing)
|
|
4611
|
+
asked.add(pane.id);
|
|
4612
|
+
from = pane.id;
|
|
4613
|
+
panes.push(pane.id);
|
|
4614
|
+
}
|
|
4615
|
+
renderOutline();
|
|
4616
|
+
renderTrips();
|
|
4617
|
+
const pid = panes[Math.min(at, panes.length - 1)];
|
|
4618
|
+
setFocus(pid);
|
|
4619
|
+
const stop = q.stops[Math.min(at, q.stops.length - 1)];
|
|
4620
|
+
if (pid === "home")
|
|
4621
|
+
renderHome(false).then(() => {
|
|
4622
|
+
if (stop.line)
|
|
4623
|
+
flash(stop.path, stop.line);
|
|
4624
|
+
else
|
|
4625
|
+
$(".main", home).scrollTop = 0;
|
|
4626
|
+
});
|
|
4627
|
+
savePosition();
|
|
4628
|
+
}
|
|
4629
|
+
async function removeInquiry(q, stop) {
|
|
4630
|
+
await client.call("notes.remove", { changeSetId: id(), id: q.id, ...stop ? { stop } : {} });
|
|
4631
|
+
S.data.inquiries = (await client.call("notes.get", { changeSetId: id() })).inquiries;
|
|
4632
|
+
showNotes();
|
|
4633
|
+
}
|
|
4634
|
+
const notesHome = () => S.data.inquiries.find((q) => q.id === S.view.inquiry);
|
|
4635
|
+
async function addNote(path, line, body) {
|
|
4636
|
+
const to = notesHome();
|
|
4637
|
+
const q = await client.call("notes.add", { changeSetId: id(), ...to ? { inquiry: to.id } : {}, stop: { path, line, body } });
|
|
4638
|
+
S.data.inquiries = (await client.call("notes.get", { changeSetId: id() })).inquiries;
|
|
4639
|
+
S.view.inquiry = q.id;
|
|
4640
|
+
showNotes();
|
|
4641
|
+
}
|
|
4642
|
+
function inquiryList() {
|
|
4643
|
+
if (!S.data.inquiries.length)
|
|
4644
|
+
return [];
|
|
4645
|
+
return [
|
|
4646
|
+
h("div.grp", null, h("span", { text: "Lines of inquiry" }), h("span.n", { text: String(S.data.inquiries.length) })),
|
|
4647
|
+
...S.data.inquiries.flatMap((q) => {
|
|
4648
|
+
const open = S.view.inquiry === q.id;
|
|
4649
|
+
return [
|
|
4650
|
+
h(`button.iq${open ? ".cur" : ""}`, { data: { inquiry: q.id }, title: `Walk it: its ${q.stops.length} stop${q.stops.length === 1 ? "" : "s"} open as a line of panes`, onclick: () => walk(q) }, h("span.fn", { text: q.title }), h("span.fs.muted", { text: `${q.stops.length} stop${q.stops.length === 1 ? "" : "s"}` })),
|
|
4651
|
+
open ? h("div.iq-b", null, h("div.muted.fs", { text: `Begun by ${q.author}. It explains; it asks nothing of anybody.` }), q.summary ? h("div.iq-s", null, prose(q.summary)) : null, h("ol.iq-l", null, q.stops.map((stop, i) => h("li", null, h(`button.link${stop.stale ? ".stale" : ""}`, { title: stop.body, onclick: () => walk(q, i) }, `${base(stop.path)}${stop.line ? `:${stop.line}` : ""}`)))), live ? h("button.link", { onclick: () => void removeInquiry(q) }, "Remove it from this review") : null) : null
|
|
4652
|
+
];
|
|
4653
|
+
})
|
|
4654
|
+
];
|
|
4655
|
+
}
|
|
4530
4656
|
function waitingBar(unsent) {
|
|
4531
4657
|
const a = S.host.answer;
|
|
4532
4658
|
if (!client.answers || !a)
|
|
@@ -4546,10 +4672,11 @@ function mountReview(container, client, initialTheme) {
|
|
|
4546
4672
|
clearInterval(canvasWatch);
|
|
4547
4673
|
clearTimeout(serversTimer);
|
|
4548
4674
|
clearTimeout(answersTimer);
|
|
4675
|
+
clearTimeout(notesTimer);
|
|
4549
4676
|
clearTimeout(toastTimer);
|
|
4550
4677
|
sheet = null;
|
|
4551
4678
|
serversSheet = undefined;
|
|
4552
|
-
root.replaceChildren(h("div.
|
|
4679
|
+
root.replaceChildren(h("div.finished", { role: "status" }, h("h1", { text: title }), h("p", { text }), h("p.muted", { text: "You can close this tab." })));
|
|
4553
4680
|
}
|
|
4554
4681
|
function baseBar(s) {
|
|
4555
4682
|
const options = s.baseOptions ?? [];
|
|
@@ -4618,6 +4745,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4618
4745
|
const items = [];
|
|
4619
4746
|
if (S.data.summary) {
|
|
4620
4747
|
items.push(h("div.lhead", null, h("div.lt", { text: S.canvas.mode === "outline" ? "Outline" : "Files" }), h("span.sp"), h("span.muted.fs", { text: `${shown().length} files` }), h("button.x.fold", { title: "Hide the outline (o)", "aria-label": "Hide the outline", onclick: () => toggleOutline(false) }, "«")));
|
|
4748
|
+
items.push(...inquiryList());
|
|
4621
4749
|
if (S.canvas.mode === "outline") {
|
|
4622
4750
|
items.push(h("p.note2", { text: "Grouped by package, largest change first; tests after the code they test. An agent-written guide will replace this order." }));
|
|
4623
4751
|
for (const g of groups()) {
|
|
@@ -4760,7 +4888,12 @@ function mountReview(container, client, initialTheme) {
|
|
|
4760
4888
|
return block;
|
|
4761
4889
|
}
|
|
4762
4890
|
const { root: pane } = opts;
|
|
4763
|
-
const
|
|
4891
|
+
const notes = notesOf(v.path);
|
|
4892
|
+
const noted = (row) => row.newLine !== undefined && notes.some(({ stop }) => stop.line !== undefined && row.newLine >= stop.line && row.newLine <= (stop.endLine ?? stop.line));
|
|
4893
|
+
for (const { q, stop, i } of notes)
|
|
4894
|
+
if (stop.line === undefined)
|
|
4895
|
+
block.append(explEl(q, stop, i));
|
|
4896
|
+
const folded = opts.around ? [] : diffRows(v, 3, notes.length ? noted : undefined);
|
|
4764
4897
|
const rows = opts.around || pane && wholeOf(pane) ? allRows(v) : folded;
|
|
4765
4898
|
if (pane)
|
|
4766
4899
|
block.dataset.folds = String(folded.filter((row) => row.kind === "gap").length);
|
|
@@ -4786,6 +4919,11 @@ function mountReview(container, client, initialTheme) {
|
|
|
4786
4919
|
code.append(segHeader(seg));
|
|
4787
4920
|
}
|
|
4788
4921
|
code.append(lineEl(v, row, opts.home, undefined, oneSide));
|
|
4922
|
+
if (row.type !== "remove") {
|
|
4923
|
+
for (const { q, stop, i } of notes)
|
|
4924
|
+
if (stop.line !== undefined && (stop.endLine ?? stop.line) === row.newLine)
|
|
4925
|
+
code.append(explEl(q, stop, i));
|
|
4926
|
+
}
|
|
4789
4927
|
if (opts.home)
|
|
4790
4928
|
for (const c of commentsAt(v.path, row))
|
|
4791
4929
|
code.append(noteEl(c));
|
|
@@ -4854,7 +4992,15 @@ function mountReview(container, client, initialTheme) {
|
|
|
4854
4992
|
S.data.state = { ...S.data.state, comments: [...S.data.state.comments.filter((x) => x.id !== c.id), c] };
|
|
4855
4993
|
box.replaceWith(noteEl(c));
|
|
4856
4994
|
renderHead();
|
|
4857
|
-
} }, "Add comment"), h("button.btn", {
|
|
4995
|
+
} }, "Add comment"), live && side === "new" ? h("button.btn.asnote", {
|
|
4996
|
+
title: notesHome() ? `Keep this as a note on "${notesHome().title}": it explains, and is not sent to anybody` : "Keep this as a note of your own: it explains, and is not sent to anybody",
|
|
4997
|
+
onclick: async () => {
|
|
4998
|
+
const body = ta.value.trim();
|
|
4999
|
+
if (!body)
|
|
5000
|
+
return void ta.focus();
|
|
5001
|
+
await addNote(path, line, body).catch((err) => toast(err instanceof Error ? err.message : String(err)));
|
|
5002
|
+
}
|
|
5003
|
+
}, "Keep as a note") : null, h("button.btn", { onclick: () => box.remove() }, "Cancel")));
|
|
4858
5004
|
row.after(box);
|
|
4859
5005
|
ta.focus();
|
|
4860
5006
|
}
|
|
@@ -5779,7 +5925,16 @@ function mountReview(container, client, initialTheme) {
|
|
|
5779
5925
|
return out;
|
|
5780
5926
|
}
|
|
5781
5927
|
const r = await client.call("text.read", { changeSetId: id(), path, ...placeLines(line) });
|
|
5782
|
-
|
|
5928
|
+
const code = plainCode(path, r.start, r.lines, line);
|
|
5929
|
+
const said = notesOf(path);
|
|
5930
|
+
for (const { q, stop, i } of said) {
|
|
5931
|
+
const under = stop.line === undefined ? undefined : code.children[(stop.endLine ?? stop.line) - r.start];
|
|
5932
|
+
if (stop.line === undefined)
|
|
5933
|
+
out.push(explEl(q, stop, i));
|
|
5934
|
+
else if (under)
|
|
5935
|
+
under.after(explEl(q, stop, i));
|
|
5936
|
+
}
|
|
5937
|
+
out.push(h("section.sec", null, h("div.pv", null, code), h("p.muted.fs", { text: `Lines ${r.start} to ${r.start + r.lines.length - 1} of ${r.total}. This file is not part of the change; it is shown read-only.` })));
|
|
5783
5938
|
return out;
|
|
5784
5939
|
}
|
|
5785
5940
|
function plainCode(path, start, lines, markLine) {
|
|
@@ -6067,6 +6222,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
6067
6222
|
clearInterval(canvasWatch);
|
|
6068
6223
|
saveCanvas();
|
|
6069
6224
|
clearTimeout(snapTimer);
|
|
6225
|
+
clearTimeout(notesTimer);
|
|
6070
6226
|
clearTimeout(toastTimer);
|
|
6071
6227
|
root.remove();
|
|
6072
6228
|
}
|
|
@@ -6434,6 +6590,27 @@ var Canvas = z2.object({
|
|
|
6434
6590
|
roots: z2.array(CanvasRoot),
|
|
6435
6591
|
panes: z2.array(CanvasPane)
|
|
6436
6592
|
});
|
|
6593
|
+
var NoteStop = z2.object({
|
|
6594
|
+
id: z2.string(),
|
|
6595
|
+
path: z2.string(),
|
|
6596
|
+
line: z2.number().int().positive().optional(),
|
|
6597
|
+
endLine: z2.number().int().positive().optional(),
|
|
6598
|
+
body: z2.string(),
|
|
6599
|
+
author: z2.string().optional(),
|
|
6600
|
+
quote: z2.string().optional(),
|
|
6601
|
+
stale: z2.boolean().optional()
|
|
6602
|
+
});
|
|
6603
|
+
var Inquiry = z2.object({
|
|
6604
|
+
id: z2.string(),
|
|
6605
|
+
title: z2.string(),
|
|
6606
|
+
summary: z2.string().optional(),
|
|
6607
|
+
author: z2.string(),
|
|
6608
|
+
at: z2.string(),
|
|
6609
|
+
stops: z2.array(NoteStop)
|
|
6610
|
+
});
|
|
6611
|
+
var NOTES_FORMAT = "raven.notes";
|
|
6612
|
+
var NOTES_VERSION = 1;
|
|
6613
|
+
var Notes = z2.object({ format: z2.literal(NOTES_FORMAT), version: z2.literal(NOTES_VERSION), inquiries: z2.array(Inquiry) });
|
|
6437
6614
|
var SNAPSHOT_FORMAT = "raven.snapshot";
|
|
6438
6615
|
var SNAPSHOT_VERSION = 1;
|
|
6439
6616
|
var Snapshot = z2.object({
|
|
@@ -6491,6 +6668,32 @@ var methods = {
|
|
|
6491
6668
|
input: z3.object({ changeSetId: z3.string(), title: z3.string().optional(), pullRequest: z3.number().int().optional() }),
|
|
6492
6669
|
output: Snapshot
|
|
6493
6670
|
},
|
|
6671
|
+
"notes.get": { input: ChangeSetRef, output: z3.object({ inquiries: z3.array(Inquiry) }) },
|
|
6672
|
+
"notes.put": {
|
|
6673
|
+
input: z3.object({
|
|
6674
|
+
changeSetId: z3.string(),
|
|
6675
|
+
title: z3.string().min(1).max(200),
|
|
6676
|
+
summary: z3.string().max(4000).optional(),
|
|
6677
|
+
author: z3.string().max(80).optional(),
|
|
6678
|
+
stops: z3.array(z3.object({
|
|
6679
|
+
path: z3.string().min(1),
|
|
6680
|
+
line: z3.number().int().positive().optional(),
|
|
6681
|
+
endLine: z3.number().int().positive().optional(),
|
|
6682
|
+
body: z3.string().min(1).max(4000)
|
|
6683
|
+
})).min(1).max(40)
|
|
6684
|
+
}),
|
|
6685
|
+
output: Inquiry
|
|
6686
|
+
},
|
|
6687
|
+
"notes.add": {
|
|
6688
|
+
input: z3.object({
|
|
6689
|
+
changeSetId: z3.string(),
|
|
6690
|
+
inquiry: z3.string().optional(),
|
|
6691
|
+
title: z3.string().min(1).max(200).optional(),
|
|
6692
|
+
stop: z3.object({ path: z3.string().min(1), line: z3.number().int().positive().optional(), endLine: z3.number().int().positive().optional(), body: z3.string().min(1).max(4000) })
|
|
6693
|
+
}),
|
|
6694
|
+
output: Inquiry
|
|
6695
|
+
},
|
|
6696
|
+
"notes.remove": { input: z3.object({ changeSetId: z3.string(), id: z3.string(), stop: z3.string().optional() }), output: z3.object({}) },
|
|
6494
6697
|
"comment.upsert": {
|
|
6495
6698
|
input: z3.object({ changeSetId: z3.string(), id: z3.string().optional(), anchor: CommentAnchor, body: z3.string().min(1) }),
|
|
6496
6699
|
output: Comment
|
|
@@ -6719,5 +6922,5 @@ export {
|
|
|
6719
6922
|
contribute as default
|
|
6720
6923
|
};
|
|
6721
6924
|
|
|
6722
|
-
//# debugId=
|
|
6925
|
+
//# debugId=01B092B12DD42C7364756E2164756E21
|
|
6723
6926
|
//# sourceMappingURL=index.js.map
|