Skip to content

Commit c7b2c3d

Browse files
committed
Merge main into provider connection testing
Signed-off-by: Salman Mohammed <[email protected]>
2 parents 764bd13 + beacbff commit c7b2c3d

35 files changed

Lines changed: 2318 additions & 228 deletions

‎docs/agent-control.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ provider, model, effort and environment variables.
250250
own workspace/filter inherit the global pair.
251251
- Changing the default harness in the card clears the default model and effort;
252252
values entered for the new harness before Save are kept.
253+
- The effort picker offers common values for the selected harness and keeps
254+
custom values editable; support still depends on the selected model. Known Pi
255+
and Goose providers show the same masked API key field as agent Create/Edit.
256+
A key entered there is a write-only
257+
global environment override, used by model lookup and inherited by agents
258+
without their own key. Switching provider or harness drops an unsaved key.
259+
- Model choices include exact IDs. Catalogs over ten models have a local search
260+
by name or ID; filtering does not change the selection. Environment removals
261+
must be saved before browsing because lookup still inherits saved values.
253262

254263
The store is `defaults.json` under app-data `agent-controller/`, not
255264
localStorage, written atomically with owner-only permissions (0600).

‎patches/README.md‎

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Virtua 0.51.0 scroll correction boundaries
22

33
The application imports the React ESM entry (`virtua` → `lib/index.js`) from
4-
`src/features/messages/ChannelTimeline.tsx`. Only that entry's element scroller is
5-
patched; CommonJS, window scrolling, and other-framework exports are untouched.
4+
`src/features/messages/ChannelTimeline.tsx`. Only that entry's element scroller
5+
and store are patched; CommonJS, window scrolling, and other-framework exports
6+
are untouched.
67
Keep the dependency pinned to 0.51.0 and review the patch plus version-coupled
78
installed-bundle tests before upgrading or adding a different import.
89

@@ -113,6 +114,53 @@ still responds to measurements. The browser navigation case exercises real wheel
113114
input and late row growth, asserting position as well as arrival count. These are
114115
not native momentum/compositor acceptance, and do not change the limits above.
115116

117+
Cancellation stays owned by those native capture listeners; the timeline does not
118+
need a second imperative cancellation API. The installed-driver controls cover
119+
all four input events plus already-queued replays and disposal/remount.
120+
121+
## Corrections after a browser clamp
122+
123+
When rows above the viewport shrink, the automatic correction moves the offset
124+
by the same amount. Stock Virtua applies it relatively unless the target reaches
125+
the end, but the layout that `scrollBy` forces clamps an offset beyond the new
126+
end first, so the shrink lands twice: once from the clamp, once from the
127+
correction. WebKit reports an integer `scrollTop`, which reads up to 1px short
128+
of a fractional end, so a reader at the bottom missed the end test there while
129+
Chromium's fractional offset met it.
130+
131+
The element driver takes the absolute path when the target lies within 1px of
132+
the end, rounding outward as before, and when the last observed offset lies
133+
more than 1px beyond the new end, scrolling to the exact target. Interior
134+
corrections, growth and prepend shifts stay relative. The installed-driver
135+
regressions clamp the fake viewport like a browser and cover an integer offset
136+
at a fractional end and a shrink larger than the reader's gap to the end.
137+
`ChannelTimeline` treats an upward offset that arrives with a shrink as reader
138+
input only after a gesture; while following, it re-pins the bottom instead of
139+
demoting to Jump-to-latest.
140+
141+
## A shift outlives a late measurement frame
142+
143+
While older rows are being prepended (`shift`), the store compensates every
144+
resize so the reader keeps their distance from the end, and it ends the shift
145+
from its scroll-end timer, 150 ms after the shift jump's own scroll event. The
146+
prepended rows are measured in the frame after that jump, together with the
147+
former first row, which the same render re-laid out as a continuation without
148+
its day divider and author header. When that frame runs late, the timer fires
149+
first and the batch meets native policy, which keeps the viewport start: the
150+
former first row sits at that start, so its shrink is dropped, and so is the
151+
growth of a prepended row whose estimated bottom WebKit's integer `scrollTop`
152+
reads short of. A reader at the top of history who loaded older messages saw
153+
their content move about 76 px on Linux WebKit.
154+
155+
The store counts the rows a shift prepends and, at scroll-end, keeps shift
156+
policy while any of them inside the rendered range is still unmeasured; the
157+
resize batch that measures them ends the shift. A shift whose prepended rows
158+
are not mounted ends at scroll-end as before, a batch inside the window is
159+
unchanged, and a visible row that grows after the shift (an image loading)
160+
keeps the viewport start as before. Installed-store regressions cover the late
161+
batch, unrelated/partial batches before completion, the stock window and an
162+
unmounted prepend.
163+
116164
## Automated checks
117165

118166
```sh

‎patches/[email protected]‎

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/lib/index.js b/lib/index.js
2-
index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b429ab081 100644
2+
index a183cc7b1669aab25467840540ce3bd1c025fb47..3a27c9b6c4967e5330569b6be492d43bd5184a84 100644
33
--- a/lib/index.js
44
+++ b/lib/index.js
55
@@ -6,6 +6,10 @@ import { jsx as c } from "react/jsx-runtime";
@@ -15,7 +15,22 @@ index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b
1515
var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v = e => [ ...e ].sort((e, t) => e - t), p = setTimeout, S = clearTimeout, m = "function" == typeof queueMicrotask ? queueMicrotask : e => {
1616
Promise.resolve().then(e);
1717
}, $ = () => {
18-
@@ -31,7 +35,9 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
18+
@@ -21,6 +25,14 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
19+
const T = /* @__PURE__ */ new Set, M = () => $ - m, O = () => M() + _ + w, E = e => n(e) - _, L = e => {
20+
e && (b() && 0 !== I || x && 1 === y ? _ += e : w += e);
21+
};
22+
+ // A shift compensates every resize until scroll-end, a 150ms timer from
23+
+ // its jump's scroll event, but the rows it prepends measure in the frame
24+
+ // after that jump. Count the rows it awaits so a late frame cannot lose them.
25+
+ let shiftEnd = 0, shiftIdle = !1;
26+
+ const itemCount = l, shiftPending = () => {
27+
+ for (let e = u(k[0], 0), t = a(k[1], shiftEnd - 1, l() - 1); e <= t; e++) if (i(e)) return !0;
28+
+ return !1;
29+
+ };
30+
return {
31+
_: () => {
32+
T.clear();
33+
@@ -31,7 +43,9 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
1934
let n, o;
2035
if (z) [n, o] = k; else {
2136
let r = u(0, O()), i = r + S;
@@ -26,7 +41,21 @@ index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b
2641
x && (n = a(n, x[0]), o = u(o, x[1]));
2742
}
2843
return [ u(n, 0), a(o, l() - 1) ];
29-
@@ -78,7 +84,9 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
44+
@@ -69,7 +83,10 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
45+
}
46+
-
47+
+
48+
case 2:
49+
- h = 8, 0 !== I && (a = !0, h += 1), I = 0, y = 0, x = null;
50+
+ h = 8, 0 !== I && (a = !0, h += 1), I = 0, x = null;
51+
+ // Keep shift policy while mounted rows the shift prepended are
52+
+ // unmeasured; the batch that measures them ends it below.
53+
+ 2 === y && shiftPending() ? shiftIdle = !0 : (y = 0, shiftEnd = 0, shiftIdle = !1);
54+
break;
55+
-
56+
+
57+
case 3:
58+
@@ -78,7 +95,9 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
3059
if (!e.length) break;
3160
L(e.reduce((e, [t, n]) => {
3261
let r;
@@ -37,7 +66,34 @@ index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b
3766
const e = M(), n = E(t), i = o(t);
3867
r = 1 !== I && 0 === y ? n + i <= e : n < e && n + i < e + S;
3968
}
40-
@@ -173,15 +181,37 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
69+
@@ -89,6 +108,9 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
70+
g && (R += i ? n : n - e);
71+
}
72+
g && S && R > S && (L(f(t(O()))), g = !1), h = 3, u = !0;
73+
+ // A scroll-end deferred above lands once the shift's
74+
+ // measurements are in.
75+
+ shiftIdle && 2 === y && !shiftPending() && (y = 0, shiftEnd = 0, shiftIdle = !1);
76+
break;
77+
}
78+
-
79+
+
80+
@@ -97,7 +119,12 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
81+
break;
82+
-
83+
+
84+
case 5:
85+
- l[1] ? (L(c(l[0], !0)), y = 2, h = 1) : (c(l[0]), h = 1);
86+
+ if (l[1]) {
87+
+ // Rows a shift prepends measure after its jump; remember
88+
+ // how many so scroll-end can tell whether it awaits them.
89+
+ shiftEnd = (2 === y ? shiftEnd : 0) + Math.max(l[0] - itemCount(), 0), shiftIdle = !1;
90+
+ L(c(l[0], !0)), y = 2, h = 1;
91+
+ } else c(l[0]), h = 1;
92+
break;
93+
-
94+
+
95+
case 6:
96+
@@ -173,15 +200,37 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
4197
q: () => [ l.slice(), o ]
4298
};
4399
}, C = e => {
@@ -77,7 +133,7 @@ index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b
77133
t && t.disconnect();
78134
}
79135
};
80-
@@ -249,10 +279,28 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
136+
@@ -249,10 +298,28 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
81137
o && o();
82138
} ];
83139
}, E = (e, t) => {
@@ -108,7 +164,7 @@ index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b
108164
behavior: t ? "smooth" : "instant"
109165
});
110166
}), u = t ? "width" : "height", d = /* @__PURE__ */ new WeakMap, h = C(t => {
111-
@@ -263,10 +311,15 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
167+
@@ -263,18 +330,27 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
112168
}
113169
o.length && e.W(3, o);
114170
});
@@ -125,16 +181,22 @@ index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b
125181
const e = u.style, t = e[c];
126182
e[c] = "hidden", p(() => {
127183
e[c] = t;
128-
@@ -274,7 +327,7 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
184+
});
129185
}
130-
const r = e.T() + t;
131-
r <= 0 || r >= e.O() + e.t() - e.o() ? u.scrollTo({
186+
- const r = e.T() + t;
187+
- r <= 0 || r >= e.O() + e.t() - e.o() ? u.scrollTo({
132188
- [l]: T(r, i),
133-
+ [l]: T(edgeOffset(r), i),
189+
+ const r = e.T() + t, end = e.O() + e.t() - e.o();
190+
+ // Layout clamps an offset beyond a shrunken end before scrollBy
191+
+ // reads it, so a relative correction would apply the shrink twice.
192+
+ // WebKit's integer scrollTop also reads up to 1px short of a
193+
+ // fractional end. Both cases take the absolute path.
194+
+ r <= 0 || r >= end - 1 || e.T() > end + 1 ? u.scrollTo({
195+
+ [l]: T(r >= end - 1 ? edgeOffset(Math.max(r, end)) : r, i),
134196
behavior: "instant"
135197
}) : u.scrollBy({
136198
[l]: T(t, i),
137-
@@ -283,7 +336,9 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
199+
@@ -283,7 +359,9 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
138200
}), r[1](!0);
139201
},
140202
_() {
@@ -145,10 +207,9 @@ index a183cc7b1669aab25467840540ce3bd1c025fb47..d960e2ea2a9435296756a64fe3a3773b
145207
},
146208
P: (e, t) => (d.set(e, t), h.A(e), () => {
147209
d.delete(e), h.B(e);
148-
@@ -797,4 +852,3 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
210+
@@ -797,4 +875,3 @@ var {min: a, max: u, abs: d, floor: h} = Math, g = (e, t, n) => a(n, u(t, e)), v
149211
});
150212
-
151213
+
152214
export { G as VList, j as Virtualizer, U as WindowVirtualizer, N as experimental_VGrid };
153-
\ No newline at end of file
154215
-//# sourceMappingURL=index.js.map

‎pnpm-lock.yaml‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)