fix: properly handle mode name overflow (#3328)

This commit is contained in:
Dicha Zelianivan Arkana 2025-05-08 22:44:20 +07:00 committed by hannesrudolph
parent 8ed974e9be
commit 9c249494d5

View file

@ -571,8 +571,30 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
}}
data-testid={`mode-option-${modeConfig.slug}`}>
<div className="flex items-center justify-between w-full">
<span>{modeConfig.name}</span>
<span className="text-foreground">{modeConfig.slug}</span>
<span
style={{
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
flex: 2,
minWidth: 0,
}}>
{modeConfig.name}
</span>
<span
className="text-foreground"
style={{
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
direction: "rtl",
textAlign: "right",
flex: 1,
minWidth: 0,
marginLeft: "0.5em",
}}>
{modeConfig.slug}
</span>
</div>
</CommandItem>
))}