@@ -3,6 +3,7 @@ import * as React from 'react';
33import type { SxProps } from '@mui/joy/styles/types' ;
44import { Chip } from '@mui/joy' ;
55import BrushRoundedIcon from '@mui/icons-material/BrushRounded' ;
6+ import HourglassEmptyIcon from '@mui/icons-material/HourglassEmpty' ;
67import SearchRoundedIcon from '@mui/icons-material/SearchRounded' ;
78
89import { BlocksContainer } from '~/modules/blocks/BlocksContainers' ;
@@ -12,6 +13,7 @@ import type { DMessageRole } from '~/common/stores/chat/chat.message';
1213import type { DVoidPlaceholderModelOp } from '~/common/stores/chat/chat.fragments' ;
1314import { adjustContentScaling , ContentScaling , themeScalingMap } from '~/common/app.theme' ;
1415import { DataStreamViz } from '~/common/components/DataStreamViz' ;
16+ import { animationSpinHalfPause } from '~/common/util/animUtils' ;
1517
1618
1719// configuration
@@ -21,6 +23,21 @@ const MODELOP_TIMEOUT_LIMIT = 300; // seconds
2123
2224
2325const _styles = {
26+ followUpChip : {
27+ px : 1.5 ,
28+ py : 0.375 ,
29+ my : '1px' , // to not crop the outline on mobile, or on beam
30+ outline : '1px solid' ,
31+ outlineColor : 'primary.solidBg' , // .outlinedBorder
32+ boxShadow : `1px 2px 4px -3px var(--joy-palette-primary-solidBg)` ,
33+ } as const ,
34+
35+ followUpChipIcon : {
36+ fontSize : '1rem' ,
37+ mr : 0.5 ,
38+ animation : `${ animationSpinHalfPause } 2s ease-in-out infinite` ,
39+ } as const ,
40+
2441 opChip : {
2542 maxWidth : '100%' , // fundamental for the ellipsize to work
2643 // width: '100%', // would have way less 'jumpy-ness'
@@ -92,6 +109,7 @@ function ModelOperationChip(props: {
92109
93110export function BlockPartPlaceholder ( props : {
94111 placeholderText : string ,
112+ placeholderType ?: 'chat-gen-follow-up' ,
95113 placeholderModelOp ?: DVoidPlaceholderModelOp ,
96114 messageRole : DMessageRole ,
97115 contentScaling : ContentScaling ,
@@ -122,6 +140,20 @@ export function BlockPartPlaceholder(props: {
122140 if ( shouldShowViz && showVisualization )
123141 return < DataStreamViz height = { 1 + 8 * 4 } /> ;
124142
143+
144+ // Type-based visualization
145+ if ( props . placeholderType === 'chat-gen-follow-up' ) return (
146+ < Chip
147+ color = 'primary'
148+ variant = 'soft'
149+ size = 'sm'
150+ sx = { _styles . followUpChip }
151+ startDecorator = { < HourglassEmptyIcon sx = { _styles . followUpChipIcon } /> }
152+ >
153+ { props . placeholderText }
154+ </ Chip >
155+ ) ;
156+
125157 // Model operation renderer
126158 if ( props . placeholderModelOp )
127159 return (
0 commit comments