From aebc45f705dd8bc6cdfe84bf50d94cfb8482c3ca Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Thu, 21 Mar 2024 19:58:22 -0700 Subject: [PATCH] Beam: Gather: messaging & lime --- src/common/beam/gather/BeamGatherPane.tsx | 29 ++++++++++++++++----- src/common/beam/scatter/BeamScatterPane.tsx | 3 ++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/common/beam/gather/BeamGatherPane.tsx b/src/common/beam/gather/BeamGatherPane.tsx index 0b6faefcb..832175690 100644 --- a/src/common/beam/gather/BeamGatherPane.tsx +++ b/src/common/beam/gather/BeamGatherPane.tsx @@ -14,7 +14,7 @@ import { ConfirmationModal } from '~/common/components/ConfirmationModal'; import { FormLabelStart } from '~/common/components/forms/FormLabelStart'; import { GoodTooltip } from '~/common/components/GoodTooltip'; import { ScrollToBottomButton } from '~/common/scroll-to-bottom/ScrollToBottomButton'; -import { animationColorBeamGather } from '~/common/util/animUtils'; +import { animationColorBeamGather, animationShadowLimey } from '~/common/util/animUtils'; import { useScrollToBottom } from '~/common/scroll-to-bottom/useScrollToBottom'; import { FUSION_FACTORIES } from './beam.gather.factories'; @@ -22,6 +22,11 @@ import { GATHER_COLOR } from '../beam.config'; import { beamPaneSx } from '../BeamCard'; +export const gatherPaneClasses = { + active: 'gatherPane-Active', + busy: 'gatherPane-Busy', +}; + const mobileBeamGatherPane: SxProps = { ...beamPaneSx, borderTop: '1px solid', @@ -36,7 +41,14 @@ const desktopBeamGatherPaneSx: SxProps = { borderTop: '1px solid', borderTopColor: 'neutral.outlinedBorder', - boxShadow: `0px 6px 16px -12px rgb(var(--joy-palette-${GATHER_COLOR}-darkChannel) / 50%)`, + backgroundColor: 'background.surface', + [`&.${gatherPaneClasses.active}`]: { + backgroundColor: 'background.popup', + boxShadow: `0px 6px 16px -12px rgb(var(--joy-palette-${GATHER_COLOR}-darkChannel) / 50%)`, + }, + [`&.${gatherPaneClasses.busy}`]: { + animation: `${animationShadowLimey} 2s linear infinite`, + }, // [desktop] keep visible at the bottom position: 'sticky', @@ -89,7 +101,9 @@ export function BeamGatherPane(props: { // derived state const { gatherCount, gatherBusy } = props; - const gatherEnabled = gatherCount >= 2 && !gatherBusy && currentFusionId !== null; + const hasInputs = gatherCount >= 2; + + const gatherEnabled = hasInputs && !gatherBusy && currentFusionId !== null; // const currentFusion = currentFusionId !== null ? fusions.find(fusion => fusion.fusionId === currentFusionId) ?? null : null; @@ -140,8 +154,10 @@ export function BeamGatherPane(props: { const MainLlmIcon = props.gatherLlmIcon || (gatherBusy ? AutoAwesomeIcon : AutoAwesomeOutlinedIcon); return <> - - + {/* Title */} @@ -154,7 +170,8 @@ export function BeamGatherPane(props: {  Merge - Combine the {gatherCount > 1 ? `${gatherCount} replies` : 'replies'} + {/* may merge or not (hasInputs) N replies.. put this in pretty messages */} + {hasInputs ? `Combine the ${gatherCount} replies` : 'Two replies or more'} diff --git a/src/common/beam/scatter/BeamScatterPane.tsx b/src/common/beam/scatter/BeamScatterPane.tsx index 318e0e418..601cde864 100644 --- a/src/common/beam/scatter/BeamScatterPane.tsx +++ b/src/common/beam/scatter/BeamScatterPane.tsx @@ -55,7 +55,8 @@ export function BeamScatterPane(props: { : } Beam - Explore the solution space + Explore different replies + {/* Explore the solution space */}