diff --git a/src/apps/beam/AppBeam.tsx b/src/apps/beam/AppBeam.tsx
index d579c0c94..c9e0aa4a4 100644
--- a/src/apps/beam/AppBeam.tsx
+++ b/src/apps/beam/AppBeam.tsx
@@ -22,7 +22,7 @@ function initTestConversation(): DConversation {
}
function initTestBeamStore(messages: DMessage[], beamStore: BeamStoreApi = createBeamVanillaStore()): BeamStoreApi {
- beamStore.getState().open(messages, getChatLLMId(), (content) => alert(content));
+ beamStore.getState().open(messages, getChatLLMId(), false, (content) => alert(content));
return beamStore;
}
diff --git a/src/apps/chat/components/layout-bar/ChatBarAltBeam.tsx b/src/apps/chat/components/layout-bar/ChatBarAltBeam.tsx
index 0e20c2539..309e87432 100644
--- a/src/apps/chat/components/layout-bar/ChatBarAltBeam.tsx
+++ b/src/apps/chat/components/layout-bar/ChatBarAltBeam.tsx
@@ -24,8 +24,9 @@ export function ChatBarAltBeam(props: {
// external beam state
- const { isScattering, isGatheringAny, requiresConfirmation, setIsMaximized, terminateBeam } = useBeamStore(props.beamStore, useShallow((store) => ({
+ const { isEditMode, isScattering, isGatheringAny, requiresConfirmation, setIsMaximized, terminateBeam } = useBeamStore(props.beamStore, useShallow((store) => ({
// state
+ isEditMode: store.isEditMode,
isScattering: store.isScattering,
isGatheringAny: store.isGatheringAny,
requiresConfirmation: store.isScattering || store.isGatheringAny || store.raysReady > 0,
@@ -76,9 +77,9 @@ export function ChatBarAltBeam(props: {
: isScattering ? { animation: `${animationColorBeamScatterINV} 5s infinite, ${animationEnterBelow} 0.6s` }
: { fontWeight: 'lg' }
}>
- {isGatheringAny ? 'Merging...' : isScattering ? 'Beaming...' : 'Beam'}
+ {isGatheringAny ? 'Merging...' : isScattering ? 'Beaming...' : isEditMode ? 'Beam Edit' : 'Beam'}
- {(!isGatheringAny && !isScattering) && ' Mode'}
+ {(!isGatheringAny && !isScattering && !isEditMode) && ' Mode'}
{/* Right Close Icon */}
diff --git a/src/apps/chat/components/message/ChatMessage.tsx b/src/apps/chat/components/message/ChatMessage.tsx
index 9a5ac6638..bbc08a50c 100644
--- a/src/apps/chat/components/message/ChatMessage.tsx
+++ b/src/apps/chat/components/message/ChatMessage.tsx
@@ -925,7 +925,7 @@ export function ChatMessage(props: {
? <>Beam from here>
: !props.isBottom
? <>Beam this message>
- : Beam}
+ : Beam Edit}
)}
diff --git a/src/common/chat-overlay/ConversationHandler.ts b/src/common/chat-overlay/ConversationHandler.ts
index b49bf2012..403e43072 100644
--- a/src/common/chat-overlay/ConversationHandler.ts
+++ b/src/common/chat-overlay/ConversationHandler.ts
@@ -234,7 +234,7 @@ export class ConversationHandler {
terminateKeepingSettings();
};
- beamOpen(viewHistory, getChatLLMId(), onBeamSuccess);
+ beamOpen(viewHistory, getChatLLMId(), !!destReplaceMessageId, onBeamSuccess);
importMessages.length && beamImportRays(importMessages, getChatLLMId());
}
diff --git a/src/modules/beam/store-beam-vanilla.ts b/src/modules/beam/store-beam-vanilla.ts
index 05252ce44..462d75097 100644
--- a/src/modules/beam/store-beam-vanilla.ts
+++ b/src/modules/beam/store-beam-vanilla.ts
@@ -32,6 +32,7 @@ type BeamSuccessCallback = (messageUpdate: Pick ({
isOpen: false,
+ isEditMode: false,
isMaximized: false,
inputHistory: null,
inputIssues: null,
@@ -54,7 +56,7 @@ const initRootStateSlice = (): RootStateSlice => ({
export interface RootStoreSlice extends RootStateSlice {
// lifecycle
- open: (chatHistory: Readonly, initialChatLlmId: DLLMId | null, callback: BeamSuccessCallback) => void;
+ open: (chatHistory: Readonly, initialChatLlmId: DLLMId | null, isEditMode: boolean, callback: BeamSuccessCallback) => void;
terminateKeepingSettings: () => void;
loadBeamConfig: (preset: BeamConfigSnapshot | null) => void;
@@ -70,7 +72,7 @@ const createRootSlice: StateCreator = (_set,
...initRootStateSlice(),
- open: (chatHistory: Readonly, initialChatLlmId: DLLMId | null, callback: BeamSuccessCallback) => {
+ open: (chatHistory: Readonly, initialChatLlmId: DLLMId | null, isEditMode: boolean, callback: BeamSuccessCallback) => {
const { isOpen: wasAlreadyOpen, terminateKeepingSettings, loadBeamConfig, hadImportedRays, setRayLlmIds, setCurrentGatherLlmId } = _get();
// reset pending operations
@@ -84,6 +86,7 @@ const createRootSlice: StateCreator = (_set,
_set({
// input
isOpen: true,
+ isEditMode,
inputHistory: isValidHistory ? history : null,
inputIssues: isValidHistory ? null : 'Invalid conversation history: missing user message',
inputReady: isValidHistory,