fix: move slash suggestion highlight with selection

This commit is contained in:
Vasanthdev2004
2026-04-02 18:25:52 +05:30
parent 5ccda35941
commit 118b0793e0

View File

@@ -62,6 +62,9 @@ const SuggestionItemRow = memo(function SuggestionItemRow({
if (isUnifiedSuggestion(item.id)) { if (isUnifiedSuggestion(item.id)) {
const icon = getIcon(item.id) const icon = getIcon(item.id)
const textColor: keyof Theme | undefined = isSelected const textColor: keyof Theme | undefined = isSelected
? 'inverseText'
: undefined
const backgroundColor: keyof Theme | undefined = isSelected
? 'suggestion' ? 'suggestion'
: undefined : undefined
const dimColor = !isSelected const dimColor = !isSelected
@@ -112,6 +115,7 @@ const SuggestionItemRow = memo(function SuggestionItemRow({
return ( return (
<Text <Text
color={textColor} color={textColor}
backgroundColor={backgroundColor}
dimColor={dimColor} dimColor={dimColor}
bold={isSelected} bold={isSelected}
wrap="truncate" wrap="truncate"
@@ -126,7 +130,10 @@ const SuggestionItemRow = memo(function SuggestionItemRow({
maxColumnWidth ?? stringWidth(item.displayText) + 5, maxColumnWidth ?? stringWidth(item.displayText) + 5,
maxNameWidth, maxNameWidth,
) )
const textColor = item.color || (isSelected ? 'suggestion' : undefined) const textColor = isSelected ? 'inverseText' : item.color
const backgroundColor: keyof Theme | undefined = isSelected
? 'suggestion'
: undefined
const shouldDim = !isSelected const shouldDim = !isSelected
let displayText = item.displayText let displayText = item.displayText
@@ -150,11 +157,28 @@ const SuggestionItemRow = memo(function SuggestionItemRow({
return ( return (
<Text wrap="truncate"> <Text wrap="truncate">
<Text color={textColor} dimColor={shouldDim} bold={isSelected}> <Text
color={textColor}
backgroundColor={backgroundColor}
dimColor={shouldDim}
bold={isSelected}
>
{paddedDisplayText} {paddedDisplayText}
</Text> </Text>
{tagText ? <Text dimColor>{tagText}</Text> : null} {tagText ? (
<Text color={isSelected ? 'suggestion' : undefined} dimColor={!isSelected}> <Text
color={isSelected ? 'inverseText' : undefined}
backgroundColor={backgroundColor}
dimColor={!isSelected}
>
{tagText}
</Text>
) : null}
<Text
color={isSelected ? 'inverseText' : undefined}
backgroundColor={backgroundColor}
dimColor={!isSelected}
>
{truncatedDescription} {truncatedDescription}
</Text> </Text>
</Text> </Text>