diff --git a/src/common/beam/BeamPaneGather.tsx b/src/common/beam/BeamPaneGather.tsx index abfb757ea..145645bf5 100644 --- a/src/common/beam/BeamPaneGather.tsx +++ b/src/common/beam/BeamPaneGather.tsx @@ -1,13 +1,18 @@ import * as React from 'react'; import type { SxProps } from '@mui/joy/styles/types'; -import { Box, Button, ButtonGroup, FormControl, Radio, RadioGroup, Typography } from '@mui/joy'; +import { Box, Button, ButtonGroup, FormControl, Typography } from '@mui/joy'; +import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome'; import AutoAwesomeOutlinedIcon from '@mui/icons-material/AutoAwesomeOutlined'; import AutoAwesomeRoundedIcon from '@mui/icons-material/AutoAwesomeRounded'; +import MergeRoundedIcon from '@mui/icons-material/MergeRounded'; +import StopRoundedIcon from '@mui/icons-material/StopRounded'; import { FormLabelStart } from '~/common/components/forms/FormLabelStart'; import { ScrollToBottomButton } from '~/common/scroll-to-bottom/ScrollToBottomButton'; +import { animationColorBeamScatter } from '~/common/util/animUtils'; +import { BEAM_GATHER_COLOR } from './beam.config'; import { beamControlsSx } from './BeamPaneScatter'; @@ -20,16 +25,20 @@ const beamGatherControlsSx: SxProps = { // layout display: 'flex', + flexWrap: 'wrap', alignItems: 'center', - // display: 'grid', - // gridTemplateColumns: 'repeat(auto-fit, minmax(max(200px, 100%/4), 1fr))', - // gridAutoFlow: 'row dense', - gap: 'var(--Pad_2)', + justifyContent: 'space-between', + columnGap: 'var(--Pad_2)', + rowGap: 'var(--Pad)', + py: 'calc(2 * var(--Pad) / 3)', }; const desktopBeamControlsSx: SxProps = { ...beamGatherControlsSx, + // undo the larger mobile padding + rowGap: 'var(--Pad_2)', + // the fact that this works, means we got the CSS and layout right position: 'sticky', bottom: 0, @@ -51,67 +60,89 @@ export function BeamPaneGather(props: { return ( + {/* Title */} - - {/**/} - {/* */} - {/**/} +
- Merge + {gatherBusy + ? + : } Merge - - + Combine the {gatherCount > 1 ? `${gatherCount} replies` : 'replies'}
- - - +
- {/* LLM cell */} - + {/* Method */} + + Method} sx={{ mb: '0.25rem' /* orig: 6px */ }} /> + + {['Guided', 'Fusion'].map((n, idx) => { + const isActive = idx === 0; //fasn === props.rayCount; + return ( + + ); + })} + + + + {/* Method (Radio)*/} + {/**/} + {/* Method} sx={{ mb: '0.25rem' /* orig: 6px } />*!/*/} + {/* */} + {/* */} + {/* Fusion} />*/} + {/* /!*}>Chooose} />*!/*/} + {/* /!*}>Improve} />*!/*/} + {/* /!*}>Fuse} />*!/*/} + {/* /!**!/*/} + {/* */} + {/**/} + + {/* LLM */} + {props.mergeLlmComponent} - {/* Algo */} - {false && - {!props.isMobile && } - - - - - - } - - {/*{gatherEnabled && (*/} - {/* // */} - {/* // */} - - }>Chooose} /> - {/*}>Improve} />*/} - }>Fuse} /> - - - {/*// */} - {/*)}*/} - - + {/* Start / Stop buttons */} + {!gatherBusy ? ( + + ) : ( + + )} ); diff --git a/src/common/beam/BeamPaneScatter.tsx b/src/common/beam/BeamPaneScatter.tsx index 0c21f6624..e895105ef 100644 --- a/src/common/beam/BeamPaneScatter.tsx +++ b/src/common/beam/BeamPaneScatter.tsx @@ -58,8 +58,8 @@ export function BeamPaneScatter(props: { return ( - {/* Title Cell */} - + {/* Title */} + - {/* Count and Start cell */} + {/* Ray presets */} diff --git a/src/common/beam/BeamView.tsx b/src/common/beam/BeamView.tsx index 33885112c..88ec026e2 100644 --- a/src/common/beam/BeamView.tsx +++ b/src/common/beam/BeamView.tsx @@ -23,6 +23,11 @@ const userMessageContainerSx: SxProps = { pt: 'var(--Pad)', px: 'var(--Pad)', mb: 'calc(-1 * var(--Pad))', + + // sticky user message, only displaced by the scatter controls + // NOTE: disabled: should feel good but feels weird + // position: 'sticky', + // top: 0, }; const userMessageContainerInvertedSx: SxProps = { @@ -92,7 +97,7 @@ export function BeamView(props: { isGathering: state.isGathering, }))); const { editInputHistoryMessage, setRayCount, startScatteringAll, stopScatteringAll, setMergeLlmId, terminate } = props.beamStore.getState(); - const [_, mergeLlmComponent] = useLLMSelect(mergeLlmId, setMergeLlmId, props.isMobile ? '' : 'Merge Model'); + const [_, mergeLlmComponent] = useLLMSelect(mergeLlmId, setMergeLlmId, props.isMobile ? '' : 'Merge Model', true); // configuration diff --git a/src/common/beam/beam.config.ts b/src/common/beam/beam.config.ts index 18c056daf..06a17cf96 100644 --- a/src/common/beam/beam.config.ts +++ b/src/common/beam/beam.config.ts @@ -14,5 +14,6 @@ export const GATHER_PLACEHOLDER = '📦 ...'; // BEAM graphics export const BEAM_SCATTER_COLOR = 'neutral' as const; +export const BEAM_GATHER_COLOR= 'success' as const; export const BEAM_INVERT_USER_MESSAGE = true; export const SCATTER_RAY_SHOW_DRAG_HANDLE = false; diff --git a/src/common/components/forms/useLLMSelect.tsx b/src/common/components/forms/useLLMSelect.tsx index 8ea2820a8..3ff065dd6 100644 --- a/src/common/components/forms/useLLMSelect.tsx +++ b/src/common/components/forms/useLLMSelect.tsx @@ -106,7 +106,7 @@ export function useLLMSelect( // Memo the Select component const llmSelectComponent = React.useMemo(() => ( - {!!label && } + {!!label && } {/**/}