Skip to content

Commit caffdbd

Browse files
groksrcclaude
andcommitted
Fix search overlay, callout colors, and implement tabbed interface
- Remove hashtag bullets and double search icon from search overlay - Fix search input border visibility with explicit HSL colors - Left align search results and meta text - Remove hover effects and bottom borders from search results - Add breadcrumb separator (›) between page and section names - Color callout text to match old site (blue for info, golden for warnings, etc.) - Fix syntax errors in user-guide.mdx by closing code blocks - Add text wrapping to code blocks to prevent copy button collision - Add proper margins to Steps components and h4 headings - Remove underlines from Card component links - Fix CodeGroup component black box issue with light/dark mode support - Implement interactive tabbed interface for System Architecture section - Add Pagefind search integration with custom styling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2c63574 commit caffdbd

18 files changed

+744
-125
lines changed

astro.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { defineConfig } from 'astro/config';
33

44
import mdx from '@astrojs/mdx';
55
import react from '@astrojs/react';
6+
import pagefind from 'astro-pagefind';
67

78
// https://astro.build/config
89
export default defineConfig({
9-
integrations: [mdx(), react()],
10+
integrations: [mdx(), react(), pagefind()],
1011
markdown: {
1112
syntaxHighlight: 'shiki',
1213
shikiConfig: {

package-lock.json

Lines changed: 131 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@types/react": "^19.1.8",
1515
"@types/react-dom": "^19.1.6",
1616
"astro": "^5.11.0",
17+
"astro-pagefind": "^1.8.3",
1718
"clsx": "^2.1.1",
1819
"lucide-react": "^0.525.0",
1920
"react": "^19.1.0",

src/components/Callout.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@ const calloutStyles = {
1111
info: {
1212
container: 'border-blue-200 bg-blue-50 dark:border-blue-900 dark:bg-blue-950/20',
1313
icon: 'text-blue-600 dark:text-blue-400',
14-
title: 'text-blue-900 dark:text-blue-300'
14+
title: 'text-blue-900 dark:text-blue-300',
15+
content: '!text-blue-600 dark:!text-blue-400 [&_p]:!text-blue-600 dark:[&_p]:!text-blue-400 [&_li]:!text-blue-600 dark:[&_li]:!text-blue-400 [&_strong]:!text-blue-700 dark:[&_strong]:!text-blue-300 [&_code]:!text-blue-700 dark:[&_code]:!text-blue-300'
1516
},
1617
warning: {
1718
container: 'border-yellow-200 bg-yellow-50 dark:border-yellow-900 dark:bg-yellow-950/20',
1819
icon: 'text-yellow-600 dark:text-yellow-400',
19-
title: 'text-yellow-900 dark:text-yellow-300'
20+
title: 'text-yellow-900 dark:text-yellow-300',
21+
content: '!text-yellow-600 dark:!text-yellow-400 [&_p]:!text-yellow-600 dark:[&_p]:!text-yellow-400 [&_li]:!text-yellow-600 dark:[&_li]:!text-yellow-400 [&_strong]:!text-yellow-700 dark:[&_strong]:!text-yellow-300 [&_code]:!text-yellow-700 dark:[&_code]:!text-yellow-300'
2022
},
2123
note: {
2224
container: 'border-gray-200 bg-gray-50 dark:border-gray-800 dark:bg-gray-950/20',
2325
icon: 'text-gray-600 dark:text-gray-400',
24-
title: 'text-gray-900 dark:text-gray-300'
26+
title: 'text-gray-900 dark:text-gray-300',
27+
content: '!text-gray-600 dark:!text-gray-400 [&_p]:!text-gray-600 dark:[&_p]:!text-gray-400 [&_li]:!text-gray-600 dark:[&_li]:!text-gray-400 [&_strong]:!text-gray-700 dark:[&_strong]:!text-gray-300 [&_code]:!text-gray-700 dark:[&_code]:!text-gray-300'
2528
},
2629
tip: {
2730
container: 'border-green-200 bg-green-50 dark:border-green-900 dark:bg-green-950/20',
2831
icon: 'text-green-600 dark:text-green-400',
29-
title: 'text-green-900 dark:text-green-300'
32+
title: 'text-green-900 dark:text-green-300',
33+
content: '!text-green-600 dark:!text-green-400 [&_p]:!text-green-600 dark:[&_p]:!text-green-400 [&_li]:!text-green-600 dark:[&_li]:!text-green-400 [&_strong]:!text-green-700 dark:[&_strong]:!text-green-300 [&_code]:!text-green-700 dark:[&_code]:!text-green-300'
3034
}
3135
}
3236

@@ -81,7 +85,7 @@ export default function Callout({ children, type = 'note', title, className }: C
8185
{title || defaultTitle}
8286
</div>
8387
)}
84-
<div className="text-sm [&>*:first-child]:mt-0 [&>*:last-child]:mb-0">
88+
<div className={cn("text-sm [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", styles.content)}>
8589
{children}
8690
</div>
8791
</div>

src/components/CodeGroup.tsx

Lines changed: 53 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { useState } from 'react'
1+
import React, { useState } from 'react'
22
import { cn } from '@/lib/utils'
33

4-
interface CodeTab {
4+
interface CodeTabProps {
55
label: string
6-
value: string
6+
value?: string
77
language?: string
88
children: React.ReactNode
99
}
@@ -13,48 +13,63 @@ interface CodeGroupProps {
1313
className?: string
1414
}
1515

16+
export function CodeTab({ children }: CodeTabProps) {
17+
return <>{children}</>
18+
}
19+
1620
export default function CodeGroup({ children, className }: CodeGroupProps) {
1721
const [activeTab, setActiveTab] = useState(0)
22+
const childArray = React.Children.toArray(children)
23+
24+
// Extract labels from CodeTab components
25+
const tabs: { label: string; content: React.ReactNode }[] = []
26+
27+
childArray.forEach(child => {
28+
if (React.isValidElement(child) && child.props.label) {
29+
tabs.push({
30+
label: child.props.label,
31+
content: child.props.children
32+
})
33+
}
34+
})
35+
36+
if (tabs.length === 0) {
37+
return null
38+
}
1839

19-
const tabs = Array.isArray(children) ? children : [children]
20-
const validTabs = tabs.filter(tab =>
21-
tab && typeof tab === 'object' && 'props' in tab && tab.props
22-
)
23-
24-
if (validTabs.length === 0) return null
25-
2640
return (
27-
<div className={cn('my-6 overflow-hidden rounded-lg border bg-gray-900', className)}>
28-
<div className="flex border-b border-gray-800 bg-gray-950">
29-
{validTabs.map((tab, index) => {
30-
const { label, value } = tab.props
31-
return (
32-
<button
33-
key={value || index}
34-
onClick={() => setActiveTab(index)}
35-
className={cn(
36-
'px-4 py-2 text-sm font-medium transition-colors',
37-
activeTab === index
38-
? 'border-b-2 border-primary bg-gray-900 text-gray-100'
39-
: 'text-gray-400 hover:text-gray-200'
40-
)}
41-
>
42-
{label}
43-
</button>
44-
)
45-
})}
41+
<div className={cn('my-6 overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800', className)}>
42+
<div className="flex border-b border-gray-200 dark:border-gray-800 bg-gray-100 dark:bg-gray-950">
43+
{tabs.map((tab, index) => (
44+
<button
45+
key={index}
46+
onClick={() => setActiveTab(index)}
47+
className={cn(
48+
'px-4 py-2 text-sm font-medium transition-colors',
49+
activeTab === index
50+
? 'border-b-2 border-primary bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100'
51+
: 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200'
52+
)}
53+
>
54+
{tab.label}
55+
</button>
56+
))}
4657
</div>
47-
<div className="p-4">
48-
{validTabs[activeTab] && (
49-
<div className="text-sm text-gray-100">
50-
{validTabs[activeTab].props.children}
58+
<div className="bg-white dark:bg-gray-900">
59+
{tabs.map((tab, index) => (
60+
<div
61+
key={index}
62+
className={cn(
63+
'p-4',
64+
activeTab === index ? 'block' : 'hidden'
65+
)}
66+
>
67+
<div className="prose prose-sm dark:prose-invert max-w-none">
68+
{tab.content}
69+
</div>
5170
</div>
52-
)}
71+
))}
5372
</div>
5473
</div>
5574
)
56-
}
57-
58-
export function CodeTab({ children }: CodeTab) {
59-
return <>{children}</>
6075
}

0 commit comments

Comments
 (0)