@oxy.so/bloom 4.7.0 → 4.9.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.
Files changed (57) hide show
  1. package/docs/adoption-matrix.mdx +2 -2
  2. package/docs/ai-chat.mdx +21 -0
  3. package/docs/settings-modal.mdx +1 -1
  4. package/lib/commonjs/ai-chat/AiChatContainer.js +384 -77
  5. package/lib/commonjs/ai-chat/AiChatContainer.js.map +1 -1
  6. package/lib/commonjs/ai-chat/context.js +28 -1
  7. package/lib/commonjs/ai-chat/context.js.map +1 -1
  8. package/lib/commonjs/ai-chat/index.js +6 -0
  9. package/lib/commonjs/ai-chat/index.js.map +1 -1
  10. package/lib/commonjs/ai-chat/index.web.js +6 -0
  11. package/lib/commonjs/ai-chat/index.web.js.map +1 -1
  12. package/lib/commonjs/settings-modal/SettingsStorage.js +1 -1
  13. package/lib/commonjs/settings-modal/SettingsStorage.js.map +1 -1
  14. package/lib/module/ai-chat/AiChatContainer.js +386 -79
  15. package/lib/module/ai-chat/AiChatContainer.js.map +1 -1
  16. package/lib/module/ai-chat/context.js +26 -0
  17. package/lib/module/ai-chat/context.js.map +1 -1
  18. package/lib/module/ai-chat/index.js +1 -1
  19. package/lib/module/ai-chat/index.js.map +1 -1
  20. package/lib/module/ai-chat/index.web.js +1 -1
  21. package/lib/module/ai-chat/index.web.js.map +1 -1
  22. package/lib/module/settings-modal/SettingsStorage.js +1 -1
  23. package/lib/module/settings-modal/SettingsStorage.js.map +1 -1
  24. package/lib/typescript/commonjs/ai-chat/AiChatContainer.d.ts +24 -1
  25. package/lib/typescript/commonjs/ai-chat/AiChatContainer.d.ts.map +1 -1
  26. package/lib/typescript/commonjs/ai-chat/context.d.ts +32 -0
  27. package/lib/typescript/commonjs/ai-chat/context.d.ts.map +1 -1
  28. package/lib/typescript/commonjs/ai-chat/index.d.ts +2 -2
  29. package/lib/typescript/commonjs/ai-chat/index.d.ts.map +1 -1
  30. package/lib/typescript/commonjs/ai-chat/index.web.d.ts +2 -2
  31. package/lib/typescript/commonjs/ai-chat/index.web.d.ts.map +1 -1
  32. package/lib/typescript/commonjs/ai-chat/types.d.ts +17 -0
  33. package/lib/typescript/commonjs/ai-chat/types.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/settings-modal/SettingsStorage.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/settings-modal/types.d.ts +2 -1
  36. package/lib/typescript/commonjs/settings-modal/types.d.ts.map +1 -1
  37. package/lib/typescript/module/ai-chat/AiChatContainer.d.ts +24 -1
  38. package/lib/typescript/module/ai-chat/AiChatContainer.d.ts.map +1 -1
  39. package/lib/typescript/module/ai-chat/context.d.ts +32 -0
  40. package/lib/typescript/module/ai-chat/context.d.ts.map +1 -1
  41. package/lib/typescript/module/ai-chat/index.d.ts +2 -2
  42. package/lib/typescript/module/ai-chat/index.d.ts.map +1 -1
  43. package/lib/typescript/module/ai-chat/index.web.d.ts +2 -2
  44. package/lib/typescript/module/ai-chat/index.web.d.ts.map +1 -1
  45. package/lib/typescript/module/ai-chat/types.d.ts +17 -0
  46. package/lib/typescript/module/ai-chat/types.d.ts.map +1 -1
  47. package/lib/typescript/module/settings-modal/SettingsStorage.d.ts.map +1 -1
  48. package/lib/typescript/module/settings-modal/types.d.ts +2 -1
  49. package/lib/typescript/module/settings-modal/types.d.ts.map +1 -1
  50. package/package.json +1 -1
  51. package/src/ai-chat/AiChatContainer.tsx +343 -59
  52. package/src/ai-chat/context.ts +39 -0
  53. package/src/ai-chat/index.ts +2 -2
  54. package/src/ai-chat/index.web.ts +2 -2
  55. package/src/ai-chat/types.ts +17 -0
  56. package/src/settings-modal/SettingsStorage.tsx +6 -4
  57. package/src/settings-modal/types.ts +2 -1
@@ -1,13 +1,18 @@
1
1
  "use strict";
2
2
 
3
- import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from 'react';
4
- import { ScrollView, View } from 'react-native';
3
+ import React, { forwardRef, useCallback, useContext, useImperativeHandle, useMemo, useRef, useState } from 'react';
4
+ import { ScrollView, StyleSheet, View } from 'react-native';
5
+ import Animated, { useAnimatedStyle, useSharedValue } from 'react-native-reanimated';
5
6
  import { AgentThinking } from "../agent-thinking/index.js";
6
7
  import { Breadcrumb, BreadcrumbItem } from "../breadcrumb/index.js";
7
8
  import { RiFolderLine } from "../icons/remix/RiFolderLine.js";
8
9
  import { RiMoreFill } from "../icons/remix/RiMoreFill.js";
9
10
  import { RiShare2Line } from "../icons/remix/RiShare2Line.js";
11
+ import { EdgeScrim, SCRIM_TAIL_RATIO } from "../page-header/EdgeScrim.js";
12
+ import { parseRgba } from "../theme/color-utils.js";
13
+ import { useIsomorphicLayoutEffect } from "../theme/use-isomorphic-layout-effect.js";
10
14
  import { GlyphAction } from "./AiChatControls.js";
15
+ import { AiChatFloatingChromeContext } from "./context.js";
11
16
  import { CONTAINER_RADIUS, dataHook, IS_WEB, useAiChatPalette, useAiChatWebCss } from "./shared.js";
12
17
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
18
  const DEFAULT_LABELS = {
@@ -16,6 +21,22 @@ const DEFAULT_LABELS = {
16
21
  more: 'More options'
17
22
  };
18
23
 
24
+ /** The thread's own top padding: the gap between the header and the first turn. */
25
+ const THREAD_PAD_TOP = 16;
26
+ /**
27
+ * `floatingChrome`: the footer's fade strip, px — the footer's top padding, so
28
+ * the last turn at rest ends where the fade begins, and the distance over which
29
+ * the bottom fade ramps in as the transcript slides under it.
30
+ */
31
+ const FOOTER_FADE = 24;
32
+ /** Below this many px of overlap an edge counts as clear (sub-pixel scroll noise). */
33
+ const EDGE_THRESHOLD = 1;
34
+ const HIDDEN_FROM_A11Y = {
35
+ 'aria-hidden': true,
36
+ accessibilityElementsHidden: true,
37
+ importantForAccessibility: 'no-hide-descendants'
38
+ };
39
+
19
40
  /**
20
41
  * The AI chat's centre column: the centre column of the AI chat template.
21
42
  *
@@ -33,6 +54,22 @@ const DEFAULT_LABELS = {
33
54
  *
34
55
  * `project` is optional: without one the breadcrumb is the chat's own crumb
35
56
  * alone, since a chat that belongs to nothing must not have to invent a folder.
57
+ *
58
+ * `floatingChrome` changes the geometry, not the parts:
59
+ *
60
+ * thread the `children` fill the whole card, under everything below
61
+ * header the `header` slot + breadcrumb row, absolute at the top, no band;
62
+ * an edge scrim of the surface (opaque at the top, gone
63
+ * `SCRIM_TAIL_RATIO` below the block) fades in over the first 16px
64
+ * of transcript scrolled under it
65
+ * footer absolute at the bottom, pt 24 instead of 12: the 24px strip is a
66
+ * scrim ramp and the rest is solid surface, faded in over the first
67
+ * 24px of transcript below the fold
68
+ *
69
+ * Both blocks are `pointerEvents="box-none"`, so the transcript under their
70
+ * empty space still scrolls and takes clicks. The measured heights reach an
71
+ * `AiChatThread` child through context (its content padding) and any other
72
+ * child through `useAiChatChromeInsets()`.
36
73
  */
37
74
  export function AiChatContainer({
38
75
  project,
@@ -49,6 +86,7 @@ export function AiChatContainer({
49
86
  workingLabel,
50
87
  background,
51
88
  surface = true,
89
+ floatingChrome = false,
52
90
  labels,
53
91
  style,
54
92
  testID
@@ -59,76 +97,104 @@ export function AiChatContainer({
59
97
  ...DEFAULT_LABELS,
60
98
  ...labels
61
99
  }), [labels]);
62
- return /*#__PURE__*/_jsxs(View, {
63
- testID: testID,
64
- style: [{
65
- height: '100%',
66
- minWidth: 0,
67
- flex: 1,
68
- flexDirection: 'column',
69
- overflow: 'hidden',
70
- borderRadius: CONTAINER_RADIUS,
71
- backgroundColor: surface ? palette.secondary : 'transparent'
72
- }, style],
73
- children: [background ? /*#__PURE__*/_jsx(View, {
74
- pointerEvents: "none",
100
+ const hasCrumbRow = title != null || project != null || onShare || onMore || actions != null;
101
+ const crumbRow = hasCrumbRow ? /*#__PURE__*/_jsxs(View, {
102
+ pointerEvents: "box-none",
103
+ style: {
104
+ width: '100%',
105
+ flexDirection: 'row',
106
+ alignItems: 'center',
107
+ justifyContent: 'space-between',
108
+ gap: 8,
109
+ paddingLeft: 16,
110
+ paddingRight: 16,
111
+ paddingTop: 16
112
+ },
113
+ children: [/*#__PURE__*/_jsx(View, {
114
+ pointerEvents: "box-none",
75
115
  style: {
76
- position: 'absolute',
77
- top: 0,
78
- left: 0,
79
- right: 0,
80
- bottom: 0
116
+ minWidth: 0,
117
+ flex: 1
81
118
  },
82
- children: background
83
- }) : null, header, title != null || project != null || onShare || onMore || actions != null ? /*#__PURE__*/_jsxs(View, {
119
+ children: title != null || project != null ? /*#__PURE__*/_jsxs(Breadcrumb, {
120
+ accessibilityLabel: l.breadcrumb,
121
+ children: [project === undefined ? null : /*#__PURE__*/_jsx(BreadcrumbItem, {
122
+ icon: projectIcon,
123
+ onPress: onProjectPress,
124
+ children: project
125
+ }), title == null ? null : /*#__PURE__*/_jsx(BreadcrumbItem, {
126
+ current: true,
127
+ children: title
128
+ })]
129
+ }) : null
130
+ }), /*#__PURE__*/_jsx(View, {
84
131
  style: {
85
- width: '100%',
132
+ flexShrink: 0,
86
133
  flexDirection: 'row',
87
134
  alignItems: 'center',
88
- justifyContent: 'space-between',
89
- gap: 8,
90
- paddingLeft: 16,
91
- paddingRight: 16,
92
- paddingTop: 16
135
+ gap: 8
93
136
  },
94
- children: [/*#__PURE__*/_jsx(View, {
95
- style: {
96
- minWidth: 0,
97
- flex: 1
98
- },
99
- children: title != null || project != null ? /*#__PURE__*/_jsxs(Breadcrumb, {
100
- accessibilityLabel: l.breadcrumb,
101
- children: [project === undefined ? null : /*#__PURE__*/_jsx(BreadcrumbItem, {
102
- icon: projectIcon,
103
- onPress: onProjectPress,
104
- children: project
105
- }), title == null ? null : /*#__PURE__*/_jsx(BreadcrumbItem, {
106
- current: true,
107
- children: title
108
- })]
109
- }) : null
110
- }), /*#__PURE__*/_jsx(View, {
111
- style: {
112
- flexShrink: 0,
113
- flexDirection: 'row',
114
- alignItems: 'center',
115
- gap: 8
116
- },
117
- children: actions ?? /*#__PURE__*/_jsxs(_Fragment, {
118
- children: [onShare ? /*#__PURE__*/_jsx(GlyphAction, {
119
- icon: RiShare2Line,
120
- label: l.share,
121
- onPress: onShare,
122
- palette: palette
123
- }) : null, onMore ? /*#__PURE__*/_jsx(GlyphAction, {
124
- icon: RiMoreFill,
125
- label: l.more,
126
- onPress: onMore,
127
- palette: palette
128
- }) : null]
129
- })
130
- })]
131
- }) : null, children, /*#__PURE__*/_jsxs(View, {
137
+ children: actions ?? /*#__PURE__*/_jsxs(_Fragment, {
138
+ children: [onShare ? /*#__PURE__*/_jsx(GlyphAction, {
139
+ icon: RiShare2Line,
140
+ label: l.share,
141
+ onPress: onShare,
142
+ palette: palette
143
+ }) : null, onMore ? /*#__PURE__*/_jsx(GlyphAction, {
144
+ icon: RiMoreFill,
145
+ label: l.more,
146
+ onPress: onMore,
147
+ palette: palette
148
+ }) : null]
149
+ })
150
+ })]
151
+ }) : null;
152
+ const footerBody = /*#__PURE__*/_jsxs(_Fragment, {
153
+ children: [working ? /*#__PURE__*/_jsx(AgentThinking, {
154
+ variant: "infinity",
155
+ label: workingLabel,
156
+ style: {
157
+ paddingLeft: 6,
158
+ paddingRight: 6
159
+ }
160
+ }) : null, composer]
161
+ });
162
+ const backgroundLayer = background ? /*#__PURE__*/_jsx(View, {
163
+ pointerEvents: "none",
164
+ style: {
165
+ position: 'absolute',
166
+ top: 0,
167
+ left: 0,
168
+ right: 0,
169
+ bottom: 0
170
+ },
171
+ children: background
172
+ }) : null;
173
+ const rootStyle = [{
174
+ height: '100%',
175
+ minWidth: 0,
176
+ flex: 1,
177
+ flexDirection: 'column',
178
+ overflow: 'hidden',
179
+ borderRadius: CONTAINER_RADIUS,
180
+ backgroundColor: surface ? palette.secondary : 'transparent'
181
+ }, style];
182
+ if (floatingChrome) {
183
+ return /*#__PURE__*/_jsx(FloatingChrome, {
184
+ testID: testID,
185
+ rootStyle: rootStyle,
186
+ backgroundLayer: backgroundLayer,
187
+ header: header,
188
+ crumbRow: crumbRow,
189
+ footerBody: footerBody,
190
+ fadeColor: surface ? palette.secondary : null,
191
+ children: children
192
+ });
193
+ }
194
+ return /*#__PURE__*/_jsxs(View, {
195
+ testID: testID,
196
+ style: rootStyle,
197
+ children: [backgroundLayer, header, crumbRow, children, /*#__PURE__*/_jsx(View, {
132
198
  style: {
133
199
  width: '100%',
134
200
  flexDirection: 'column',
@@ -138,14 +204,171 @@ export function AiChatContainer({
138
204
  paddingTop: 12,
139
205
  paddingBottom: 10
140
206
  },
141
- children: [working ? /*#__PURE__*/_jsx(AgentThinking, {
142
- variant: "infinity",
143
- label: workingLabel,
207
+ children: footerBody
208
+ })]
209
+ });
210
+ }
211
+ /**
212
+ * `AiChatContainer floatingChrome`: the same parts, the chrome floated over the
213
+ * transcript. Everything it measures lives here, so the stacked path above
214
+ * carries none of the state.
215
+ *
216
+ * The edge opacities are shared values written from the thread's scroll
217
+ * reports, so a scroll frame re-renders nothing; the booleans only mount and
218
+ * unmount the scrims, and change once per crossing. Same model as the
219
+ * sidebar's `SidebarScrollArea`, whose scrim this reuses.
220
+ */
221
+ function FloatingChrome({
222
+ testID,
223
+ rootStyle,
224
+ backgroundLayer,
225
+ header,
226
+ crumbRow,
227
+ footerBody,
228
+ fadeColor,
229
+ children
230
+ }) {
231
+ const [insets, setInsets] = useState({
232
+ top: 0,
233
+ bottom: 0
234
+ });
235
+ const [edges, setEdges] = useState({
236
+ top: false,
237
+ bottom: false
238
+ });
239
+ const topFade = useSharedValue(0);
240
+ const bottomFade = useSharedValue(0);
241
+ const onHeaderLayout = useCallback(event => {
242
+ const top = Math.round(event.nativeEvent.layout.height);
243
+ setInsets(previous => previous.top === top ? previous : {
244
+ ...previous,
245
+ top
246
+ });
247
+ }, []);
248
+ const onFooterLayout = useCallback(event => {
249
+ const bottom = Math.round(event.nativeEvent.layout.height);
250
+ setInsets(previous => previous.bottom === bottom ? previous : {
251
+ ...previous,
252
+ bottom
253
+ });
254
+ }, []);
255
+ const reportScroll = useCallback(({
256
+ offset,
257
+ viewport,
258
+ content
259
+ }) => {
260
+ const range = Math.max(0, content - viewport);
261
+ const y = Math.max(0, Math.min(offset, range));
262
+ const overflow = viewport > 0 && range > EDGE_THRESHOLD;
263
+ // The first turn rests THREAD_PAD_TOP below the header and the last one
264
+ // right on the footer's fade strip, so the overlap starts at the first px
265
+ // scrolled and each ramp spans the gap it is closing.
266
+ const top = overflow && y > EDGE_THRESHOLD;
267
+ const bottom = overflow && range - y > EDGE_THRESHOLD;
268
+ topFade.value = overflow ? Math.min(1, y / THREAD_PAD_TOP) : 0;
269
+ bottomFade.value = overflow ? Math.min(1, (range - y) / FOOTER_FADE) : 0;
270
+ setEdges(previous => previous.top === top && previous.bottom === bottom ? previous : {
271
+ top,
272
+ bottom
273
+ });
274
+ }, [topFade, bottomFade]);
275
+ const chrome = useMemo(() => ({
276
+ insets,
277
+ reportScroll
278
+ }), [insets, reportScroll]);
279
+
280
+ // SVG never receives alpha inside stopColor; it travels on the containing view.
281
+ const parsed = fadeColor ? parseRgba(fadeColor) : null;
282
+ const solid = parsed ? `rgb(${parsed.r}, ${parsed.g}, ${parsed.b})` : fadeColor;
283
+ const alpha = parsed?.a ?? 1;
284
+ const topStyle = useAnimatedStyle(() => ({
285
+ opacity: topFade.value * alpha
286
+ }), [topFade, alpha]);
287
+ const bottomStyle = useAnimatedStyle(() => ({
288
+ opacity: bottomFade.value * alpha
289
+ }), [bottomFade, alpha]);
290
+ const prefix = testID ?? 'ai-chat';
291
+ return /*#__PURE__*/_jsxs(View, {
292
+ testID: testID,
293
+ style: [rootStyle, {
294
+ position: 'relative'
295
+ }],
296
+ children: [backgroundLayer, /*#__PURE__*/_jsx(AiChatFloatingChromeContext.Provider, {
297
+ value: chrome,
298
+ children: children
299
+ }), /*#__PURE__*/_jsxs(View, {
300
+ testID: `${prefix}-chrome-top`,
301
+ pointerEvents: "box-none",
302
+ onLayout: onHeaderLayout,
303
+ style: {
304
+ position: 'absolute',
305
+ top: 0,
306
+ left: 0,
307
+ right: 0
308
+ },
309
+ children: [solid && edges.top && insets.top > 0 ? /*#__PURE__*/_jsx(Animated.View, {
310
+ testID: `${prefix}-fade-top`,
311
+ pointerEvents: "none",
312
+ ...HIDDEN_FROM_A11Y,
313
+ style: [{
314
+ position: 'absolute',
315
+ top: 0,
316
+ left: 0,
317
+ right: 0,
318
+ // Past the block's own bottom: a ramp that ends where the layout
319
+ // does is a line across the transcript again.
320
+ height: Math.round(insets.top * (1 + SCRIM_TAIL_RATIO))
321
+ }, topStyle],
322
+ children: /*#__PURE__*/_jsx(EdgeScrim, {
323
+ color: solid
324
+ })
325
+ }) : null, header, crumbRow]
326
+ }), /*#__PURE__*/_jsxs(View, {
327
+ testID: `${prefix}-chrome-bottom`,
328
+ pointerEvents: "box-none",
329
+ onLayout: onFooterLayout,
330
+ style: {
331
+ position: 'absolute',
332
+ left: 0,
333
+ right: 0,
334
+ bottom: 0
335
+ },
336
+ children: [solid && edges.bottom ? /*#__PURE__*/_jsxs(Animated.View, {
337
+ testID: `${prefix}-fade-bottom`,
338
+ pointerEvents: "none",
339
+ ...HIDDEN_FROM_A11Y,
340
+ style: [StyleSheet.absoluteFill, {
341
+ flexDirection: 'column'
342
+ }, bottomStyle],
343
+ children: [/*#__PURE__*/_jsx(View, {
344
+ style: {
345
+ height: FOOTER_FADE,
346
+ transform: [{
347
+ rotate: '180deg'
348
+ }]
349
+ },
350
+ children: /*#__PURE__*/_jsx(EdgeScrim, {
351
+ color: solid
352
+ })
353
+ }), /*#__PURE__*/_jsx(View, {
354
+ style: {
355
+ flex: 1,
356
+ backgroundColor: solid
357
+ }
358
+ })]
359
+ }) : null, /*#__PURE__*/_jsx(View, {
360
+ pointerEvents: "box-none",
144
361
  style: {
145
- paddingLeft: 6,
146
- paddingRight: 6
147
- }
148
- }) : null, composer]
362
+ width: '100%',
363
+ flexDirection: 'column',
364
+ gap: 10,
365
+ paddingLeft: 10,
366
+ paddingRight: 10,
367
+ paddingTop: FOOTER_FADE,
368
+ paddingBottom: 10
369
+ },
370
+ children: footerBody
371
+ })]
149
372
  })]
150
373
  });
151
374
  }
@@ -171,6 +394,13 @@ export function AiChatContainer({
171
394
  *
172
395
  * There is no virtualization and no `scrollToIndex`: a host jumping to a turn
173
396
  * measures its row (`onLayout`) and calls `scrollToOffset`.
397
+ *
398
+ * Inside `AiChatContainer floatingChrome` the thread still fills its parent —
399
+ * the whole card — and pads its CONTENT by the chrome the container measured:
400
+ * pt = header block + 16, pb = footer block. At rest the first and last turns
401
+ * sit exactly where the stacked layout puts them relative to the chrome; in
402
+ * motion they pass under it. It also reports its position so the container
403
+ * knows when to fade each edge. Anywhere else nothing of this exists.
174
404
  */
175
405
  export const AiChatThread = /*#__PURE__*/forwardRef(function AiChatThread({
176
406
  children,
@@ -185,14 +415,45 @@ export const AiChatThread = /*#__PURE__*/forwardRef(function AiChatThread({
185
415
  style,
186
416
  testID
187
417
  }, ref) {
418
+ const chrome = useContext(AiChatFloatingChromeContext);
188
419
  const scrollRef = useRef(null);
189
420
  const lastHeight = useRef(0);
421
+ /**
422
+ * The latest content height from ANY source, for the chrome report only.
423
+ * `lastHeight` must change solely in `onContentSizeChange`: a scroll event
424
+ * carrying the new size first would otherwise hide the growth from the follow.
425
+ */
426
+ const contentHeight = useRef(0);
190
427
  const offset = useRef(0);
191
428
  const viewport = useRef(0);
192
429
  /** An `onStartReached` is out and its page has not landed yet. */
193
430
  const pageOut = useRef(false);
194
431
  /** The reader has left the top zone, so the next approach may fire again. */
195
432
  const startArmed = useRef(true);
433
+
434
+ // The chrome's padding changing is not a new turn: it is recorded here,
435
+ // before the resize it causes, so `onContentSizeChange` can tell the two apart.
436
+ const insetTop = chrome?.insets.top ?? 0;
437
+ const insetBottom = chrome?.insets.bottom ?? 0;
438
+ const appliedInsets = useRef({
439
+ top: insetTop,
440
+ bottom: insetBottom
441
+ });
442
+ const insetShift = useRef({
443
+ top: 0,
444
+ bottom: 0
445
+ });
446
+ useIsomorphicLayoutEffect(() => {
447
+ const applied = appliedInsets.current;
448
+ insetShift.current = {
449
+ top: insetShift.current.top + insetTop - applied.top,
450
+ bottom: insetShift.current.bottom + insetBottom - applied.bottom
451
+ };
452
+ appliedInsets.current = {
453
+ top: insetTop,
454
+ bottom: insetBottom
455
+ };
456
+ }, [insetTop, insetBottom]);
196
457
  useImperativeHandle(ref, () => ({
197
458
  scrollToEnd: options => scrollRef.current?.scrollToEnd({
198
459
  animated: options?.animated ?? true
@@ -206,14 +467,24 @@ export const AiChatThread = /*#__PURE__*/forwardRef(function AiChatThread({
206
467
  }),
207
468
  getScrollView: () => scrollRef.current
208
469
  }), []);
209
- const listening = !!onScroll || !!onStartReached || followThreshold !== undefined || maintainStartPosition;
470
+ const listening = !!chrome || !!onScroll || !!onStartReached || followThreshold !== undefined || maintainStartPosition;
471
+ const report = useCallback(() => {
472
+ chrome?.reportScroll({
473
+ offset: offset.current,
474
+ viewport: viewport.current,
475
+ content: contentHeight.current
476
+ });
477
+ }, [chrome]);
210
478
  const handleScroll = useCallback(event => {
211
479
  const {
212
480
  contentOffset,
213
- layoutMeasurement
481
+ layoutMeasurement,
482
+ contentSize
214
483
  } = event.nativeEvent;
215
484
  offset.current = contentOffset.y;
216
485
  viewport.current = layoutMeasurement.height;
486
+ if (contentSize?.height) contentHeight.current = contentSize.height;
487
+ report();
217
488
  if (onStartReached) {
218
489
  if (contentOffset.y <= onStartReachedThreshold) {
219
490
  if (startArmed.current) {
@@ -226,16 +497,45 @@ export const AiChatThread = /*#__PURE__*/forwardRef(function AiChatThread({
226
497
  }
227
498
  }
228
499
  onScroll?.(event);
229
- }, [onScroll, onStartReached, onStartReachedThreshold]);
500
+ }, [onScroll, onStartReached, onStartReachedThreshold, report]);
230
501
  const onLayout = useCallback(event => {
231
502
  viewport.current = event.nativeEvent.layout.height;
232
- }, []);
503
+ report();
504
+ }, [report]);
233
505
  const onContentSizeChange = useCallback((_width, height) => {
234
506
  const previous = lastHeight.current;
235
507
  const grew = height > previous + 0.5;
236
508
  const first = previous === 0;
237
509
  lastHeight.current = height;
238
- if (!grew || first) return;
510
+ contentHeight.current = height;
511
+ const shift = insetShift.current;
512
+ insetShift.current = {
513
+ top: 0,
514
+ bottom: 0
515
+ };
516
+ report();
517
+ if (first) return;
518
+
519
+ // Exactly the chrome's padding changed (a composer growing, the header
520
+ // measuring in): hold the reader still instead of following. At the end
521
+ // they stay at the end, unanimated; mid-thread, a top shift is absorbed
522
+ // into the offset so the turn they are on does not move.
523
+ const chromeShift = shift.top + shift.bottom;
524
+ if (chromeShift !== 0 && Math.abs(height - previous - chromeShift) < 1) {
525
+ const fromBottom = previous - offset.current - viewport.current;
526
+ if (fromBottom <= EDGE_THRESHOLD) {
527
+ scrollRef.current?.scrollToEnd({
528
+ animated: false
529
+ });
530
+ } else if (offset.current > 0 && shift.top !== 0) {
531
+ scrollRef.current?.scrollTo({
532
+ y: offset.current + shift.top,
533
+ animated: false
534
+ });
535
+ }
536
+ return;
537
+ }
538
+ if (!grew) return;
239
539
 
240
540
  // A page landing above the reader: keep the turn they are on where it is.
241
541
  if (maintainStartPosition && pageOut.current) {
@@ -286,8 +586,15 @@ export const AiChatThread = /*#__PURE__*/forwardRef(function AiChatThread({
286
586
  gap: 12,
287
587
  paddingLeft: 16,
288
588
  paddingRight: 16,
289
- paddingTop: 16
589
+ paddingTop: THREAD_PAD_TOP + (chrome ? chrome.insets.top : 0),
590
+ ...(chrome ? {
591
+ paddingBottom: chrome.insets.bottom
592
+ } : null)
290
593
  },
594
+ scrollIndicatorInsets: chrome ? {
595
+ top: chrome.insets.top,
596
+ bottom: chrome.insets.bottom
597
+ } : undefined,
291
598
  children: children
292
599
  });
293
600
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","useCallback","useImperativeHandle","useMemo","useRef","ScrollView","View","AgentThinking","Breadcrumb","BreadcrumbItem","RiFolderLine","RiMoreFill","RiShare2Line","GlyphAction","CONTAINER_RADIUS","dataHook","IS_WEB","useAiChatPalette","useAiChatWebCss","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DEFAULT_LABELS","breadcrumb","share","more","AiChatContainer","project","title","projectIcon","onProjectPress","onShare","onMore","actions","header","children","composer","working","workingLabel","background","surface","labels","style","testID","palette","l","height","minWidth","flex","flexDirection","overflow","borderRadius","backgroundColor","secondary","pointerEvents","position","top","left","right","bottom","width","alignItems","justifyContent","gap","paddingLeft","paddingRight","paddingTop","accessibilityLabel","undefined","icon","onPress","current","flexShrink","label","paddingBottom","variant","AiChatThread","autoFollow","followAnimated","followThreshold","onStartReached","onStartReachedThreshold","maintainStartPosition","onScroll","scrollEventThrottle","ref","scrollRef","lastHeight","offset","viewport","pageOut","startArmed","scrollToEnd","options","animated","scrollToOffset","y","scrollTo","getScrollView","listening","handleScroll","event","contentOffset","layoutMeasurement","nativeEvent","onLayout","layout","onContentSizeChange","_width","previous","grew","first","fromBottom","minHeight","contentContainerStyle","flexGrow"],"sourceRoot":"../../../src","sources":["ai-chat/AiChatContainer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC5F,SACEC,UAAU,EACVC,IAAI,QAIC,cAAc;AAErB,SAASC,aAAa,QAAQ,4BAAmB;AACjD,SAASC,UAAU,EAAEC,cAAc,QAAQ,wBAAe;AAC1D,SAASC,YAAY,QAAQ,gCAA6B;AAC1D,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,YAAY,QAAQ,gCAA6B;AAC1D,SAASC,WAAW,QAAQ,qBAAkB;AAC9C,SAASC,gBAAgB,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,gBAAgB,EAAEC,eAAe,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAGjG,MAAMC,cAAc,GAAG;EACrBC,UAAU,EAAE,eAAe;EAC3BC,KAAK,EAAE,YAAY;EACnBC,IAAI,EAAE;AACR,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA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AAO,GAAGkB,QAAQ,CAAClB,OAAO;MAC/D,IAAIyC,UAAU,GAAGjC,eAAe,EAAE;IACpC;IACAO,SAAS,CAACf,OAAO,EAAEqB,WAAW,CAAC;MAAEE,QAAQ,EAAEhB;IAAe,CAAC,CAAC;EAC9D,CAAC,EACD,CAACD,UAAU,EAAEC,cAAc,EAAEC,eAAe,EAAEG,qBAAqB,CACrE,CAAC;EAED,oBACEjE,IAAA,CAACf,UAAU;IACTmF,GAAG,EAAEC,SAAU;IACf3C,MAAM,EAAEA,MAAO;IAAA,GACX/B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACzC+F,mBAAmB,EAAEA,mBAAoB;IACzCF,QAAQ,EAAEA,QAAS;IACnBtB,QAAQ,EAAEgB,SAAS,GAAGC,YAAY,GAAGhC,SAAU;IAC/CgB,mBAAmB,EAAEe,SAAS,GAAGf,mBAAmB,GAAGhB,SAAU;IACjE1B,KAAK,EAAE,CAAC;MAAEuE,SAAS,EAAE,CAAC;MAAErD,KAAK,EAAE,MAAM;MAAEZ,IAAI,EAAE;IAAE,CAAC,EAAEN,KAAK,CAAE;IACzDwE,qBAAqB,EAAE;MACrB;MACA;MACA;MACA,IAAIrG,MAAM,GAAG;QAAEoG,SAAS,EAAE,MAAM;QAAEzC,UAAU,EAAE;MAAE,CAAC,GAAG;QAAE2C,QAAQ,EAAE;MAAE,CAAC,CAAC;MACpElE,aAAa,EAAE,QAAQ;MACvBa,cAAc,EAAE,UAAU;MAC1BC,GAAG,EAAE,EAAE;MACPC,WAAW,EAAE,EAAE;MACfC,YAAY,EAAE,EAAE;MAChBC,UAAU,EAAE;IACd,CAAE;IAAA/B,QAAA,EACDA;EAAQ,CACC,CAAC;AAEjB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","forwardRef","useCallback","useContext","useImperativeHandle","useMemo","useRef","useState","ScrollView","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","AgentThinking","Breadcrumb","BreadcrumbItem","RiFolderLine","RiMoreFill","RiShare2Line","EdgeScrim","SCRIM_TAIL_RATIO","parseRgba","useIsomorphicLayoutEffect","GlyphAction","AiChatFloatingChromeContext","CONTAINER_RADIUS","dataHook","IS_WEB","useAiChatPalette","useAiChatWebCss","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DEFAULT_LABELS","breadcrumb","share","more","THREAD_PAD_TOP","FOOTER_FADE","EDGE_THRESHOLD","HIDDEN_FROM_A11Y","accessibilityElementsHidden","importantForAccessibility","AiChatContainer","project","title","projectIcon","onProjectPress","onShare","onMore","actions","header","children","composer","working","workingLabel","background","surface","floatingChrome","labels","style","testID","palette","l","hasCrumbRow","crumbRow","pointerEvents","width","flexDirection","alignItems","justifyContent","gap","paddingLeft","paddingRight","paddingTop","minWidth","flex","accessibilityLabel","undefined","icon","onPress","current","flexShrink","label","footerBody","variant","backgroundLayer","position","top","left","right","bottom","rootStyle","height","overflow","borderRadius","backgroundColor","secondary","FloatingChrome","fadeColor","paddingBottom","insets","setInsets","edges","setEdges","topFade","bottomFade","onHeaderLayout","event","Math","round","nativeEvent","layout","previous","onFooterLayout","reportScroll","offset","viewport","content","range","max","y","min","value","chrome","parsed","solid","r","g","b","alpha","a","topStyle","opacity","bottomStyle","prefix","Provider","onLayout","color","absoluteFill","transform","rotate","AiChatThread","autoFollow","followAnimated","followThreshold","onStartReached","onStartReachedThreshold","maintainStartPosition","onScroll","scrollEventThrottle","ref","scrollRef","lastHeight","contentHeight","pageOut","startArmed","insetTop","insetBottom","appliedInsets","insetShift","applied","scrollToEnd","options","animated","scrollToOffset","scrollTo","getScrollView","listening","report","handleScroll","contentOffset","layoutMeasurement","contentSize","onContentSizeChange","_width","grew","first","shift","chromeShift","abs","fromBottom","minHeight","contentContainerStyle","flexGrow","scrollIndicatorInsets"],"sourceRoot":"../../../src","sources":["ai-chat/AiChatContainer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,mBAAm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B,MAAM,CAACb,GAAG;MAAEG,MAAM,EAAEiC,MAAM,CAACvB,MAAM,CAACV;IAAO,CAAC,GAAGb,SAAU;IAAA1B,QAAA,EACpGA;EAAQ,CACC,CAAC;AAEjB,CAAC,CAAC","ignoreList":[]}
@@ -33,4 +33,30 @@ export const AiChatShellContext = /*#__PURE__*/createContext(null);
33
33
  export function useAiChatShell() {
34
34
  return useContext(AiChatShellContext);
35
35
  }
36
+
37
+ /**
38
+ * The heights an `AiChatContainer floatingChrome` measures for the chrome it
39
+ * floats over its `children`: the header block at the top and the footer
40
+ * (`AgentThinking` + composer, with its fade strip) at the bottom, px.
41
+ */
42
+
43
+ /** Where the thread is, reported to the container so each edge knows when to fade. */
44
+
45
+ /**
46
+ * What a floating-chrome container hands its `children`. Internal: the thread
47
+ * reads `insets` and reports its scroll; hosts read only the insets, through
48
+ * `useAiChatChromeInsets()`.
49
+ */
50
+
51
+ export const AiChatFloatingChromeContext = /*#__PURE__*/createContext(null);
52
+
53
+ /**
54
+ * Inside `AiChatContainer floatingChrome`: how much of the top and bottom of the
55
+ * card the floating header and composer cover, so a custom child (an empty
56
+ * state, a scroller of its own) can keep its resting content clear of them.
57
+ * `null` anywhere else — outside a container, or in one that stacks its chrome.
58
+ */
59
+ export function useAiChatChromeInsets() {
60
+ return useContext(AiChatFloatingChromeContext)?.insets ?? null;
61
+ }
36
62
  //# sourceMappingURL=context.js.map