@disintegrator/raven-paseo 0.0.1 → 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 +235 -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)",
|
|
@@ -3811,6 +3812,7 @@ var STYLE = `
|
|
|
3811
3812
|
.raven-root button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;text-align:inherit}
|
|
3812
3813
|
.raven-root button:focus-visible,.raven-root input:focus-visible,.raven-root select:focus-visible,.raven-root textarea:focus-visible{outline:2px solid var(--accent2);outline-offset:1px;border-radius:4px}
|
|
3813
3814
|
.raven-root input[type=text],.raven-root select,.raven-root textarea{font:inherit;color:var(--fg);background:var(--s1);border:1px solid var(--line2);border-radius:6px;padding:5px 8px}
|
|
3815
|
+
.raven-root select{appearance:none;-webkit-appearance:none;padding-right:30px;background-image:linear-gradient(45deg,transparent 50%,var(--fg2) 50%),linear-gradient(135deg,var(--fg2) 50%,transparent 50%);background-position:calc(100% - 17px) 50%,calc(100% - 12px) 50%;background-size:5px 5px;background-repeat:no-repeat}
|
|
3814
3816
|
.raven-root h1,.raven-root h2,.raven-root h3,.raven-root h4,.raven-root p{margin:0}
|
|
3815
3817
|
.raven-root .mono{font-family:var(--mono);font-size:var(--code-size)}
|
|
3816
3818
|
.raven-root .muted{color:var(--fg2)}
|
|
@@ -3833,8 +3835,8 @@ var STYLE = `
|
|
|
3833
3835
|
.raven-root .seg.wseg button{font-family:var(--mono);font-size:11.5px;padding:0 7px}
|
|
3834
3836
|
/* The diff of this file folds nothing: the two ways of showing it are one. */
|
|
3835
3837
|
.raven-root .seg.vseg[data-same]{opacity:.6}
|
|
3836
|
-
.raven-root .count{min-width:18px;height:18px;padding:0 5px;
|
|
3837
|
-
.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}
|
|
3838
3840
|
.raven-root .tag.good{background:color-mix(in srgb,var(--ok) 18%,transparent);color:var(--ok)}
|
|
3839
3841
|
.raven-root .tag.warn{background:color-mix(in srgb,var(--warn) 20%,transparent);color:var(--warn)}
|
|
3840
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}
|
|
@@ -3853,18 +3855,18 @@ var STYLE = `
|
|
|
3853
3855
|
.raven-root .acts{margin-left:0;justify-content:flex-start;overflow-x:auto;scrollbar-width:none}
|
|
3854
3856
|
.raven-root .cap{flex-wrap:wrap}
|
|
3855
3857
|
}
|
|
3856
|
-
.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}
|
|
3857
3859
|
.raven-root .basebar .btn .muted{font-size:11px}
|
|
3858
3860
|
.raven-root .waitbar{background:color-mix(in srgb,var(--warn) 14%,transparent)}
|
|
3859
3861
|
.raven-root .copybar .sign{margin-left:auto;display:flex;align-items:center;gap:6px;white-space:nowrap;color:var(--fg2)}
|
|
3860
3862
|
.raven-root .copybar input{font:inherit;padding:2px 6px;border-radius:5px;border:1px solid var(--line2);background:var(--s0);color:var(--fg)}
|
|
3861
3863
|
.raven-root .note.theirs{box-shadow:inset 2px 0 0 var(--accent2)}
|
|
3862
3864
|
.raven-root .waitbar .btn{margin-left:auto}
|
|
3863
|
-
.raven-root .
|
|
3864
|
-
.raven-root .
|
|
3865
|
-
.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}
|
|
3866
3868
|
.raven-root .base-note{flex-basis:100%;color:var(--warn)}
|
|
3867
|
-
.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)}
|
|
3868
3870
|
.raven-root .bar i{display:block;background:var(--accent)}
|
|
3869
3871
|
.raven-root .cap{display:flex;justify-content:space-between;gap:14px;color:var(--fg2);font-size:12px;margin-top:4px}
|
|
3870
3872
|
.raven-root .journey{display:flex;align-items:center;gap:6px;margin-top:7px;overflow-x:auto;white-space:nowrap;font-size:12px}
|
|
@@ -3887,7 +3889,7 @@ var STYLE = `
|
|
|
3887
3889
|
/* A pane's wrapper is as tall as the lanes it spans. The pane sticks to the top of the view inside it,
|
|
3888
3890
|
so on every line that grows from a pane, that pane stays in sight on the left. */
|
|
3889
3891
|
.raven-root .span{position:absolute}
|
|
3890
|
-
.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}
|
|
3891
3893
|
.raven-root .plane>.pane.ghost{position:absolute}
|
|
3892
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)}
|
|
3893
3895
|
.raven-root .links{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}
|
|
@@ -3898,10 +3900,10 @@ var STYLE = `
|
|
|
3898
3900
|
.raven-root .shade{display:none}
|
|
3899
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)}
|
|
3900
3902
|
.raven-root.map .shade:hover{background:color-mix(in srgb,var(--accent2) 16%,transparent)}
|
|
3901
|
-
.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}
|
|
3902
3904
|
.raven-root.map .span>.pane.focus{outline:calc(2px / var(--scale,1)) solid var(--accent2)}
|
|
3903
3905
|
/* On the map a wrapper shows as a band: how far down the lines that grew from its pane reach. */
|
|
3904
|
-
.raven-root.map .span{
|
|
3906
|
+
.raven-root.map .span{background:color-mix(in srgb,var(--fg3) 12%,transparent)}
|
|
3905
3907
|
.raven-root .shade-x{display:none}
|
|
3906
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}
|
|
3907
3909
|
.raven-root.map .shade-x:hover{background:var(--bad);border-color:var(--bad);color:var(--s0)}
|
|
@@ -3929,7 +3931,7 @@ var STYLE = `
|
|
|
3929
3931
|
.raven-root .main{padding:12px 18px 80px}
|
|
3930
3932
|
/* Stands where the first side trip will open, as wide as a pane. */
|
|
3931
3933
|
.raven-root .plane>.pane.ghost{border:0;background:none;display:grid;place-items:center start;padding:20px 28px}
|
|
3932
|
-
.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}
|
|
3933
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}
|
|
3934
3936
|
.raven-root .x:hover{background:var(--s2);color:var(--fg)}
|
|
3935
3937
|
|
|
@@ -3959,8 +3961,8 @@ var STYLE = `
|
|
|
3959
3961
|
.raven-root .sk-a{display:flex;gap:10px;font-size:12px;margin-top:1px}
|
|
3960
3962
|
|
|
3961
3963
|
.raven-root .crumb{color:var(--fg2);font-size:12px;margin-bottom:6px}
|
|
3962
|
-
.raven-root .fb{border:1px solid var(--line2);
|
|
3963
|
-
.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}
|
|
3964
3966
|
.raven-root .path{display:flex;font-family:var(--mono);font-size:var(--code-size);white-space:nowrap;min-width:0}
|
|
3965
3967
|
.raven-root .path .dir{color:var(--fg3);overflow:hidden;text-overflow:ellipsis;min-width:0}
|
|
3966
3968
|
.raven-root .path b{flex:none}
|
|
@@ -4002,7 +4004,7 @@ var STYLE = `
|
|
|
4002
4004
|
@keyframes pr-flash{from{background-color:color-mix(in srgb,var(--accent2) 45%,transparent)}}
|
|
4003
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}
|
|
4004
4006
|
.raven-root .ln:hover .cbtn,.raven-root .cbtn:focus-visible{opacity:1}
|
|
4005
|
-
.raven-root .id{cursor:pointer
|
|
4007
|
+
.raven-root .id{cursor:pointer}
|
|
4006
4008
|
.raven-root .id:hover{background:color-mix(in srgb,var(--accent2) 24%,transparent);text-decoration:underline;text-underline-offset:3px}
|
|
4007
4009
|
.raven-root .id.on{background:color-mix(in srgb,var(--accent2) 24%,transparent)}
|
|
4008
4010
|
.raven-root .tok-keyword,.raven-root .tok-operatorKeyword,.raven-root .tok-modifier,.raven-root .tok-controlKeyword{color:var(--k)}
|
|
@@ -4011,8 +4013,27 @@ var STYLE = `
|
|
|
4011
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)}
|
|
4012
4014
|
.raven-root .tok-definition{color:var(--f)}
|
|
4013
4015
|
.raven-root .tok-typeName,.raven-root .tok-className,.raven-root .tok-namespace{color:var(--t)}
|
|
4014
|
-
.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}
|
|
4015
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)}
|
|
4016
4037
|
.raven-root .note-h{font-size:12px;font-weight:600;color:var(--fg2);margin-bottom:2px;display:flex;gap:8px}
|
|
4017
4038
|
.raven-root .composer textarea{display:block;width:100%;min-height:60px;resize:vertical}
|
|
4018
4039
|
.raven-root .crow{display:flex;gap:8px;margin-top:7px}
|
|
@@ -4022,10 +4043,10 @@ var STYLE = `
|
|
|
4022
4043
|
.raven-root .sy{padding:12px 14px 2px}
|
|
4023
4044
|
.raven-root .sy-name{font:600 15px/1.3 var(--mono);word-break:break-all}
|
|
4024
4045
|
.raven-root .sy-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
|
|
4025
|
-
.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}
|
|
4026
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}
|
|
4027
4048
|
.raven-root .srv .why td{border-top:0;padding-top:0;color:var(--fg2);font-size:12px;line-height:1.5}
|
|
4028
|
-
.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}
|
|
4029
4050
|
.raven-root ul.plain{margin:4px 0 0;padding-left:18px}
|
|
4030
4051
|
.raven-root .small{font-size:12px;line-height:1.5}
|
|
4031
4052
|
.raven-root .box.ask p{margin:0 0 6px}
|
|
@@ -4048,7 +4069,7 @@ var STYLE = `
|
|
|
4048
4069
|
.raven-root .hist.folded .hist-h{opacity:.6}
|
|
4049
4070
|
.raven-root .hist.cur{box-shadow:inset 3px 0 0 var(--accent2);padding-left:9px}
|
|
4050
4071
|
.raven-root .sec .hist summary{padding:2px 0 0;font-weight:400}
|
|
4051
|
-
.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)}
|
|
4052
4073
|
.raven-root .hdiff>div{white-space:pre-wrap;overflow-wrap:anywhere;padding:0 8px}
|
|
4053
4074
|
.raven-root .hdiff .ha{background:var(--add-bg)}
|
|
4054
4075
|
.raven-root .hdiff .hd{background:var(--del-bg)}
|
|
@@ -4062,13 +4083,13 @@ var STYLE = `
|
|
|
4062
4083
|
.raven-root .loc.open{background:color-mix(in srgb,var(--accent2) 18%,transparent)}
|
|
4063
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)}
|
|
4064
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}
|
|
4065
|
-
.raven-root .pv{margin:6px 0 8px;border:1px solid var(--line);
|
|
4066
|
-
.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}
|
|
4067
4088
|
.raven-root .box.warn{background:color-mix(in srgb,var(--warn) 16%,transparent)}
|
|
4068
4089
|
.raven-root .box.info{background:var(--s1);border:1px solid var(--line)}
|
|
4069
4090
|
|
|
4070
4091
|
.raven-root .scrim{position:absolute;inset:0;z-index:60;background:rgba(0,0,0,.45);display:grid;place-items:center;padding:16px}
|
|
4071
|
-
.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}
|
|
4072
4093
|
.raven-root .sheet-h{display:flex;align-items:center;gap:12px;margin-bottom:8px}
|
|
4073
4094
|
.raven-root .sheet-h h2{font-size:16px;font-weight:650}
|
|
4074
4095
|
.raven-root .sheet h3{font-size:13px;font-weight:600;margin:14px 0 6px}
|
|
@@ -4078,8 +4099,8 @@ var STYLE = `
|
|
|
4078
4099
|
.raven-root .rt th{font-size:12px;font-weight:600;color:var(--fg2);border-top:0}
|
|
4079
4100
|
.raven-root .form{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
|
4080
4101
|
.raven-root .form input[type=text]{flex:1 1 240px;font-family:var(--mono);font-size:12px}
|
|
4081
|
-
.raven-root .cm{border:1px solid var(--line2);
|
|
4082
|
-
.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)}
|
|
4083
4104
|
.raven-root .empty{padding:40px 20px;color:var(--fg2);text-align:center;line-height:1.6}
|
|
4084
4105
|
@media (prefers-reduced-motion:reduce){.raven-root *{animation:none!important}}
|
|
4085
4106
|
`;
|
|
@@ -4161,7 +4182,8 @@ function mountReview(container, client, initialTheme) {
|
|
|
4161
4182
|
state: { viewed: {}, comments: [], overrides: {} },
|
|
4162
4183
|
views: new Map,
|
|
4163
4184
|
tokens: new Map,
|
|
4164
|
-
blames: new Map
|
|
4185
|
+
blames: new Map,
|
|
4186
|
+
inquiries: []
|
|
4165
4187
|
},
|
|
4166
4188
|
canvas: {
|
|
4167
4189
|
mode: "outline",
|
|
@@ -4185,6 +4207,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4185
4207
|
lane: 0,
|
|
4186
4208
|
lanes: 1,
|
|
4187
4209
|
find: { open: false, q: "", hits: [], at: -1 },
|
|
4210
|
+
inquiry: "",
|
|
4188
4211
|
shelfOpen: false,
|
|
4189
4212
|
error: "",
|
|
4190
4213
|
done: false
|
|
@@ -4290,6 +4313,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4290
4313
|
S.data.state = state;
|
|
4291
4314
|
S.data.views.clear();
|
|
4292
4315
|
S.data.blames.clear();
|
|
4316
|
+
S.data.inquiries = await client.call("notes.get", { changeSetId: id() }).then((r) => r.inquiries, () => []);
|
|
4293
4317
|
S.data.tokens.clear();
|
|
4294
4318
|
if (!canvasLoaded && !canvasRefused) {
|
|
4295
4319
|
try {
|
|
@@ -4321,6 +4345,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4321
4345
|
S.view.error = "";
|
|
4322
4346
|
watchServers(true);
|
|
4323
4347
|
watchAnswers();
|
|
4348
|
+
watchNotes();
|
|
4324
4349
|
} catch (err) {
|
|
4325
4350
|
S.view.error = err instanceof Error ? err.message : String(err);
|
|
4326
4351
|
}
|
|
@@ -4526,6 +4551,108 @@ function mountReview(container, client, initialTheme) {
|
|
|
4526
4551
|
if (!S.view.done)
|
|
4527
4552
|
answersTimer = setTimeout(() => void watchAnswers(), ANSWER_POLL_MS);
|
|
4528
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
|
+
}
|
|
4529
4656
|
function waitingBar(unsent) {
|
|
4530
4657
|
const a = S.host.answer;
|
|
4531
4658
|
if (!client.answers || !a)
|
|
@@ -4545,10 +4672,11 @@ function mountReview(container, client, initialTheme) {
|
|
|
4545
4672
|
clearInterval(canvasWatch);
|
|
4546
4673
|
clearTimeout(serversTimer);
|
|
4547
4674
|
clearTimeout(answersTimer);
|
|
4675
|
+
clearTimeout(notesTimer);
|
|
4548
4676
|
clearTimeout(toastTimer);
|
|
4549
4677
|
sheet = null;
|
|
4550
4678
|
serversSheet = undefined;
|
|
4551
|
-
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." })));
|
|
4552
4680
|
}
|
|
4553
4681
|
function baseBar(s) {
|
|
4554
4682
|
const options = s.baseOptions ?? [];
|
|
@@ -4617,6 +4745,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
4617
4745
|
const items = [];
|
|
4618
4746
|
if (S.data.summary) {
|
|
4619
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());
|
|
4620
4749
|
if (S.canvas.mode === "outline") {
|
|
4621
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." }));
|
|
4622
4751
|
for (const g of groups()) {
|
|
@@ -4759,7 +4888,12 @@ function mountReview(container, client, initialTheme) {
|
|
|
4759
4888
|
return block;
|
|
4760
4889
|
}
|
|
4761
4890
|
const { root: pane } = opts;
|
|
4762
|
-
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);
|
|
4763
4897
|
const rows = opts.around || pane && wholeOf(pane) ? allRows(v) : folded;
|
|
4764
4898
|
if (pane)
|
|
4765
4899
|
block.dataset.folds = String(folded.filter((row) => row.kind === "gap").length);
|
|
@@ -4785,6 +4919,11 @@ function mountReview(container, client, initialTheme) {
|
|
|
4785
4919
|
code.append(segHeader(seg));
|
|
4786
4920
|
}
|
|
4787
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
|
+
}
|
|
4788
4927
|
if (opts.home)
|
|
4789
4928
|
for (const c of commentsAt(v.path, row))
|
|
4790
4929
|
code.append(noteEl(c));
|
|
@@ -4853,7 +4992,15 @@ function mountReview(container, client, initialTheme) {
|
|
|
4853
4992
|
S.data.state = { ...S.data.state, comments: [...S.data.state.comments.filter((x) => x.id !== c.id), c] };
|
|
4854
4993
|
box.replaceWith(noteEl(c));
|
|
4855
4994
|
renderHead();
|
|
4856
|
-
} }, "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")));
|
|
4857
5004
|
row.after(box);
|
|
4858
5005
|
ta.focus();
|
|
4859
5006
|
}
|
|
@@ -5778,7 +5925,16 @@ function mountReview(container, client, initialTheme) {
|
|
|
5778
5925
|
return out;
|
|
5779
5926
|
}
|
|
5780
5927
|
const r = await client.call("text.read", { changeSetId: id(), path, ...placeLines(line) });
|
|
5781
|
-
|
|
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.` })));
|
|
5782
5938
|
return out;
|
|
5783
5939
|
}
|
|
5784
5940
|
function plainCode(path, start, lines, markLine) {
|
|
@@ -6066,6 +6222,7 @@ function mountReview(container, client, initialTheme) {
|
|
|
6066
6222
|
clearInterval(canvasWatch);
|
|
6067
6223
|
saveCanvas();
|
|
6068
6224
|
clearTimeout(snapTimer);
|
|
6225
|
+
clearTimeout(notesTimer);
|
|
6069
6226
|
clearTimeout(toastTimer);
|
|
6070
6227
|
root.remove();
|
|
6071
6228
|
}
|
|
@@ -6433,6 +6590,27 @@ var Canvas = z2.object({
|
|
|
6433
6590
|
roots: z2.array(CanvasRoot),
|
|
6434
6591
|
panes: z2.array(CanvasPane)
|
|
6435
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) });
|
|
6436
6614
|
var SNAPSHOT_FORMAT = "raven.snapshot";
|
|
6437
6615
|
var SNAPSHOT_VERSION = 1;
|
|
6438
6616
|
var Snapshot = z2.object({
|
|
@@ -6490,6 +6668,32 @@ var methods = {
|
|
|
6490
6668
|
input: z3.object({ changeSetId: z3.string(), title: z3.string().optional(), pullRequest: z3.number().int().optional() }),
|
|
6491
6669
|
output: Snapshot
|
|
6492
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({}) },
|
|
6493
6697
|
"comment.upsert": {
|
|
6494
6698
|
input: z3.object({ changeSetId: z3.string(), id: z3.string().optional(), anchor: CommentAnchor, body: z3.string().min(1) }),
|
|
6495
6699
|
output: Comment
|
|
@@ -6718,5 +6922,5 @@ export {
|
|
|
6718
6922
|
contribute as default
|
|
6719
6923
|
};
|
|
6720
6924
|
|
|
6721
|
-
//# debugId=
|
|
6925
|
+
//# debugId=01B092B12DD42C7364756E2164756E21
|
|
6722
6926
|
//# sourceMappingURL=index.js.map
|