= ({
wordBreak: "break-word",
overflowWrap: "anywhere",
}}>
- {highlightMentions(task.text)}
+ {highlightMentions(task.text, false)}
{!isTextExpanded && showSeeMore && (
= ({
)
}
-const highlightMentions = (text?: string) => {
- if (!text) return []
+export const highlightMentions = (text?: string, withShadow = true) => {
+ if (!text) return text
const parts = text.split(mentionRegexGlobal)
- return parts.reduce((acc, part, index) => {
+ return parts.map((part, index) => {
if (index % 2 === 0) {
// This is regular text
- acc.push(part)
+ return part
} else {
// This is a mention
- acc.push(
-
+ return (
+
@{part}
)
}
- return acc
- }, [] as (string | JSX.Element)[])
+ })
}
const ExportButton = () => (
diff --git a/webview-ui/src/index.css b/webview-ui/src/index.css
index 8ef8646..44aaa7d 100644
--- a/webview-ui/src/index.css
+++ b/webview-ui/src/index.css
@@ -146,7 +146,7 @@ vscode-dropdown::part(listbox) {
.mention-context-highlight {
background-color: var(--vscode-textLink-activeForeground, #3794ff);
opacity: 0.3;
- border-radius: 2px;
+ border-radius: 3px;
box-shadow: 0 0 0 0.5px var(--vscode-textLink-activeForeground, #3794ff);
color: transparent;
padding: 0.5px;
@@ -154,3 +154,14 @@ vscode-dropdown::part(listbox) {
position: relative;
bottom: -0.5px;
}
+
+.mention-context-highlight-visible-with-shadow {
+ background-color: color-mix(in srgb, var(--vscode-badge-foreground) 35%, transparent);
+ border-radius: 3px;
+ box-shadow: 0 0 0 0.5px color-mix(in srgb, var(--vscode-badge-foreground) 35%, transparent);
+}
+
+.mention-context-highlight-visible-without-shadow {
+ background-color: color-mix(in srgb, var(--vscode-badge-foreground) 35%, transparent);
+ border-radius: 3px;
+}