Spaces:
Running
Running
Amir Mahla
commited on
Commit
·
02dbe84
1
Parent(s):
06d6317
FIX nit
Browse files
cua2-front/src/components/WelcomeScreen.tsx
CHANGED
|
@@ -347,7 +347,7 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = ({ onStartTask, isCon
|
|
| 347 |
<Paper
|
| 348 |
elevation={0}
|
| 349 |
sx={{
|
| 350 |
-
maxWidth: '
|
| 351 |
width: '100%',
|
| 352 |
p: 2.5,
|
| 353 |
border: '2px solid',
|
|
|
|
| 347 |
<Paper
|
| 348 |
elevation={0}
|
| 349 |
sx={{
|
| 350 |
+
maxWidth: '725px',
|
| 351 |
width: '100%',
|
| 352 |
p: 2.5,
|
| 353 |
border: '2px solid',
|
cua2-front/src/components/steps/StepCard.tsx
CHANGED
|
@@ -21,9 +21,15 @@ export const StepCard: React.FC<StepCardProps> = ({ step, index, isLatest = fals
|
|
| 21 |
const setSelectedStepIndex = useAgentStore((state) => state.setSelectedStepIndex);
|
| 22 |
const updateStepEvaluationInStore = useAgentStore((state) => state.updateStepEvaluation);
|
| 23 |
const [thoughtExpanded, setThoughtExpanded] = useState(false);
|
|
|
|
| 24 |
const [evaluation, setEvaluation] = useState<'like' | 'dislike' | 'neutral'>(step.step_evaluation || 'neutral');
|
| 25 |
const [isVoting, setIsVoting] = useState(false);
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
const handleClick = () => {
|
| 28 |
setSelectedStepIndex(index);
|
| 29 |
};
|
|
@@ -167,6 +173,33 @@ export const StepCard: React.FC<StepCardProps> = ({ step, index, isLatest = fals
|
|
| 167 |
>
|
| 168 |
Action
|
| 169 |
</Typography>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
</Box>
|
| 171 |
|
| 172 |
{/* Vote buttons */}
|
|
@@ -208,7 +241,7 @@ export const StepCard: React.FC<StepCardProps> = ({ step, index, isLatest = fals
|
|
| 208 |
</Box>
|
| 209 |
</Box>
|
| 210 |
<Box component="ul" sx={{ listStyle: 'none', p: 0, m: 0 }}>
|
| 211 |
-
{
|
| 212 |
<Box
|
| 213 |
key={actionIndex}
|
| 214 |
component="li"
|
|
|
|
| 21 |
const setSelectedStepIndex = useAgentStore((state) => state.setSelectedStepIndex);
|
| 22 |
const updateStepEvaluationInStore = useAgentStore((state) => state.updateStepEvaluation);
|
| 23 |
const [thoughtExpanded, setThoughtExpanded] = useState(false);
|
| 24 |
+
const [actionsExpanded, setActionsExpanded] = useState(false);
|
| 25 |
const [evaluation, setEvaluation] = useState<'like' | 'dislike' | 'neutral'>(step.step_evaluation || 'neutral');
|
| 26 |
const [isVoting, setIsVoting] = useState(false);
|
| 27 |
|
| 28 |
+
const hasMultipleActions = step.actions && step.actions.length > 1;
|
| 29 |
+
const displayedActions = hasMultipleActions && !actionsExpanded
|
| 30 |
+
? step.actions.slice(0, 1)
|
| 31 |
+
: step.actions;
|
| 32 |
+
|
| 33 |
const handleClick = () => {
|
| 34 |
setSelectedStepIndex(index);
|
| 35 |
};
|
|
|
|
| 173 |
>
|
| 174 |
Action
|
| 175 |
</Typography>
|
| 176 |
+
{hasMultipleActions && (
|
| 177 |
+
<Tooltip title={actionsExpanded ? 'Show less' : `Show all ${step.actions.length} actions`}>
|
| 178 |
+
<IconButton
|
| 179 |
+
size="small"
|
| 180 |
+
onClick={(e) => {
|
| 181 |
+
e.stopPropagation();
|
| 182 |
+
setActionsExpanded(!actionsExpanded);
|
| 183 |
+
}}
|
| 184 |
+
sx={{
|
| 185 |
+
padding: '2px',
|
| 186 |
+
color: 'text.secondary',
|
| 187 |
+
'&:hover': {
|
| 188 |
+
color: 'text.primary',
|
| 189 |
+
backgroundColor: 'action.hover',
|
| 190 |
+
},
|
| 191 |
+
}}
|
| 192 |
+
>
|
| 193 |
+
<ExpandMoreIcon
|
| 194 |
+
sx={{
|
| 195 |
+
fontSize: 16,
|
| 196 |
+
transform: actionsExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
| 197 |
+
transition: 'transform 0.2s',
|
| 198 |
+
}}
|
| 199 |
+
/>
|
| 200 |
+
</IconButton>
|
| 201 |
+
</Tooltip>
|
| 202 |
+
)}
|
| 203 |
</Box>
|
| 204 |
|
| 205 |
{/* Vote buttons */}
|
|
|
|
| 241 |
</Box>
|
| 242 |
</Box>
|
| 243 |
<Box component="ul" sx={{ listStyle: 'none', p: 0, m: 0 }}>
|
| 244 |
+
{displayedActions?.map((action, actionIndex) => (
|
| 245 |
<Box
|
| 246 |
key={actionIndex}
|
| 247 |
component="li"
|