diff --git a/apps/app/src/components/promptbox/banner/QueuedMessagesList.tsx b/apps/app/src/components/promptbox/banner/QueuedMessagesList.tsx index 79f25f26950..b29ad27cb76 100644 --- a/apps/app/src/components/promptbox/banner/QueuedMessagesList.tsx +++ b/apps/app/src/components/promptbox/banner/QueuedMessagesList.tsx @@ -106,7 +106,8 @@ import { shiftMentionsToTextRange, } from "@/components/thread/timeline/ConversationMessageMentions"; import { - buildPromptMentionComponent, + PromptMentionElement, + PromptMentionsContext, remarkPromptMentions, substitutePromptMentions, } from "@/components/ui/markdown-prompt-mentions"; @@ -234,6 +235,7 @@ const QUEUED_MARKDOWN_COMPONENTS: Components = { thead: ({ children }) => {children}, tr: ({ children }) => {children} , ul: ({ children }) => {children}, + "bb-prompt-mention": PromptMentionElement, }; function CompactQueuedMarkdownPreview({ @@ -254,25 +256,24 @@ function CompactQueuedMarkdownPreview({ normalizePromptBlockquoteBoundaries(promptMentionSubstitution.content), [promptMentionSubstitution.content], ); - const components = useMemo( + const promptMentions = useMemo( () => ({ - ...QUEUED_MARKDOWN_COMPONENTS, - "bb-prompt-mention": buildPromptMentionComponent({ - mentions: promptMentionSubstitution.mentions, - resolveMentionLink, - }), + mentions: promptMentionSubstitution.mentions, + resolveMentionLink, }), [promptMentionSubstitution.mentions, resolveMentionLink], ); return ( - - {markdownContent} - + + + {markdownContent} + + ); } diff --git a/apps/app/src/components/thread/timeline/ConversationMessageContent.streaming.test.tsx b/apps/app/src/components/thread/timeline/ConversationMessageContent.streaming.test.tsx index 6ba563b541d..bccfce01d71 100644 --- a/apps/app/src/components/thread/timeline/ConversationMessageContent.streaming.test.tsx +++ b/apps/app/src/components/thread/timeline/ConversationMessageContent.streaming.test.tsx @@ -104,7 +104,8 @@ describe("ConversationMessageContent streaming split", () => { ]); expect(markdownRenders).toEqual([ "Para two.\n\n", - "Para three.\n\nPara four", + "Para three.\n\n", + "Para four", ]); markdownRenders.length = 0; diff --git a/apps/app/src/components/thread/timeline/TimelineWindowedItems.test.tsx b/apps/app/src/components/thread/timeline/TimelineWindowedItems.test.tsx index cbe4d585b7b..13ea6a19109 100644 --- a/apps/app/src/components/thread/timeline/TimelineWindowedItems.test.tsx +++ b/apps/app/src/components/thread/timeline/TimelineWindowedItems.test.tsx @@ -50,6 +50,7 @@ function setup({ bottomThresholdPx: 4, deferWritesWhileScrolling: false, getContentElement: () => content, + getFloorElement: () => null, getFooterElement: () => null, getScrollElement: () => (rootReady ? scrollElement : null), getTopLevelRows: () => diff --git a/apps/app/src/components/thread/timeline/useAutoLoadOlderRows.test.tsx b/apps/app/src/components/thread/timeline/useAutoLoadOlderRows.test.tsx index 9a38fac47d8..a2e94bf0419 100644 --- a/apps/app/src/components/thread/timeline/useAutoLoadOlderRows.test.tsx +++ b/apps/app/src/components/thread/timeline/useAutoLoadOlderRows.test.tsx @@ -15,6 +15,7 @@ function createBottomAnchor( bottomThresholdPx: 4, deferWritesWhileScrolling: false, getContentElement: () => null, + getFloorElement: () => null, getFooterElement: () => null, getScrollElement: () => scrollElement, getTopLevelRows: () => [], diff --git a/apps/app/src/components/thread/timeline/useStickyBottomScroll.ts b/apps/app/src/components/thread/timeline/useStickyBottomScroll.ts index bfb94d0a2f6..9e575e7a908 100644 --- a/apps/app/src/components/thread/timeline/useStickyBottomScroll.ts +++ b/apps/app/src/components/thread/timeline/useStickyBottomScroll.ts @@ -34,6 +34,7 @@ export function useStickyBottomScroll({ bottomThresholdPx: STICKY_BOTTOM_THRESHOLD_PX, deferWritesWhileScrolling: isIOSWebKit(navigator), getContentElement: () => contentRef.current, + getFloorElement: () => null, getFooterElement: () => null, getScrollElement: () => scrollRef.current, getTopLevelRows, diff --git a/apps/app/src/components/thread/timeline/useThreadTimelineController.test.tsx b/apps/app/src/components/thread/timeline/useThreadTimelineController.test.tsx index 91a96a3d119..d5fc27b0167 100644 --- a/apps/app/src/components/thread/timeline/useThreadTimelineController.test.tsx +++ b/apps/app/src/components/thread/timeline/useThreadTimelineController.test.tsx @@ -242,6 +242,7 @@ function installAutoLoadEnvironment() { bottomThresholdPx: 4, deferWritesWhileScrolling: false, getContentElement: () => null, + getFloorElement: () => null, getFooterElement: () => null, getScrollElement: () => scrollElement, getTopLevelRows: () => [], diff --git a/apps/app/src/components/ui/bottom-anchored-scroll-body.tsx b/apps/app/src/components/ui/bottom-anchored-scroll-body.tsx index 72637cc1c06..38d1ee31f0b 100644 --- a/apps/app/src/components/ui/bottom-anchored-scroll-body.tsx +++ b/apps/app/src/components/ui/bottom-anchored-scroll-body.tsx @@ -107,6 +107,7 @@ export function BottomAnchoredScrollBody({ const scrollContentRef = useRef(null); const pageContentRef = useRef(null); const scrollFooterRef = useRef(null); + const scrollFloorRef = useRef(null); const hasFooter = Boolean(footer); const scrollAnchorCaptureThrottleRef = useRef<{ lastWriteAt: number; @@ -131,6 +132,7 @@ export function BottomAnchoredScrollBody({ bottomThresholdPx: BOTTOM_ANCHOR_THRESHOLD_PX, deferWritesWhileScrolling: isIOSWebKit(navigator), getContentElement: () => pageContentRef.current, + getFloorElement: () => scrollFloorRef.current, getFooterElement: () => scrollFooterRef.current, getScrollElement: () => scrollAreaRef.current, getTopLevelRows, @@ -338,6 +340,11 @@ export function BottomAnchoredScrollBody({ ref={scrollContentRef} className="flex min-h-full min-w-0 flex-col" > +