From c204232609ab0ebdbfe55f4b4711e04652de3fd9 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 17 Nov 2026 12:33:04 +0100 Subject: [PATCH] feat: pin the current turn's user message at the top of session chat (#12468) * feat: pin the current turn's user message at the top of session chat Co-Authored-By: Claude Opus 5.5 * perf: find each pinned bubble beside its sticky copy instead of across the transcript Co-Authored-By: Claude Opus 5.5 * fix: keep an edited message's turn measured and iterate stickies as an array Co-Authored-By: Claude Opus 5.5 * fix: keep a user message pinned while it is being edited Co-Authored-By: Claude Opus 5.5 * fix: pin an edited first message only once scrolled, keep edits on pinned click, unpin pushed-out copies Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Ruben Fiszel --- .../lib/components/copilot/chat/AIChat.svelte | 3 + .../copilot/chat/AIChatDisplay.svelte | 172 ++++++++++++++---- .../copilot/chat/AIChatInput.svelte | 9 + .../copilot/chat/AIChatMessage.svelte | 1 + .../components/sessions/SessionWrapper.svelte | 1 + 5 files changed, 154 insertions(+), 32 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/AIChat.svelte b/frontend/src/lib/components/copilot/chat/AIChat.svelte index d59254f02f..cf5068b598 100644 --- a/frontend/src/lib/components/copilot/chat/AIChat.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChat.svelte @@ -17,6 +17,7 @@ forceDisabled = false, forceDisabledMessage = '', wideLayout = false, + stickyUserMessage = false, emptyHint, starter = undefined, onSent = undefined, @@ -40,6 +41,7 @@ // columns are centered in a max-w-3xl px-8 box. Sessions opt // in; the narrow global-chat panel leaves it off. wideLayout?: boolean + stickyUserMessage?: boolean emptyHint?: import('svelte').Snippet starter?: import('./starter/starterPrompts.svelte').ChatStarter onSent?: () => void @@ -212,6 +214,7 @@ {hideHeader} {hideModeSelector} {wideLayout} + {stickyUserMessage} {emptyHint} {starter} {onSent} diff --git a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte index b9ad55f215..5da330d20d 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/AIChatDisplay.svelte @@ -1,6 +1,8 @@