Skip to content

Commit a04a412

Browse files
authored
Merge pull request #232 from beNative/codex/add-left-border-with-padding-on-snippet-containers
Add subtle accent bars to snippet containers
2 parents 17d29e1 + 49d0a77 commit a04a412

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

components/FolderOverview.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ 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/70">
363+
<p
364+
className="mt-0.5 -ml-2 border-l border-primary/30 pl-2 text-[11px] leading-snug text-text-secondary"
365+
>
364366
{highlightMatches(result.searchSnippet, folderSearchTerm)}
365367
</p>
366368
)}

components/PromptTreeItem.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ 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 snippetMarginLeft = Math.max(snippetPaddingLeft - snippetAccentPadding, 0);
355357

356358
return (
357359
<li
@@ -512,8 +514,11 @@ const DocumentTreeItem: React.FC<DocumentTreeItemProps> = (props) => {
512514

513515
{!isFolder && searchTerm.trim() && node.searchSnippet && (
514516
<div
515-
className="text-[11px] text-text-secondary/70 leading-snug whitespace-pre-wrap break-words pr-3"
516-
style={{ paddingLeft: `${snippetPaddingLeft}px` }}
517+
className="text-[11px] text-text-secondary leading-snug whitespace-pre-wrap break-words pr-3 border-l border-primary/30"
518+
style={{
519+
marginLeft: `${snippetMarginLeft}px`,
520+
paddingLeft: `${snippetAccentPadding}px`,
521+
}}
517522
>
518523
{highlightMatches(node.searchSnippet, searchTerm)}
519524
</div>

0 commit comments

Comments
 (0)