@opengeni/react 2.2.0-canary.0 → 2.5.0-canary.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/README.md +9 -2
- package/dist/{chunk-5RZN3DD5.js → chunk-6H6S5V4Z.js} +280 -113
- package/dist/chunk-6H6S5V4Z.js.map +1 -0
- package/dist/{chunk-UOLJWT5Y.js → chunk-ATQJEWCA.js} +154 -114
- package/dist/chunk-ATQJEWCA.js.map +1 -0
- package/dist/{chunk-XSA2QAKP.js → chunk-MXJGO7LE.js} +65 -3
- package/dist/chunk-MXJGO7LE.js.map +1 -0
- package/dist/{chunk-LTCHJ4MS.js → chunk-NVREJA6V.js} +2 -2
- package/dist/{chunk-JOAVA2TW.js → chunk-T7VAYG2I.js} +8 -7
- package/dist/{chunk-JOAVA2TW.js.map → chunk-T7VAYG2I.js.map} +1 -1
- package/dist/components/fleet-tile.d.ts +1 -1
- package/dist/components/message-timeline.d.ts +7 -2
- package/dist/composer.js +2 -2
- package/dist/hooks/use-session-events.d.ts +2 -1
- package/dist/hooks/use-session-lineage.d.ts +4 -0
- package/dist/hooks/use-session.d.ts +6 -0
- package/dist/hooks/use-workspace-sessions.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +41 -19
- package/dist/index.js.map +1 -1
- package/dist/older-history.d.ts +29 -0
- package/dist/session-ui.d.ts +2 -0
- package/dist/session-ui.js +5 -2
- package/dist/session.d.ts +2 -0
- package/dist/session.js +5 -3
- package/dist/timeline/types.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/fleet-tile.tsx +7 -5
- package/src/components/human-input-form.tsx +14 -6
- package/src/components/message-timeline.tsx +428 -137
- package/src/components/tip-follow.ts +18 -7
- package/src/hooks/use-composer.ts +20 -6
- package/src/hooks/use-session-events.ts +84 -76
- package/src/hooks/use-session-lineage.ts +26 -8
- package/src/hooks/use-session.ts +35 -8
- package/src/hooks/use-workspace-sessions.ts +38 -13
- package/src/index.ts +2 -0
- package/src/older-history.ts +69 -0
- package/src/session-ui.ts +2 -0
- package/src/session.ts +2 -0
- package/src/timeline/activity-rail.tsx +1 -0
- package/src/timeline/projection.ts +53 -2
- package/src/timeline/types.ts +2 -0
- package/dist/chunk-5RZN3DD5.js.map +0 -1
- package/dist/chunk-UOLJWT5Y.js.map +0 -1
- package/dist/chunk-XSA2QAKP.js.map +0 -1
- /package/dist/{chunk-LTCHJ4MS.js.map → chunk-NVREJA6V.js.map} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildTimeline,
|
|
3
3
|
groupTimeline,
|
|
4
|
+
invokeOlderHistoryLoaderWithReceiptCapture,
|
|
4
5
|
mcpToolLeaf,
|
|
5
6
|
toolDisplayName
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MXJGO7LE.js";
|
|
7
8
|
import {
|
|
8
9
|
EmptyQueueStateSurface,
|
|
9
10
|
TimelineAnnotationsChip,
|
|
@@ -1440,6 +1441,11 @@ function QuestionControls({
|
|
|
1440
1441
|
hint ? `${fieldId}-hint` : null,
|
|
1441
1442
|
error ? errorId : null
|
|
1442
1443
|
].filter(Boolean).join(" ") || void 0;
|
|
1444
|
+
const selectOtherDraft = (current) => ({
|
|
1445
|
+
...current,
|
|
1446
|
+
otherSelected: true,
|
|
1447
|
+
...question.kind === "single_select" ? { values: [] } : {}
|
|
1448
|
+
});
|
|
1443
1449
|
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1444
1450
|
showPromptChrome ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1445
1451
|
/* @__PURE__ */ jsx3("div", { className: "flex flex-wrap items-baseline gap-x-2", children: /* @__PURE__ */ jsxs3(
|
|
@@ -1571,12 +1577,17 @@ function QuestionControls({
|
|
|
1571
1577
|
id: otherTextId,
|
|
1572
1578
|
type: "text",
|
|
1573
1579
|
value: draft.other,
|
|
1574
|
-
disabled:
|
|
1580
|
+
disabled: busy,
|
|
1575
1581
|
placeholder: "Type a value\u2026",
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1582
|
+
onClick: () => onUpdate(selectOtherDraft),
|
|
1583
|
+
onFocus: () => onUpdate(selectOtherDraft),
|
|
1584
|
+
onChange: (event) => {
|
|
1585
|
+
const other = event.target.value;
|
|
1586
|
+
onUpdate((current) => ({
|
|
1587
|
+
...selectOtherDraft(current),
|
|
1588
|
+
other
|
|
1589
|
+
}));
|
|
1590
|
+
},
|
|
1580
1591
|
className: "mt-1.5 w-full rounded-og-sm border border-og-border bg-og-surface-1 px-2 py-1.5 text-og-sm text-og-fg outline-hidden focus:border-og-accent disabled:opacity-50"
|
|
1581
1592
|
}
|
|
1582
1593
|
)
|
|
@@ -5573,6 +5584,7 @@ function ActivityRail({
|
|
|
5573
5584
|
"div",
|
|
5574
5585
|
{
|
|
5575
5586
|
"data-og-timeline-row-anchor": "",
|
|
5587
|
+
"data-og-item": item.id,
|
|
5576
5588
|
"data-og-annotation-source-key": item.kind === "tool-call" ? item.annotationSource?.eventId : void 0,
|
|
5577
5589
|
className: cn(newFamily && "mt-3", enteringIds.has(item.id) && "animate-og-row-enter"),
|
|
5578
5590
|
children: row
|
|
@@ -6751,7 +6763,6 @@ function StatusDot({ status, className }) {
|
|
|
6751
6763
|
import {
|
|
6752
6764
|
ArrowDownIcon as ArrowDownIcon2,
|
|
6753
6765
|
ArrowRightIcon as ArrowRightIcon2,
|
|
6754
|
-
ArrowUpToLineIcon,
|
|
6755
6766
|
BotIcon as BotIcon3,
|
|
6756
6767
|
CheckCircle2Icon,
|
|
6757
6768
|
CheckIcon as CheckIcon3,
|
|
@@ -6971,6 +6982,9 @@ function tipFollowStep(state, input) {
|
|
|
6971
6982
|
);
|
|
6972
6983
|
}
|
|
6973
6984
|
const target = targetScrollTop(scrollHeight, clientHeight);
|
|
6985
|
+
if (pinned && frameGrowth > 0) {
|
|
6986
|
+
cameraTop = Math.min(target, cameraTop + frameGrowth);
|
|
6987
|
+
}
|
|
6974
6988
|
const debt = target - cameraTop;
|
|
6975
6989
|
const hot = now < noted.hotUntil;
|
|
6976
6990
|
const settling = !hot && Math.abs(debt) < TIP_FOLLOW_CATCHUP_DEBT_PX;
|
|
@@ -7132,8 +7146,38 @@ var TimelineAnnotationSelection = lazy4(() => import("./timeline-annotation-sele
|
|
|
7132
7146
|
var PIN_THRESHOLD_PX = 48;
|
|
7133
7147
|
var OLDER_PREFETCH_MARGIN_PX = 400;
|
|
7134
7148
|
var OLDER_PREFETCH_ROOT_MARGIN = `${OLDER_PREFETCH_MARGIN_PX}px 0px 0px 0px`;
|
|
7149
|
+
var PRIMARY_ACTION_CLASS = "inline-flex w-full shrink-0 items-center justify-center gap-1.5 rounded-og-md bg-og-accent px-3 py-1.5 text-og-menu font-medium text-og-accent-fg sm:w-auto";
|
|
7150
|
+
var MESSAGE_BUBBLE_CLASS = "w-fit max-w-full min-w-0 rounded-og-lg rounded-br-og-xs border border-og-border bg-og-surface-2 px-4 py-2.5 text-og-md leading-6 text-og-fg";
|
|
7151
|
+
var WAITING_PILL_CLASS = "border-og-status-waiting/35 bg-og-status-waiting/10 text-og-status-waiting";
|
|
7152
|
+
var LOADING_CHIP_CLASS = "pointer-events-none inline-flex items-center rounded-full border border-og-border bg-og-surface-3/90 px-3 py-1 text-og-control font-medium shadow-og-md backdrop-blur";
|
|
7153
|
+
function invokeOlderLoad(load, noProgress, attempt) {
|
|
7154
|
+
try {
|
|
7155
|
+
const result = invokeOlderHistoryLoaderWithReceiptCapture(load, (receipt2) => {
|
|
7156
|
+
attempt[2] = receipt2;
|
|
7157
|
+
});
|
|
7158
|
+
const receipt = attempt[2] ?? (typeof result?.committed === "boolean" ? result : void 0);
|
|
7159
|
+
if (receipt) {
|
|
7160
|
+
attempt[2] = receipt;
|
|
7161
|
+
void receipt.then(
|
|
7162
|
+
(value) => value === false && !receipt.committed && noProgress(),
|
|
7163
|
+
noProgress
|
|
7164
|
+
);
|
|
7165
|
+
return 1;
|
|
7166
|
+
}
|
|
7167
|
+
if (typeof result?.then != "function") {
|
|
7168
|
+
return;
|
|
7169
|
+
}
|
|
7170
|
+
void result.then(
|
|
7171
|
+
(value) => value === false && noProgress(),
|
|
7172
|
+
noProgress
|
|
7173
|
+
);
|
|
7174
|
+
} catch {
|
|
7175
|
+
noProgress();
|
|
7176
|
+
}
|
|
7177
|
+
return 1;
|
|
7178
|
+
}
|
|
7135
7179
|
function maxScrollOf(node) {
|
|
7136
|
-
return
|
|
7180
|
+
return node.scrollHeight - node.clientHeight;
|
|
7137
7181
|
}
|
|
7138
7182
|
function wheelConsumedByNestedScrollable(event) {
|
|
7139
7183
|
if (event.deltaY >= 0) {
|
|
@@ -7199,12 +7243,16 @@ function MessageTimeline({
|
|
|
7199
7243
|
className
|
|
7200
7244
|
}) {
|
|
7201
7245
|
const resolvedItems = useMemo6(() => {
|
|
7202
|
-
const
|
|
7246
|
+
const projectedItems = items ?? buildTimeline(events ?? []);
|
|
7203
7247
|
if (!shouldRenderAuthNeeded) {
|
|
7204
|
-
return
|
|
7248
|
+
return projectedItems;
|
|
7205
7249
|
}
|
|
7206
|
-
return
|
|
7250
|
+
return projectedItems.filter(
|
|
7251
|
+
(item) => item.kind !== "auth-needed" || shouldRenderAuthNeeded(item)
|
|
7252
|
+
);
|
|
7207
7253
|
}, [items, events, shouldRenderAuthNeeded]);
|
|
7254
|
+
const sourceItems = items || events;
|
|
7255
|
+
const olderBoundaryKey = sourceItems?.[0]?.id;
|
|
7208
7256
|
const allGroups = useMemo6(() => groupTimeline(resolvedItems), [resolvedItems]);
|
|
7209
7257
|
const annotationSources = useMemo6(() => {
|
|
7210
7258
|
const sources = /* @__PURE__ */ new Map();
|
|
@@ -7224,7 +7272,11 @@ function MessageTimeline({
|
|
|
7224
7272
|
const [bulkActive, setBulkActive] = useState14(true);
|
|
7225
7273
|
const olderPrefetchArmedRef = useRef11(false);
|
|
7226
7274
|
const [olderPrefetchArmed, setOlderPrefetchArmed] = useState14(false);
|
|
7227
|
-
const
|
|
7275
|
+
const olderLoadAttemptRef = useRef11(null);
|
|
7276
|
+
const [underfillSettledAttempt, setUnderfillSettledAttempt] = useState14(
|
|
7277
|
+
null
|
|
7278
|
+
);
|
|
7279
|
+
const underfillRetryReadyRef = useRef11(false);
|
|
7228
7280
|
const resizeFollowRafRef = useRef11(null);
|
|
7229
7281
|
const firstGroupKey = allGroups[0] ? timelineGroupKey(allGroups[0]) : null;
|
|
7230
7282
|
const [revealed, setRevealed] = useState14(resolvedItems[0]?.id === "c");
|
|
@@ -7248,9 +7300,11 @@ function MessageTimeline({
|
|
|
7248
7300
|
const foldMemoryRef = useRef11(/* @__PURE__ */ new Map());
|
|
7249
7301
|
const userMessageDisclosureMemoryRef = useRef11(/* @__PURE__ */ new Map());
|
|
7250
7302
|
const seenActivityIdsRef = useRef11(/* @__PURE__ */ new Set());
|
|
7251
|
-
const
|
|
7303
|
+
const firstItemGroupKeyRef = useRef11(null);
|
|
7252
7304
|
const groupOffsetByKeyRef = useRef11(/* @__PURE__ */ new Map());
|
|
7305
|
+
const firstItemContentTopRef = useRef11(null);
|
|
7253
7306
|
const firstItemId = resolvedItems[0]?.id ?? null;
|
|
7307
|
+
const underfillRetryReady = underfillRetryReadyRef.current = !!(underfillSettledAttempt && underfillSettledAttempt === olderLoadAttemptRef.current && hasOlder && onLoadOlder && !loadingOlder);
|
|
7254
7308
|
const firstKeyChangedForBulk = previousBulkFirstKeyRef.current !== void 0 && previousBulkFirstKeyRef.current !== firstGroupKey;
|
|
7255
7309
|
const bulkRender = allGroups.length > 0 && (bulkActive || firstKeyChangedForBulk);
|
|
7256
7310
|
const applyPinned = useCallback3((value) => {
|
|
@@ -7259,6 +7313,14 @@ function MessageTimeline({
|
|
|
7259
7313
|
setPinned(value);
|
|
7260
7314
|
}
|
|
7261
7315
|
}, []);
|
|
7316
|
+
const rearmOlderPrefetchAfterLeavingTop = useCallback3((node) => {
|
|
7317
|
+
if (node.scrollTop > OLDER_PREFETCH_MARGIN_PX) {
|
|
7318
|
+
const state = olderLoadAttemptRef.current?.[1];
|
|
7319
|
+
if (state === 2 || state === 3) {
|
|
7320
|
+
olderLoadAttemptRef.current = null;
|
|
7321
|
+
}
|
|
7322
|
+
}
|
|
7323
|
+
}, []);
|
|
7262
7324
|
const revealedRef = useRef11(revealed);
|
|
7263
7325
|
revealedRef.current = revealed;
|
|
7264
7326
|
const followRef = useRef11(createTipFollowState());
|
|
@@ -7282,7 +7344,7 @@ function MessageTimeline({
|
|
|
7282
7344
|
}
|
|
7283
7345
|
}, []);
|
|
7284
7346
|
const cancelLeaveFallback = useCallback3(() => {
|
|
7285
|
-
if (leaveFallbackRafRef.current
|
|
7347
|
+
if (leaveFallbackRafRef.current != null) {
|
|
7286
7348
|
cancelFrame(leaveFallbackRafRef.current);
|
|
7287
7349
|
leaveFallbackRafRef.current = null;
|
|
7288
7350
|
}
|
|
@@ -7293,7 +7355,7 @@ function MessageTimeline({
|
|
|
7293
7355
|
}, [cancelLeaveFallback]);
|
|
7294
7356
|
const stopFollow = useCallback3(() => {
|
|
7295
7357
|
followRef.current = tipFollowCancel(followRef.current);
|
|
7296
|
-
if (followFrameRef.current
|
|
7358
|
+
if (followFrameRef.current != null) {
|
|
7297
7359
|
cancelFrame(followFrameRef.current);
|
|
7298
7360
|
followFrameRef.current = null;
|
|
7299
7361
|
}
|
|
@@ -7328,7 +7390,7 @@ function MessageTimeline({
|
|
|
7328
7390
|
if (programmaticScrollRef.current > 0) {
|
|
7329
7391
|
return;
|
|
7330
7392
|
}
|
|
7331
|
-
if (followRef.current.running || followFrameRef.current
|
|
7393
|
+
if (followRef.current.running || followFrameRef.current != null) {
|
|
7332
7394
|
return;
|
|
7333
7395
|
}
|
|
7334
7396
|
if (isNearBottom(node) || maxScrollOf(node) <= 1) {
|
|
@@ -7336,11 +7398,9 @@ function MessageTimeline({
|
|
|
7336
7398
|
return;
|
|
7337
7399
|
}
|
|
7338
7400
|
releasePinFromReader(node);
|
|
7339
|
-
|
|
7340
|
-
olderLoadGateRef.current = "armed";
|
|
7341
|
-
}
|
|
7401
|
+
rearmOlderPrefetchAfterLeavingTop(node);
|
|
7342
7402
|
},
|
|
7343
|
-
[autoFollow, clearPendingReaderLeave, releasePinFromReader]
|
|
7403
|
+
[autoFollow, clearPendingReaderLeave, rearmOlderPrefetchAfterLeavingTop, releasePinFromReader]
|
|
7344
7404
|
);
|
|
7345
7405
|
const scheduleLeaveFallback = useCallback3(() => {
|
|
7346
7406
|
if (supportsScrollEndEvent()) {
|
|
@@ -7370,7 +7430,7 @@ function MessageTimeline({
|
|
|
7370
7430
|
releasePinFromReader(node);
|
|
7371
7431
|
};
|
|
7372
7432
|
const onPointerDown = (event) => {
|
|
7373
|
-
if (event.button
|
|
7433
|
+
if (event.button && event.pointerType === "mouse") {
|
|
7374
7434
|
return;
|
|
7375
7435
|
}
|
|
7376
7436
|
if (event.target instanceof Element && event.target.closest("button, a, input, textarea, select, [role='button']")) {
|
|
@@ -7449,7 +7509,38 @@ function MessageTimeline({
|
|
|
7449
7509
|
}),
|
|
7450
7510
|
[beginUserMessageDisclosureChange]
|
|
7451
7511
|
);
|
|
7452
|
-
const
|
|
7512
|
+
const requestOlderIfUnderfilled = useCallback3(
|
|
7513
|
+
(node, retry) => {
|
|
7514
|
+
let currentAttempt = olderLoadAttemptRef.current;
|
|
7515
|
+
if (retry && (currentAttempt !== retry || retry[0] !== olderBoundaryKey)) {
|
|
7516
|
+
return;
|
|
7517
|
+
}
|
|
7518
|
+
const underfilled = maxScrollOf(node) <= 1;
|
|
7519
|
+
if (!retry && underfilled && currentAttempt?.[1] === 3) {
|
|
7520
|
+
currentAttempt[1] = 0;
|
|
7521
|
+
setUnderfillSettledAttempt(currentAttempt);
|
|
7522
|
+
return;
|
|
7523
|
+
}
|
|
7524
|
+
if (!retry && underfilled && currentAttempt?.[1] === 2) {
|
|
7525
|
+
currentAttempt = olderLoadAttemptRef.current = null;
|
|
7526
|
+
}
|
|
7527
|
+
if (node.clientHeight <= 1 || !retry && !underfilled || !hasOlder || loadingOlder || !onLoadOlder || currentAttempt && !retry) {
|
|
7528
|
+
return;
|
|
7529
|
+
}
|
|
7530
|
+
const attempt = olderLoadAttemptRef.current = [olderBoundaryKey];
|
|
7531
|
+
setUnderfillSettledAttempt(null);
|
|
7532
|
+
const noProgress = () => {
|
|
7533
|
+
if (scrollRef.current && olderLoadAttemptRef.current === attempt) {
|
|
7534
|
+
setUnderfillSettledAttempt(attempt);
|
|
7535
|
+
}
|
|
7536
|
+
};
|
|
7537
|
+
invokeOlderLoad(onLoadOlder, noProgress, attempt);
|
|
7538
|
+
},
|
|
7539
|
+
[hasOlder, loadingOlder, olderBoundaryKey, onLoadOlder]
|
|
7540
|
+
);
|
|
7541
|
+
const driveFollowRef = useRef11(
|
|
7542
|
+
requestOlderIfUnderfilled
|
|
7543
|
+
);
|
|
7453
7544
|
const driveFollow = useCallback3(
|
|
7454
7545
|
(node, nowMs) => {
|
|
7455
7546
|
if (!pinnedRef.current || hasNewerRef.current) {
|
|
@@ -7490,7 +7581,7 @@ function MessageTimeline({
|
|
|
7490
7581
|
// A direct glue write re-based the camera — drop any stale fraction.
|
|
7491
7582
|
cameraTop: null
|
|
7492
7583
|
};
|
|
7493
|
-
if (followFrameRef.current
|
|
7584
|
+
if (followFrameRef.current == null) {
|
|
7494
7585
|
followFrameRef.current = requestFrame((frameNow) => {
|
|
7495
7586
|
followFrameRef.current = null;
|
|
7496
7587
|
const current = scrollRef.current;
|
|
@@ -7521,7 +7612,7 @@ function MessageTimeline({
|
|
|
7521
7612
|
syncScrollBaseline(node);
|
|
7522
7613
|
if (result.state.running) {
|
|
7523
7614
|
cancelLeaveFallback();
|
|
7524
|
-
if (followFrameRef.current
|
|
7615
|
+
if (followFrameRef.current == null) {
|
|
7525
7616
|
followFrameRef.current = requestFrame((frameNow) => {
|
|
7526
7617
|
followFrameRef.current = null;
|
|
7527
7618
|
const current = scrollRef.current;
|
|
@@ -7530,7 +7621,7 @@ function MessageTimeline({
|
|
|
7530
7621
|
}
|
|
7531
7622
|
});
|
|
7532
7623
|
}
|
|
7533
|
-
} else if (followFrameRef.current
|
|
7624
|
+
} else if (followFrameRef.current != null) {
|
|
7534
7625
|
cancelFrame(followFrameRef.current);
|
|
7535
7626
|
followFrameRef.current = null;
|
|
7536
7627
|
}
|
|
@@ -7546,11 +7637,50 @@ function MessageTimeline({
|
|
|
7546
7637
|
return;
|
|
7547
7638
|
}
|
|
7548
7639
|
const previousFirstItemId = previousFirstItemIdRef.current;
|
|
7549
|
-
const
|
|
7640
|
+
const previousFirstItemGroupKey = firstItemGroupKeyRef.current;
|
|
7550
7641
|
const previousGroupOffsetByKey = groupOffsetByKeyRef.current;
|
|
7642
|
+
const previousItemContentTop = firstItemContentTopRef.current;
|
|
7551
7643
|
const previousScrollTop = lastScrollTopRef.current;
|
|
7552
|
-
const
|
|
7644
|
+
const previousMaxScroll = lastMaxScrollRef.current;
|
|
7645
|
+
const wasAtLiveTailBeforeCommit = previousMaxScroll <= 1 || previousMaxScroll - previousScrollTop < Math.min(PIN_THRESHOLD_PX, previousMaxScroll);
|
|
7646
|
+
const firstItemChanged = !!previousFirstItemId && firstItemId !== previousFirstItemId;
|
|
7553
7647
|
const prepended = firstItemChanged && resolvedItems.some((item) => item.id === previousFirstItemId);
|
|
7648
|
+
const attempt = olderLoadAttemptRef.current;
|
|
7649
|
+
const committedZeroOverlapOlderReplacement = !!(attempt?.[2]?.committed && firstItemChanged && !prepended);
|
|
7650
|
+
const restorePrependAnchor = () => {
|
|
7651
|
+
let delta = null;
|
|
7652
|
+
if (previousFirstItemId && previousItemContentTop != null) {
|
|
7653
|
+
const itemEl = node.querySelector(
|
|
7654
|
+
`[data-og-item="${cssEscapeAttribute(previousFirstItemId)}"]`
|
|
7655
|
+
);
|
|
7656
|
+
if (itemEl instanceof HTMLElement) {
|
|
7657
|
+
const scrollerTop = node.getBoundingClientRect().top;
|
|
7658
|
+
const currentItemTop = itemEl.getBoundingClientRect().top - scrollerTop + node.scrollTop;
|
|
7659
|
+
delta = Math.round(currentItemTop - previousItemContentTop);
|
|
7660
|
+
}
|
|
7661
|
+
}
|
|
7662
|
+
const anchorKey = previousFirstItemGroupKey;
|
|
7663
|
+
const previousAnchorTop = anchorKey != null ? previousGroupOffsetByKey.get(anchorKey) : void 0;
|
|
7664
|
+
const anchorEl = anchorKey != null ? node.querySelector(`[data-og-group-key="${cssEscapeAttribute(anchorKey)}"]`) : null;
|
|
7665
|
+
if (delta == null && anchorEl instanceof HTMLElement && previousAnchorTop !== void 0) {
|
|
7666
|
+
const moved = Math.round(anchorEl.offsetTop - previousAnchorTop);
|
|
7667
|
+
if (moved) {
|
|
7668
|
+
delta = moved;
|
|
7669
|
+
}
|
|
7670
|
+
}
|
|
7671
|
+
if (delta == null) {
|
|
7672
|
+
const heightDelta = Math.round(node.scrollHeight - previousScrollHeightRef.current);
|
|
7673
|
+
if (heightDelta > 0) {
|
|
7674
|
+
delta = heightDelta;
|
|
7675
|
+
}
|
|
7676
|
+
}
|
|
7677
|
+
if (delta != null) {
|
|
7678
|
+
const expected = previousScrollTop + delta;
|
|
7679
|
+
if (Math.abs(node.scrollTop - expected) > 2) {
|
|
7680
|
+
writeScrollTop(node, expected);
|
|
7681
|
+
}
|
|
7682
|
+
}
|
|
7683
|
+
};
|
|
7554
7684
|
if (pendingJumpToStartRef.current && firstItemChanged) {
|
|
7555
7685
|
pendingJumpToStartRef.current = false;
|
|
7556
7686
|
stopFollow();
|
|
@@ -7561,6 +7691,25 @@ function MessageTimeline({
|
|
|
7561
7691
|
applyPinned(true);
|
|
7562
7692
|
snapToBottom(node);
|
|
7563
7693
|
}
|
|
7694
|
+
} else if (committedZeroOverlapOlderReplacement) {
|
|
7695
|
+
clearPendingReaderLeave();
|
|
7696
|
+
stopFollow();
|
|
7697
|
+
writeScrollTop(node, maxScrollOf(node));
|
|
7698
|
+
if (attempt?.[1] === 1 && pinnedRef.current) {
|
|
7699
|
+
applyPinned(false);
|
|
7700
|
+
}
|
|
7701
|
+
} else if (prepended) {
|
|
7702
|
+
if (autoFollow && pinnedRef.current && !hasNewer && !pendingReaderLeaveRef.current && (wasAtLiveTailBeforeCommit || olderLoadAttemptRef.current)) {
|
|
7703
|
+
clearPendingReaderLeave();
|
|
7704
|
+
snapToBottom(node);
|
|
7705
|
+
} else {
|
|
7706
|
+
restorePrependAnchor();
|
|
7707
|
+
if (autoFollow && pinnedRef.current && !hasNewer) {
|
|
7708
|
+
stopFollow();
|
|
7709
|
+
clearPendingReaderLeave();
|
|
7710
|
+
applyPinned(false);
|
|
7711
|
+
}
|
|
7712
|
+
}
|
|
7564
7713
|
} else if (autoFollow && pinnedRef.current && !hasNewer) {
|
|
7565
7714
|
if (!revealedRef.current) {
|
|
7566
7715
|
snapToBottom(node);
|
|
@@ -7572,44 +7721,15 @@ function MessageTimeline({
|
|
|
7572
7721
|
} else {
|
|
7573
7722
|
driveFollow(node);
|
|
7574
7723
|
}
|
|
7575
|
-
} else if (prepended) {
|
|
7576
|
-
const anchorKey = previousFirstItemId !== null ? previousGroupKeyByItemId.get(previousFirstItemId) : void 0;
|
|
7577
|
-
const previousAnchorTop = anchorKey !== void 0 ? previousGroupOffsetByKey.get(anchorKey) : void 0;
|
|
7578
|
-
const anchorEl = anchorKey !== void 0 ? node.querySelector(`[data-og-group-key="${cssEscapeAttribute(anchorKey)}"]`) : null;
|
|
7579
|
-
let delta = null;
|
|
7580
|
-
if (anchorEl instanceof HTMLElement && previousAnchorTop !== void 0) {
|
|
7581
|
-
const moved = Math.round(anchorEl.offsetTop - previousAnchorTop);
|
|
7582
|
-
if (moved !== 0) {
|
|
7583
|
-
delta = moved;
|
|
7584
|
-
}
|
|
7585
|
-
}
|
|
7586
|
-
if (delta === null) {
|
|
7587
|
-
const heightDelta = Math.round(node.scrollHeight - previousScrollHeightRef.current);
|
|
7588
|
-
if (heightDelta > 0) {
|
|
7589
|
-
delta = heightDelta;
|
|
7590
|
-
}
|
|
7591
|
-
}
|
|
7592
|
-
if (delta !== null) {
|
|
7593
|
-
const expected = previousScrollTop + delta;
|
|
7594
|
-
if (Math.abs(node.scrollTop - expected) > 2) {
|
|
7595
|
-
writeScrollTop(node, expected);
|
|
7596
|
-
}
|
|
7597
|
-
}
|
|
7598
7724
|
}
|
|
7599
|
-
if (prepended && !pinnedRef.current &&
|
|
7600
|
-
|
|
7725
|
+
if (prepended && !pinnedRef.current && node.scrollTop > OLDER_PREFETCH_MARGIN_PX) {
|
|
7726
|
+
rearmOlderPrefetchAfterLeavingTop(node);
|
|
7601
7727
|
}
|
|
7602
7728
|
previousFirstItemIdRef.current = firstItemId;
|
|
7603
7729
|
previousScrollHeightRef.current = node.scrollHeight;
|
|
7604
7730
|
syncScrollBaseline(node);
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
for (const itemId of timelineGroupItemIds(group)) {
|
|
7608
|
-
nextKeyByItemId.set(itemId, key);
|
|
7609
|
-
}
|
|
7610
|
-
}
|
|
7611
|
-
groupKeyByItemIdRef.current = nextKeyByItemId;
|
|
7612
|
-
const needOffsets = prepended || firstItemChanged || !pinnedRef.current || Boolean(hasNewer);
|
|
7731
|
+
firstItemGroupKeyRef.current = groups[0]?.key ?? null;
|
|
7732
|
+
const needOffsets = prepended || firstItemChanged || !pinnedRef.current || hasNewer || firstItemContentTopRef.current == null;
|
|
7613
7733
|
if (needOffsets) {
|
|
7614
7734
|
const nextOffsetByKey = /* @__PURE__ */ new Map();
|
|
7615
7735
|
for (const { key } of groups) {
|
|
@@ -7619,10 +7739,29 @@ function MessageTimeline({
|
|
|
7619
7739
|
}
|
|
7620
7740
|
}
|
|
7621
7741
|
groupOffsetByKeyRef.current = nextOffsetByKey;
|
|
7742
|
+
const firstItemEl = firstItemId ? node.querySelector(`[data-og-item="${cssEscapeAttribute(firstItemId)}"]`) : null;
|
|
7743
|
+
firstItemContentTopRef.current = firstItemId && firstItemEl instanceof HTMLElement ? firstItemEl.getBoundingClientRect().top - node.getBoundingClientRect().top + node.scrollTop : null;
|
|
7744
|
+
}
|
|
7745
|
+
if (!attempt) {
|
|
7746
|
+
return;
|
|
7622
7747
|
}
|
|
7748
|
+
if (!attempt[2]?.committed && attempt[0] === olderBoundaryKey) {
|
|
7749
|
+
return;
|
|
7750
|
+
}
|
|
7751
|
+
if (!attempt[2]?.committed && attempt[0] && !sourceItems?.find((entry) => entry.id === attempt[0])) {
|
|
7752
|
+
attempt[0] = olderBoundaryKey;
|
|
7753
|
+
return;
|
|
7754
|
+
}
|
|
7755
|
+
if (!attempt[1] || !hasOlder) {
|
|
7756
|
+
setUnderfillSettledAttempt(olderLoadAttemptRef.current = null);
|
|
7757
|
+
return;
|
|
7758
|
+
}
|
|
7759
|
+
olderLoadAttemptRef.current = [olderBoundaryKey, 2];
|
|
7760
|
+
rearmOlderPrefetchAfterLeavingTop(node);
|
|
7761
|
+
requestOlderIfUnderfilled(node);
|
|
7623
7762
|
});
|
|
7624
7763
|
useLayoutEffect3(() => {
|
|
7625
|
-
if (revealed || allGroups.length
|
|
7764
|
+
if (revealed || !allGroups.length) {
|
|
7626
7765
|
return;
|
|
7627
7766
|
}
|
|
7628
7767
|
let cancelled = false;
|
|
@@ -7650,7 +7789,7 @@ function MessageTimeline({
|
|
|
7650
7789
|
return () => {
|
|
7651
7790
|
cancelled = true;
|
|
7652
7791
|
cancelFrame(frame1);
|
|
7653
|
-
if (frame2
|
|
7792
|
+
if (frame2) {
|
|
7654
7793
|
cancelFrame(frame2);
|
|
7655
7794
|
}
|
|
7656
7795
|
};
|
|
@@ -7666,7 +7805,6 @@ function MessageTimeline({
|
|
|
7666
7805
|
olderPrefetchArmedRef.current = false;
|
|
7667
7806
|
setOlderPrefetchArmed(false);
|
|
7668
7807
|
}
|
|
7669
|
-
olderLoadGateRef.current = "armed";
|
|
7670
7808
|
wantPinRef.current = false;
|
|
7671
7809
|
pendingJumpToStartRef.current = false;
|
|
7672
7810
|
previousFirstItemIdRef.current = null;
|
|
@@ -7675,14 +7813,21 @@ function MessageTimeline({
|
|
|
7675
7813
|
lastMaxScrollRef.current = 0;
|
|
7676
7814
|
lastScrollHeightRef.current = 0;
|
|
7677
7815
|
lastClientHeightRef.current = 0;
|
|
7678
|
-
|
|
7816
|
+
firstItemGroupKeyRef.current = null;
|
|
7679
7817
|
groupOffsetByKeyRef.current = /* @__PURE__ */ new Map();
|
|
7818
|
+
firstItemContentTopRef.current = null;
|
|
7680
7819
|
foldMemoryRef.current.clear();
|
|
7681
7820
|
userMessageDisclosureMemoryRef.current.clear();
|
|
7682
7821
|
disclosureKeepsUnpinnedRef.current = false;
|
|
7683
7822
|
seenActivityIdsRef.current.clear();
|
|
7684
7823
|
applyPinned(true);
|
|
7685
7824
|
}, [allGroups.length, revealed, applyPinned]);
|
|
7825
|
+
useEffect11(() => {
|
|
7826
|
+
const node = scrollRef.current;
|
|
7827
|
+
if (node) {
|
|
7828
|
+
requestOlderIfUnderfilled(node);
|
|
7829
|
+
}
|
|
7830
|
+
});
|
|
7686
7831
|
useLayoutEffect3(() => {
|
|
7687
7832
|
previousBulkFirstKeyRef.current = firstGroupKey;
|
|
7688
7833
|
if (!bulkRender) {
|
|
@@ -7702,20 +7847,46 @@ function MessageTimeline({
|
|
|
7702
7847
|
(entries) => {
|
|
7703
7848
|
const intersecting = entries.some((entry) => entry.isIntersecting);
|
|
7704
7849
|
if (!intersecting) {
|
|
7705
|
-
|
|
7850
|
+
const attempt2 = olderLoadAttemptRef.current;
|
|
7851
|
+
if (attempt2?.[1] === 2 || attempt2?.[1] === 3) {
|
|
7852
|
+
olderLoadAttemptRef.current = null;
|
|
7853
|
+
}
|
|
7706
7854
|
return;
|
|
7707
7855
|
}
|
|
7708
|
-
if (
|
|
7856
|
+
if (olderLoadAttemptRef.current) {
|
|
7709
7857
|
return;
|
|
7710
7858
|
}
|
|
7711
|
-
|
|
7712
|
-
|
|
7859
|
+
const attempt = olderLoadAttemptRef.current = [olderBoundaryKey, 1];
|
|
7860
|
+
const noProgress = () => {
|
|
7861
|
+
if (!scrollRef.current || olderLoadAttemptRef.current !== attempt) {
|
|
7862
|
+
return;
|
|
7863
|
+
}
|
|
7864
|
+
attempt[1] = 3;
|
|
7865
|
+
if (root.scrollTop > OLDER_PREFETCH_MARGIN_PX) {
|
|
7866
|
+
olderLoadAttemptRef.current = null;
|
|
7867
|
+
} else if (maxScrollOf(root) <= 1) {
|
|
7868
|
+
attempt[1] = 0;
|
|
7869
|
+
setUnderfillSettledAttempt(attempt);
|
|
7870
|
+
}
|
|
7871
|
+
};
|
|
7872
|
+
if (!invokeOlderLoad(onLoadOlder, noProgress, attempt) && olderLoadAttemptRef.current === attempt) {
|
|
7873
|
+
olderLoadAttemptRef.current[1] = 2;
|
|
7874
|
+
requestOlderIfUnderfilled(root);
|
|
7875
|
+
}
|
|
7713
7876
|
},
|
|
7714
7877
|
{ root, rootMargin: OLDER_PREFETCH_ROOT_MARGIN }
|
|
7715
7878
|
);
|
|
7716
7879
|
observer.observe(target);
|
|
7717
7880
|
return () => observer.disconnect();
|
|
7718
|
-
}, [
|
|
7881
|
+
}, [
|
|
7882
|
+
firstGroupKey,
|
|
7883
|
+
hasOlder,
|
|
7884
|
+
loadingOlder,
|
|
7885
|
+
olderBoundaryKey,
|
|
7886
|
+
olderPrefetchArmed,
|
|
7887
|
+
onLoadOlder,
|
|
7888
|
+
requestOlderIfUnderfilled
|
|
7889
|
+
]);
|
|
7719
7890
|
useEffect11(() => {
|
|
7720
7891
|
const root = scrollRef.current;
|
|
7721
7892
|
const target = bottomSentinelRef.current;
|
|
@@ -7740,7 +7911,7 @@ function MessageTimeline({
|
|
|
7740
7911
|
return;
|
|
7741
7912
|
}
|
|
7742
7913
|
const observer = new ResizeObserver(() => {
|
|
7743
|
-
if (resizeFollowRafRef.current
|
|
7914
|
+
if (resizeFollowRafRef.current != null) {
|
|
7744
7915
|
return;
|
|
7745
7916
|
}
|
|
7746
7917
|
resizeFollowRafRef.current = requestFrame(() => {
|
|
@@ -7749,6 +7920,7 @@ function MessageTimeline({
|
|
|
7749
7920
|
if (!current) {
|
|
7750
7921
|
return;
|
|
7751
7922
|
}
|
|
7923
|
+
requestOlderIfUnderfilled(current);
|
|
7752
7924
|
if (!autoFollow || !pinnedRef.current || hasNewerRef.current) {
|
|
7753
7925
|
return;
|
|
7754
7926
|
}
|
|
@@ -7763,12 +7935,12 @@ function MessageTimeline({
|
|
|
7763
7935
|
observer.observe(node);
|
|
7764
7936
|
return () => {
|
|
7765
7937
|
observer.disconnect();
|
|
7766
|
-
if (resizeFollowRafRef.current
|
|
7938
|
+
if (resizeFollowRafRef.current != null) {
|
|
7767
7939
|
cancelFrame(resizeFollowRafRef.current);
|
|
7768
7940
|
resizeFollowRafRef.current = null;
|
|
7769
7941
|
}
|
|
7770
7942
|
};
|
|
7771
|
-
}, [autoFollow, driveFollow, snapToBottom]);
|
|
7943
|
+
}, [autoFollow, driveFollow, requestOlderIfUnderfilled, snapToBottom]);
|
|
7772
7944
|
useEffect11(() => {
|
|
7773
7945
|
if (hasNewer) {
|
|
7774
7946
|
stopFollow();
|
|
@@ -7836,9 +8008,7 @@ function MessageTimeline({
|
|
|
7836
8008
|
if (readerArmed && readerUp > TIP_FOLLOW_READER_UP_EPS_PX && !nearBottomPinned) {
|
|
7837
8009
|
readerIntentArmRef.current = false;
|
|
7838
8010
|
releasePinFromReader(node);
|
|
7839
|
-
|
|
7840
|
-
olderLoadGateRef.current = "armed";
|
|
7841
|
-
}
|
|
8011
|
+
rearmOlderPrefetchAfterLeavingTop(node);
|
|
7842
8012
|
return;
|
|
7843
8013
|
}
|
|
7844
8014
|
if (!nearBottomPinned && readerUp <= TIP_FOLLOW_READER_UP_EPS_PX) {
|
|
@@ -7868,9 +8038,7 @@ function MessageTimeline({
|
|
|
7868
8038
|
olderPrefetchArmedRef.current = true;
|
|
7869
8039
|
setOlderPrefetchArmed(true);
|
|
7870
8040
|
}
|
|
7871
|
-
|
|
7872
|
-
olderLoadGateRef.current = "armed";
|
|
7873
|
-
}
|
|
8041
|
+
rearmOlderPrefetchAfterLeavingTop(node);
|
|
7874
8042
|
};
|
|
7875
8043
|
const onScrollEnd = () => {
|
|
7876
8044
|
const node = scrollRef.current;
|
|
@@ -7921,7 +8089,7 @@ function MessageTimeline({
|
|
|
7921
8089
|
autoFollow && pinned && !hasNewer ? "[overflow-anchor:none]" : "[overflow-anchor:auto]"
|
|
7922
8090
|
),
|
|
7923
8091
|
children: /* @__PURE__ */ jsxs14("div", { className: "relative mx-auto flex w-full max-w-3xl flex-col gap-5", children: [
|
|
7924
|
-
groups.length
|
|
8092
|
+
!groups.length ? emptyState ?? /* @__PURE__ */ jsx18("p", { className: "py-10 text-center text-og-menu text-og-fg-subtle", children: "No activity yet." }) : null,
|
|
7925
8093
|
hasOlder && olderPrefetchArmed ? (
|
|
7926
8094
|
// Overlaid, not a layout row: mounting/unmounting the sentinel
|
|
7927
8095
|
// must never shift content (that shift was itself a wobble).
|
|
@@ -7991,7 +8159,7 @@ function MessageTimeline({
|
|
|
7991
8159
|
] })
|
|
7992
8160
|
}
|
|
7993
8161
|
),
|
|
7994
|
-
/* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed ? (
|
|
8162
|
+
/* @__PURE__ */ jsx18(AnimatePresence3, { children: loadingOlder || loadingOldest || hasOlder && onJumpToStart && olderPrefetchArmed || underfillRetryReady ? (
|
|
7995
8163
|
// Floating over the scroller (not a timeline row) so showing and
|
|
7996
8164
|
// hiding it never reflows history under the reader.
|
|
7997
8165
|
/* @__PURE__ */ jsxs14(
|
|
@@ -8003,20 +8171,26 @@ function MessageTimeline({
|
|
|
8003
8171
|
transition: { duration: 0.15, ease: "easeOut" },
|
|
8004
8172
|
"data-og-loading-older": "",
|
|
8005
8173
|
"aria-live": "polite",
|
|
8006
|
-
className: "absolute inset-x-0 top-3 z-10 flex justify-center
|
|
8174
|
+
className: "absolute inset-x-0 top-3 z-10 flex justify-center",
|
|
8007
8175
|
children: [
|
|
8008
|
-
loadingOlder || loadingOldest ? /* @__PURE__ */ jsx18("span", { className:
|
|
8009
|
-
hasOlder &&
|
|
8176
|
+
loadingOlder || loadingOldest ? /* @__PURE__ */ jsx18("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: loadingOldest ? "Jumping to start\u2026" : "Loading earlier activity\u2026" }) }) : null,
|
|
8177
|
+
hasOlder && !loadingOlder && !loadingOldest && (underfillRetryReady || onJumpToStart) ? /* @__PURE__ */ jsx18(
|
|
8010
8178
|
"button",
|
|
8011
8179
|
{
|
|
8012
8180
|
type: "button",
|
|
8013
|
-
"data-og-
|
|
8014
|
-
|
|
8181
|
+
"data-og-retry": underfillRetryReady || void 0,
|
|
8182
|
+
"data-og-jump-to-start": !underfillRetryReady || void 0,
|
|
8015
8183
|
onClick: () => {
|
|
8184
|
+
const node = scrollRef.current;
|
|
8185
|
+
if (underfillRetryReady) {
|
|
8186
|
+
if (node && underfillRetryReadyRef.current) {
|
|
8187
|
+
requestOlderIfUnderfilled(node, underfillSettledAttempt);
|
|
8188
|
+
}
|
|
8189
|
+
return;
|
|
8190
|
+
}
|
|
8016
8191
|
applyPinned(false);
|
|
8017
8192
|
pendingJumpToStartRef.current = true;
|
|
8018
8193
|
const seq = ++jumpToStartSeqRef.current;
|
|
8019
|
-
const node = scrollRef.current;
|
|
8020
8194
|
void Promise.resolve(onJumpToStart()).then(
|
|
8021
8195
|
() => {
|
|
8022
8196
|
const scroller = scrollRef.current ?? node;
|
|
@@ -8036,15 +8210,8 @@ function MessageTimeline({
|
|
|
8036
8210
|
}
|
|
8037
8211
|
);
|
|
8038
8212
|
},
|
|
8039
|
-
className:
|
|
8040
|
-
|
|
8041
|
-
"text-og-control font-medium text-og-fg shadow-og-md backdrop-blur",
|
|
8042
|
-
"hover:border-og-border-strong disabled:opacity-60"
|
|
8043
|
-
),
|
|
8044
|
-
children: [
|
|
8045
|
-
/* @__PURE__ */ jsx18(ArrowUpToLineIcon, { className: "size-3.5" }),
|
|
8046
|
-
"Jump to start"
|
|
8047
|
-
]
|
|
8213
|
+
className: "rounded-full border border-og-border px-3 py-1.5 text-og-control",
|
|
8214
|
+
children: underfillRetryReady ? "Retry earlier activity" : "Jump to start"
|
|
8048
8215
|
}
|
|
8049
8216
|
) : null
|
|
8050
8217
|
]
|
|
@@ -8061,7 +8228,7 @@ function MessageTimeline({
|
|
|
8061
8228
|
"data-og-loading-newer": "",
|
|
8062
8229
|
"aria-live": "polite",
|
|
8063
8230
|
className: "pointer-events-none absolute inset-x-0 bottom-14 z-10 flex justify-center",
|
|
8064
|
-
children: /* @__PURE__ */ jsx18("span", { className:
|
|
8231
|
+
children: /* @__PURE__ */ jsx18("span", { className: LOADING_CHIP_CLASS, children: /* @__PURE__ */ jsx18("span", { className: "og-shimmer-text", children: "Loading later activity\u2026" }) })
|
|
8065
8232
|
}
|
|
8066
8233
|
) : null }),
|
|
8067
8234
|
/* @__PURE__ */ jsx18(AnimatePresence3, { children: (!pinned && autoFollow || hasNewer) && autoFollow ? /* @__PURE__ */ jsxs14(
|
|
@@ -8224,7 +8391,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
8224
8391
|
const enter = useEntranceAnimation();
|
|
8225
8392
|
const settleChrome = useTurnSettleOpen();
|
|
8226
8393
|
const foldMemory = useFoldMemory();
|
|
8227
|
-
const activityShouldFold = group.kind === "activity" &&
|
|
8394
|
+
const activityShouldFold = group.kind === "activity" && !!(group.outcome || foldLiveCluster && clusterIsSettled(group));
|
|
8228
8395
|
const containsGeneratedImage = timelineGroupContainsGeneratedImage(group);
|
|
8229
8396
|
const liveActivitySettle = useLiveSettleFold(activityShouldFold && !insideTurn);
|
|
8230
8397
|
const turnDefaultOpen = !insideTurn && group.kind === "turn" && (group.outcome === "failed" || timelineGroupContainsAuthNeeded(group) || containsGeneratedImage);
|
|
@@ -8235,7 +8402,7 @@ var TimelineGroupView = memo2(function TimelineGroupView2({
|
|
|
8235
8402
|
group.groups.flatMap((child) => child.kind === "activity" ? [child.id] : [])
|
|
8236
8403
|
);
|
|
8237
8404
|
}
|
|
8238
|
-
const settleFold = group.kind === "turn" ?
|
|
8405
|
+
const settleFold = group.kind === "turn" ? !!(enter && !insideTurn && !turnDefaultOpen) : liveActivitySettle;
|
|
8239
8406
|
switch (group.kind) {
|
|
8240
8407
|
case "activity":
|
|
8241
8408
|
if (insideTurn) {
|
|
@@ -8527,7 +8694,7 @@ function trailingAgentTextAfterTurn(group, next) {
|
|
|
8527
8694
|
}
|
|
8528
8695
|
if (next?.kind === "item" && next.item.kind === "agent-message") {
|
|
8529
8696
|
const turnIds = collectTurnIdsFromGroups(group.groups);
|
|
8530
|
-
if (turnIds.size
|
|
8697
|
+
if (!turnIds.size) {
|
|
8531
8698
|
return void 0;
|
|
8532
8699
|
}
|
|
8533
8700
|
if (!next.item.turnId || !turnIds.has(next.item.turnId)) {
|
|
@@ -8542,7 +8709,7 @@ function collectTurnCopyText(groups, trailingAgentText) {
|
|
|
8542
8709
|
const parts = [collectAgentMessageText(groups), trailingAgentText?.trim() ?? ""].filter(
|
|
8543
8710
|
(part) => part.length > 0
|
|
8544
8711
|
);
|
|
8545
|
-
if (parts.length
|
|
8712
|
+
if (!parts.length) {
|
|
8546
8713
|
return void 0;
|
|
8547
8714
|
}
|
|
8548
8715
|
return parts.join("\n\n");
|
|
@@ -8604,11 +8771,11 @@ var COMPACTION_TRIGGER_LABEL = {
|
|
|
8604
8771
|
function CompactionRow({ item }) {
|
|
8605
8772
|
const enter = useEntranceAnimation();
|
|
8606
8773
|
const trigger = item.trigger && item.phase !== "started" ? COMPACTION_TRIGGER_LABEL[item.trigger] : null;
|
|
8607
|
-
const before = item.estimatedTokensBefore
|
|
8608
|
-
const after = item.estimatedTokensAfter
|
|
8774
|
+
const before = item.estimatedTokensBefore != null ? Math.round(item.estimatedTokensBefore).toLocaleString("en-US") : null;
|
|
8775
|
+
const after = item.estimatedTokensAfter != null ? Math.round(item.estimatedTokensAfter).toLocaleString("en-US") : null;
|
|
8609
8776
|
const title = item.phase === "started" ? "Compacting conversation history\u2026" : item.phase === "compacted" ? before && after ? `Conversation history compacted \xB7 ~${before} \u2192 ~${after} estimated history tokens` : "Conversation history compacted" : "Couldn\u2019t compact conversation history";
|
|
8610
8777
|
const subtitle = item.phase === "compacted" ? "Chat history above is unchanged" : item.phase === "skipped" ? compactionSkipSubtitle(item.skipReason) : null;
|
|
8611
|
-
const pill = item.phase === "skipped" && item.skipReason === "summarization_failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.phase === "started" ?
|
|
8778
|
+
const pill = item.phase === "skipped" && item.skipReason === "summarization_failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.phase === "started" ? WAITING_PILL_CLASS : "border-og-border bg-og-surface-1 text-og-fg-muted";
|
|
8612
8779
|
return /* @__PURE__ */ jsx18("div", { className: cn(enter && "animate-og-enter", "flex justify-center"), children: /* @__PURE__ */ jsxs14(
|
|
8613
8780
|
"div",
|
|
8614
8781
|
{
|
|
@@ -8673,7 +8840,7 @@ ${annotation.note}`).join("\n\n"),
|
|
|
8673
8840
|
label: "Copy message",
|
|
8674
8841
|
className: "w-fit max-w-full min-w-0",
|
|
8675
8842
|
trailing: /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
8676
|
-
children: /* @__PURE__ */ jsxs14("div", { className:
|
|
8843
|
+
children: /* @__PURE__ */ jsxs14("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
8677
8844
|
item.text ? /* @__PURE__ */ jsx18("div", { "data-og-annotation-source-key": item.annotationSource?.eventId, children: renderMessageText ? renderMessageText(item.text, item) : /* @__PURE__ */ jsx18(UserMessageBody, { messageId: item.id, text: item.text, children: /* @__PURE__ */ jsx18(Markdown, { children: item.text }) }) }) : null,
|
|
8678
8845
|
(item.annotations?.length ?? 0) > 0 ? /* @__PURE__ */ jsx18(
|
|
8679
8846
|
TimelineAnnotationsChip,
|
|
@@ -8772,7 +8939,7 @@ function HumanInputConversationRow({ item }) {
|
|
|
8772
8939
|
label: "Copy answer",
|
|
8773
8940
|
className: "w-fit max-w-[90%] min-w-0 sm:max-w-[82%]",
|
|
8774
8941
|
trailing: /* @__PURE__ */ jsx18(MessageFooterTime, { occurredAt: item.occurredAt }),
|
|
8775
|
-
children: /* @__PURE__ */ jsxs14("div", { className:
|
|
8942
|
+
children: /* @__PURE__ */ jsxs14("div", { className: MESSAGE_BUBBLE_CLASS, children: [
|
|
8776
8943
|
/* @__PURE__ */ jsx18("p", { className: "text-og-xs font-medium text-og-fg-subtle", children: settledLabel }),
|
|
8777
8944
|
item.response.outcome === "answered" ? /* @__PURE__ */ jsx18("div", { className: "mt-1.5 space-y-3", children: item.answers.length > 0 ? item.answers.map((answer, answerIndex) => /* @__PURE__ */ jsxs14("div", { children: [
|
|
8778
8945
|
multipleQuestions ? /* @__PURE__ */ jsxs14("p", { className: "text-og-sm font-semibold text-og-fg", children: [
|
|
@@ -8864,7 +9031,7 @@ function WorkerCompletionRow({
|
|
|
8864
9031
|
const [open, setOpen] = useState14(false);
|
|
8865
9032
|
const meta = workerCompletionMeta(item);
|
|
8866
9033
|
const Icon = meta.icon;
|
|
8867
|
-
const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" &&
|
|
9034
|
+
const showPausedReason = item.childStatus !== "failed" && item.goalStatus === "paused" && !!item.pausedReason?.trim();
|
|
8868
9035
|
const details = [
|
|
8869
9036
|
...item.text.trim() ? [{ label: "Report", value: item.text.trim() }] : [],
|
|
8870
9037
|
...item.evidence?.trim() ? [{ label: "Evidence", value: item.evidence.trim(), muted: true }] : [],
|
|
@@ -8968,14 +9135,14 @@ var GOAL_META = {
|
|
|
8968
9135
|
},
|
|
8969
9136
|
paused: {
|
|
8970
9137
|
label: "Goal paused",
|
|
8971
|
-
pill:
|
|
9138
|
+
pill: WAITING_PILL_CLASS,
|
|
8972
9139
|
icon: PauseIcon2
|
|
8973
9140
|
},
|
|
8974
9141
|
resumed: { label: "Goal resumed", pill: NEUTRAL_PILL, icon: PlayIcon2 },
|
|
8975
9142
|
cleared: { label: "Goal cleared", pill: NEUTRAL_PILL, icon: Trash2Icon2 },
|
|
8976
9143
|
held: {
|
|
8977
9144
|
label: "Goal held",
|
|
8978
|
-
pill:
|
|
9145
|
+
pill: WAITING_PILL_CLASS,
|
|
8979
9146
|
icon: PauseCircleIcon
|
|
8980
9147
|
},
|
|
8981
9148
|
continuation: { label: "Continuing toward the goal", pill: NEUTRAL_PILL, icon: ArrowRightIcon2 }
|
|
@@ -9146,7 +9313,7 @@ function formatVideoDuration(seconds) {
|
|
|
9146
9313
|
}
|
|
9147
9314
|
function NoticeRow({ item }) {
|
|
9148
9315
|
const enter = useEntranceAnimation();
|
|
9149
|
-
const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" ?
|
|
9316
|
+
const tone = item.tone === "failed" ? "border-og-status-failed/35 bg-og-status-failed/10 text-og-status-failed" : item.tone === "waiting" ? WAITING_PILL_CLASS : "border-og-border bg-og-surface-1 text-og-fg-muted";
|
|
9150
9317
|
return /* @__PURE__ */ jsxs14(
|
|
9151
9318
|
"div",
|
|
9152
9319
|
{
|
|
@@ -9243,7 +9410,7 @@ function AuthNeededRow({
|
|
|
9243
9410
|
onClick: () => void start(),
|
|
9244
9411
|
disabled: busy,
|
|
9245
9412
|
className: cn(
|
|
9246
|
-
|
|
9413
|
+
PRIMARY_ACTION_CLASS,
|
|
9247
9414
|
"transition-colors hover:bg-og-accent-strong disabled:opacity-70 pointer-coarse:min-h-9"
|
|
9248
9415
|
),
|
|
9249
9416
|
children: [
|
|
@@ -9258,7 +9425,7 @@ function AuthNeededRow({
|
|
|
9258
9425
|
rel: "noreferrer",
|
|
9259
9426
|
target: "_blank",
|
|
9260
9427
|
className: cn(
|
|
9261
|
-
|
|
9428
|
+
PRIMARY_ACTION_CLASS,
|
|
9262
9429
|
"transition-colors hover:bg-og-accent-strong pointer-coarse:min-h-9"
|
|
9263
9430
|
),
|
|
9264
9431
|
children: [
|
|
@@ -9303,7 +9470,7 @@ function AuthProviderLogo({ src, label }) {
|
|
|
9303
9470
|
}
|
|
9304
9471
|
function monogram(label) {
|
|
9305
9472
|
const words = label.trim().split(/\s+/).filter(Boolean);
|
|
9306
|
-
if (words.length
|
|
9473
|
+
if (!words.length) {
|
|
9307
9474
|
return "?";
|
|
9308
9475
|
}
|
|
9309
9476
|
if (words.length === 1) {
|
|
@@ -9401,4 +9568,4 @@ export {
|
|
|
9401
9568
|
MessageTimeline,
|
|
9402
9569
|
TimelineRow
|
|
9403
9570
|
};
|
|
9404
|
-
//# sourceMappingURL=chunk-
|
|
9571
|
+
//# sourceMappingURL=chunk-6H6S5V4Z.js.map
|