Skip to content

Commit 8f7eb06

Browse files
committed
Use theme background for snippets
1 parent 6887250 commit 8f7eb06

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

components/FolderOverview.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,17 @@ const FolderOverview: React.FC<FolderOverviewProps> = ({
360360
{highlightMatches(formattedTitle, folderSearchTerm)}
361361
</p>
362362
{result.searchSnippet && (
363-
<p className="mt-0.5 text-[11px] leading-snug text-text-secondary">
363+
<p
364+
className="mt-0.5 -ml-2 text-[11px] leading-snug text-text-secondary"
365+
style={{
366+
paddingLeft: '0.75rem',
367+
borderLeftWidth: '3px',
368+
borderLeftStyle: 'solid',
369+
borderLeftColor: 'rgb(var(--color-accent) / 0.45)',
370+
background: 'color-mix(in srgb, rgb(var(--color-background)) 82%, rgb(var(--color-text-main)) 18%)',
371+
borderRadius: '4px',
372+
}}
373+
>
364374
{highlightMatches(result.searchSnippet, folderSearchTerm)}
365375
</p>
366376
)}

components/PromptTreeItem.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ const DocumentTreeItem: React.FC<DocumentTreeItemProps> = (props) => {
352352
const basePaddingLeft = 4; // matches Tailwind px-1 for consistent baseline spacing
353353
const rowPaddingLeft = basePaddingLeft + Math.max(level, 0) * safeIndent;
354354
const snippetPaddingLeft = rowPaddingLeft + 28;
355+
const snippetAccentPadding = 8;
356+
const snippetAccentWidth = 3;
357+
const snippetMarginLeft = Math.max(snippetPaddingLeft - snippetAccentPadding, 0);
358+
const snippetAccentColor = 'rgb(var(--color-accent) / 0.45)';
359+
const snippetBackgroundColor =
360+
'color-mix(in srgb, rgb(var(--color-background)) 82%, rgb(var(--color-text-main)) 18%)';
355361

356362
return (
357363
<li
@@ -513,7 +519,15 @@ const DocumentTreeItem: React.FC<DocumentTreeItemProps> = (props) => {
513519
{!isFolder && searchTerm.trim() && node.searchSnippet && (
514520
<div
515521
className="text-[11px] text-text-secondary leading-snug whitespace-pre-wrap break-words pr-3"
516-
style={{ paddingLeft: `${snippetPaddingLeft}px` }}
522+
style={{
523+
marginLeft: `${snippetMarginLeft}px`,
524+
paddingLeft: `${snippetAccentPadding}px`,
525+
borderLeftWidth: `${snippetAccentWidth}px`,
526+
borderLeftStyle: 'solid',
527+
borderLeftColor: snippetAccentColor,
528+
backgroundColor: snippetBackgroundColor,
529+
borderRadius: '4px',
530+
}}
517531
>
518532
{highlightMatches(node.searchSnippet, searchTerm)}
519533
</div>

0 commit comments

Comments
 (0)