Skip to content

Commit dfde3ae

Browse files
Improve docs sidebar positioning and footer visibility logic
- Implement sticky sidebar behavior: follows scroll initially, then sticks under header - Add JavaScript scroll detection to dynamically switch sidebar positioning - Refactor footer to show only on public pages using data-driven allow-list approach - Extract footer links into typed arrays for better maintainability - Optimize footer visibility logic with clean filtering and DRY principles - Improve profile table styling with consistent border radius and overflow handling 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 02a66e1 commit dfde3ae

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

web/src/app/docs/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export default function DocsLayout({
2323
// Track scroll position to determine if sidebar should be fixed
2424
useEffect(() => {
2525
const handleScroll = () => {
26-
// The header with logo is 4rem (64px) tall
26+
// The header with logo is approximately 72px tall (p-4 = 16px top/bottom + content height)
2727
// Fix the sidebar when the user scrolls past the header
28-
if (window.scrollY > 64) {
28+
if (window.scrollY > 72) {
2929
setIsFixed(true)
3030
} else {
3131
setIsFixed(false)
@@ -79,7 +79,7 @@ export default function DocsLayout({
7979
<div className="hidden lg:block w-64 shrink-0">
8080
<div
8181
className={`w-64 z-40 transition-all duration-200 ease-in-out ${
82-
isFixed ? 'fixed top-16 h-[calc(100vh-4rem)]' : 'relative'
82+
isFixed ? 'fixed top-4 h-[calc(100vh-2rem)]' : 'relative'
8383
}`}
8484
>
8585
{/* Dynamic gradient fade indicators */}

web/src/app/profile/components/api-keys-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function ApiKeysSection() {
173173
</Button>
174174
</div>
175175
)}
176-
<div className="rounded-md border">
176+
<div className="border rounded-lg overflow-x-auto">
177177
<Table>
178178
<TableHeader>
179179
<TableRow>

web/src/app/profile/components/referrals-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function ReferralsSection() {
9494
}
9595

9696
return (
97-
<ProfileSection description="Share Codebuff with friends and earn credits together! Both you and your friend get rewarded when they sign up.">
97+
<ProfileSection description="Share Codebuff!">
9898
{data?.referredBy && (
9999
<Card className="bg-gradient-to-br from-green-100/90 to-emerald-100/90 dark:from-green-900/90 dark:to-emerald-900/90 border border-green-200 dark:border-green-800 shadow-lg">
100100
<CardHeader>

web/src/app/profile/components/security-section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function SecuritySection() {
201201
</TabsList>
202202

203203
<TabsContent value="web" className="space-y-4">
204-
<div className="rounded-md border">
204+
<div className="border rounded-lg overflow-x-auto">
205205
<Table>
206206
<TableHeader>
207207
<TableRow>
@@ -277,7 +277,7 @@ export function SecuritySection() {
277277
</TabsContent>
278278

279279
<TabsContent value="cli" className="space-y-4">
280-
<div className="rounded-md border">
280+
<div className="border rounded-lg overflow-x-auto">
281281
<Table>
282282
<TableHeader>
283283
<TableRow>

web/src/components/footer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const authLinks: LinkInfo[] = [{ text: 'Login', href: '/login' }]
3232
const publicPaths = [
3333
...authLinks,
3434
...legalLinks,
35+
...communityLinks,
3536
...siteLinks.filter((link) => link.href !== '/docs'),
3637
]
3738
.map((link) => link.href)

0 commit comments

Comments
 (0)