Skip to content

Commit 50d1837

Browse files
authored
fix: properly handle mode name overflow (#3328)
1 parent 3acb601 commit 50d1837

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

webview-ui/src/components/prompts/PromptsView.tsx

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,30 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
571571
}}
572572
data-testid={`mode-option-${modeConfig.slug}`}>
573573
<div className="flex items-center justify-between w-full">
574-
<span>{modeConfig.name}</span>
575-
<span className="text-foreground">{modeConfig.slug}</span>
574+
<span
575+
style={{
576+
whiteSpace: "nowrap",
577+
overflow: "hidden",
578+
textOverflow: "ellipsis",
579+
flex: 2,
580+
minWidth: 0,
581+
}}>
582+
{modeConfig.name}
583+
</span>
584+
<span
585+
className="text-foreground"
586+
style={{
587+
whiteSpace: "nowrap",
588+
overflow: "hidden",
589+
textOverflow: "ellipsis",
590+
direction: "rtl",
591+
textAlign: "right",
592+
flex: 1,
593+
minWidth: 0,
594+
marginLeft: "0.5em",
595+
}}>
596+
{modeConfig.slug}
597+
</span>
576598
</div>
577599
</CommandItem>
578600
))}

0 commit comments

Comments
 (0)