From 4726e2acead44ef1d19ce7638b048fcf72bab0f6 Mon Sep 17 00:00:00 2001 From: David Kaya Date: Sun, 29 Mar 2026 21:43:58 +0200 Subject: [PATCH] feat: allow branching from both user and assistant messages - Relax branchSessionRecord validation to accept user or assistant roles - Show "Branch from here" hover button on all conversation messages - Contextual tooltip: "starting from this message" vs "continuing from this response" - Add test for branching from assistant message - Replace non-user rejection test with non-conversation rejection test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/renderer/components/ChatPane.tsx | 6 ++- src/shared/domain/sessionLibrary.ts | 4 +- tests/shared/sessionLibrary.test.ts | 60 +++++++++++++++++++++++++--- 3 files changed, 61 insertions(+), 9 deletions(-) diff --git a/src/renderer/components/ChatPane.tsx b/src/renderer/components/ChatPane.tsx index 40eeea1..c3dec7a 100644 --- a/src/renderer/components/ChatPane.tsx +++ b/src/renderer/components/ChatPane.tsx @@ -380,11 +380,13 @@ export function ChatPane({ {phaseLabel} )} - {isUser && onBranchFromMessage && ( + {onBranchFromMessage && (