From c8a7123da9a2e52135094a00eff6bab96cf237e5 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Mon, 11 Mar 2024 23:13:20 -0700 Subject: [PATCH] Beam: fix styles --- src/common/beam/BeamRay.tsx | 2 +- src/common/beam/BeamView.tsx | 4 ++-- src/common/beam/store-beam.ts | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/common/beam/BeamRay.tsx b/src/common/beam/BeamRay.tsx index c01fa4365..9bbe2bee4 100644 --- a/src/common/beam/BeamRay.tsx +++ b/src/common/beam/BeamRay.tsx @@ -193,7 +193,7 @@ export function BeamRay(props: { /> {/* Ray Message */} - {(!!ray?.message?.text || !!ray?.message?.updated) && ( + {(!!ray?.message?.text || ray?.status === 'scattering') && ( { return (otherHistoryCount >= 1) ? ( - - {otherHistoryCount === 1 ? (isFirstMessageSystem ? '1 system message' : '1 message') : `${otherHistoryCount} messages`} above + + {otherHistoryCount === 1 ? (isFirstMessageSystem ? '1 system message' : '1 message') : `${otherHistoryCount} messages`} before ) : null; }, [isFirstMessageSystem, otherHistoryCount]); diff --git a/src/common/beam/store-beam.ts b/src/common/beam/store-beam.ts index 8662dfd32..9d38d2cc6 100644 --- a/src/common/beam/store-beam.ts +++ b/src/common/beam/store-beam.ts @@ -62,7 +62,8 @@ function rayScatterStart(ray: DRay, onlyIdle: boolean, beamStore: BeamStore): DR message: { ...ray.message, ...update, - updated: Date.now(), + // only update the timestamp when the text changes + ...(update.text ? { updated: Date.now() } : {}), }, })); @@ -91,7 +92,8 @@ function rayScatterStart(ray: DRay, onlyIdle: boolean, beamStore: BeamStore): DR message: { ...ray.message, text: PLACEHOLDER_SCATTER_TEXT, - updated: Date.now(), + created: Date.now(), + updated: null, }, scatterLlmId: rayLlmId, scatterIssue: undefined,