Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ export default async function StandaloneSitePage({ params }: SitePageParams) {
if (!page) notFound();

return (
<div className="mx-auto max-w-3xl px-6 py-10 sm:px-8 lg:py-14">
<h1 className="text-3xl font-bold tracking-tight text-foreground sm:text-4xl">
<div className="mx-auto w-full max-w-3xl px-4 py-8 sm:px-6 lg:py-12 min-w-0 overflow-hidden">
<h1 className="text-2xl sm:text-3xl md:text-4xl font-bold tracking-tight text-foreground">
{page.title}
</h1>
{page.description && (
<p className="mt-3 text-base text-muted-foreground leading-relaxed">
<p className="mt-3 text-sm sm:text-base text-muted-foreground leading-relaxed">
{page.description}
</p>
)}
<div className="mt-8 border-t border-border pt-6">
<div className="mt-8 border-t border-border pt-6 min-w-0 break-words">
<Markdown source={page.body} />
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions src/app/changelog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export default async function ChangelogPage() {
const entries = await getChangelog();

return (
<div className="mx-auto max-w-3xl px-6 py-10 sm:px-8 lg:py-14">
<h1 className="text-3xl font-bold tracking-tight text-foreground sm:text-4xl">
<div className="mx-auto w-full max-w-3xl px-4 py-8 sm:px-6 lg:py-12 min-w-0 overflow-hidden">
<h1 className="text-2xl sm:text-3xl md:text-4xl font-bold tracking-tight text-foreground">
Changelog
</h1>
<p className="mt-3 text-base text-muted-foreground leading-relaxed">
<p className="mt-3 text-sm sm:text-base text-muted-foreground leading-relaxed">
What shipped, release by release. Releases are tagged on{" "}
<a
href={`${GITHUB_URL}/releases`}
Expand All @@ -34,18 +34,18 @@ export default async function ChangelogPage() {
.
</p>

<div className="mt-12 space-y-0">
<div className="mt-10 sm:mt-12 space-y-0">
{entries.map((entry) => (
<section
key={entry.version}
id={`v${entry.version}`}
className="relative grid scroll-mt-24 gap-4 border-l border-border pb-12 pl-6 sm:grid-cols-[8.5rem_minmax(0,1fr)] sm:gap-8"
className="relative grid scroll-mt-24 gap-4 border-l border-border pb-10 pl-5 sm:pb-12 sm:pl-8 sm:grid-cols-[8.5rem_minmax(0,1fr)] sm:gap-8 min-w-0"
>
<span
aria-hidden
className="absolute -left-[5px] top-1.5 size-2 rounded-full bg-foreground"
/>
<header>
<header className="min-w-0">
<h2 className="font-mono text-base font-semibold text-foreground">
v{entry.version}
</h2>
Expand All @@ -66,13 +66,13 @@ export default async function ChangelogPage() {
))}
</p>
</header>
<div>
<div className="min-w-0 overflow-hidden">
{entry.title && (
<h3 className="text-lg font-semibold tracking-tight text-foreground">
<h3 className="text-base sm:text-lg font-semibold tracking-tight text-foreground">
{entry.title}
</h3>
)}
<div className="mt-2.5">
<div className="mt-2.5 min-w-0 break-words">
<Markdown source={entry.body} className="prose-sm" />
</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions src/app/docs/[section]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default async function DocPage({ params }: DocPageParams) {
const templateBadge = TEMPLATE_BADGES[page.sectionSlug] ?? { label: "Guide", color: "bg-muted text-muted-foreground border-border" };

return (
<div className="flex w-full justify-between gap-12">
<div className="flex w-full justify-between gap-8 lg:gap-12 min-w-0">
<JsonLd
data={{
"@context": "https://schema.org",
Expand Down Expand Up @@ -100,30 +100,30 @@ export default async function DocPage({ params }: DocPageParams) {
/>

{/* Centre Column: max-w-[720px] for prose, code breaks wider up to 860px */}
<article className="min-w-0 max-w-[720px] flex-1 pb-16">
<article className="min-w-0 max-w-full lg:max-w-[720px] flex-1 pb-16">
{/* Breadcrumb + Diataxis badge */}
<div className="flex items-center justify-between gap-2 text-xs mb-3">
<nav aria-label="Breadcrumb" className="flex items-center gap-1.5 text-muted-foreground">
<Link href="/docs" className="hover:text-foreground transition-colors">
<nav aria-label="Breadcrumb" className="flex items-center gap-1.5 text-muted-foreground truncate pr-2">
<Link href="/docs" className="hover:text-foreground transition-colors shrink-0">
Docs
</Link>
<span className="text-border-strong">/</span>
<span>{page.sectionTitle}</span>
<span className="text-border-strong shrink-0">/</span>
<span className="truncate">{page.sectionTitle}</span>
</nav>

<span className={`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-mono font-medium border ${templateBadge.color}`}>
<span className={`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-mono font-medium border shrink-0 ${templateBadge.color}`}>
{templateBadge.label}
</span>
</div>

{/* H1 Title */}
<h1 className="text-3xl sm:text-4xl font-bold tracking-tight text-foreground leading-tight">
<h1 className="text-2xl sm:text-3xl md:text-4xl font-bold tracking-tight text-foreground leading-tight">
{page.title}
</h1>

{/* One-sentence summary in larger, muted text */}
{page.description && (
<p className="mt-3 text-lg leading-relaxed text-muted-foreground font-normal">
<p className="mt-3 text-base sm:text-lg leading-relaxed text-muted-foreground font-normal">
{page.description}
</p>
)}
Expand All @@ -135,7 +135,7 @@ export default async function DocPage({ params }: DocPageParams) {
</div>

{/* Markdown Content */}
<div className="mt-6">
<div className="mt-6 min-w-0 max-w-full overflow-hidden">
<Markdown source={page.body} />
</div>

Expand Down
4 changes: 2 additions & 2 deletions src/app/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export default async function DocsLayout({
const sections = await getDocSections();

return (
<div className="mx-auto flex w-full max-w-[1400px] flex-1">
<div className="mx-auto flex w-full max-w-[1440px] flex-1">
<DocsSidebar sections={sections} />
<div className="min-w-0 flex-1 px-6 py-8 sm:px-10 lg:py-10">
<div className="min-w-0 flex-1 px-4 py-6 sm:px-8 lg:px-10 lg:py-10 overflow-x-hidden">
{children}
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ body {
font-size: 0.875rem;
margin: 1.75rem 0;
border: 1px solid var(--border);
display: block;
overflow-x: auto;
max-width: 100%;
}

.prose :where(thead th) {
Expand Down Expand Up @@ -272,7 +275,7 @@ body {
background: var(--code-bg);
border-radius: 6px;
overflow: hidden;
max-width: 860px;
max-width: 100%;
}

[data-rehype-pretty-code-figure] pre {
Expand Down
46 changes: 33 additions & 13 deletions src/components/docs/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { ChevronDown } from "lucide-react";
import { ChevronDown, FileText, X } from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useState } from "react";
Expand All @@ -17,11 +17,11 @@ const DIATAXIS_HINTS: Record<string, string> = {
reference: "Reference",
};

function SectionNav({ sections }: { sections: DocSection[] }) {
function SectionNav({ sections, onNavigate }: { sections: DocSection[]; onNavigate?: () => void }) {
const pathname = usePathname();

return (
<nav aria-label="Documentation" className="space-y-6 text-xs flex flex-col justify-between min-h-[calc(100vh-6.5rem)]">
<nav aria-label="Documentation" className="space-y-6 text-xs flex flex-col justify-between min-h-full">
<div className="space-y-6">
{sections.map((section) => {
const modeHint = DIATAXIS_HINTS[section.slug];
Expand All @@ -43,6 +43,7 @@ function SectionNav({ sections }: { sections: DocSection[] }) {
<li key={page.slug}>
<Link
href={href}
onClick={onNavigate}
aria-current={active ? "page" : undefined}
className={cn(
"block px-2.5 py-1.5 rounded transition-colors text-xs leading-snug",
Expand Down Expand Up @@ -71,6 +72,7 @@ function SectionNav({ sections }: { sections: DocSection[] }) {
<li>
<Link
href="/privacy"
onClick={onNavigate}
className={cn(
"block px-2 py-1 rounded transition-colors",
pathname === "/privacy"
Expand All @@ -84,6 +86,7 @@ function SectionNav({ sections }: { sections: DocSection[] }) {
<li>
<Link
href="/terms"
onClick={onNavigate}
className={cn(
"block px-2 py-1 rounded transition-colors",
pathname === "/terms"
Expand Down Expand Up @@ -126,30 +129,47 @@ export function DocsSidebar({ sections }: { sections: DocSection[] }) {

return (
<>
{/* Mobile: bottom drawer toggle */}
{/* Mobile: sticky page selector bar */}
<div className="sticky top-14 z-30 flex w-full items-center justify-between border-b border-border bg-background/95 px-4 py-2.5 backdrop-blur-md lg:hidden">
<button
onClick={() => setMobileOpen((open) => !open)}
aria-expanded={mobileOpen}
className="flex w-full cursor-pointer items-center justify-between text-xs font-medium"
>
<span className="text-foreground">
{current?.title ?? "Documentation"}
</span>
<div className="flex items-center gap-2 truncate pr-2">
<FileText className="size-3.5 text-muted-foreground shrink-0" />
<span className="text-foreground truncate">
{current?.title ?? "Documentation"}
</span>
</div>
<ChevronDown
className={cn(
"size-4 text-muted-foreground transition-transform duration-200",
"size-4 text-muted-foreground transition-transform duration-200 shrink-0",
mobileOpen && "rotate-180",
)}
aria-hidden
/>
</button>

{mobileOpen && (
<div
className="absolute left-0 right-0 top-full max-h-[75vh] overflow-y-auto border-b border-border bg-background p-4 shadow-xl z-50"
onClick={() => setMobileOpen(false)}
>
<SectionNav sections={sections} />
<div className="fixed inset-0 top-14 z-50 flex flex-col bg-background/98 backdrop-blur-md">
{/* Top close header bar */}
<div className="flex items-center justify-between border-b border-border px-4 py-3 bg-muted/40">
<span className="text-xs font-semibold text-foreground uppercase tracking-wider font-mono">
Documentation Index
</span>
<button
onClick={() => setMobileOpen(false)}
className="flex size-7 items-center justify-center rounded border border-border text-muted-foreground hover:text-foreground"
aria-label="Close menu"
>
<X className="size-4" />
</button>
</div>
{/* Nav content */}
<div className="flex-1 overflow-y-auto p-5">
<SectionNav sections={sections} onNavigate={() => setMobileOpen(false)} />
</div>
</div>
)}
</div>
Expand Down
30 changes: 13 additions & 17 deletions src/components/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export function SiteHeader({ searchItems }: { searchItems: SearchItem[] }) {
}

return (
<header className="sticky top-0 z-40 h-14 border-b border-border bg-background/90 backdrop-blur-md transition-colors">
<div className="mx-auto flex h-full max-w-[1440px] items-center justify-between gap-4 px-4 sm:px-6">
<header className="sticky top-0 z-40 h-14 border-b border-border bg-background/90 backdrop-blur-md transition-colors w-full overflow-hidden">
<div className="mx-auto flex h-full max-w-[1440px] items-center justify-between gap-1 sm:gap-3 px-3 sm:px-6">
{/* Left: Logo + Version Dropdown Pill */}
<div className="flex items-center gap-4">
<div className="flex items-center gap-1.5 sm:gap-3 shrink min-w-0">
<Logo />

<div className="relative">
<div className="relative shrink-0 hidden sm:block">
<button
onClick={() => setVersionOpen((o) => !o)}
aria-label="Version selector"
Expand Down Expand Up @@ -76,7 +76,7 @@ export function SiteHeader({ searchItems }: { searchItems: SearchItem[] }) {
)}
</div>

<nav aria-label="Main" className="hidden items-center gap-1 ml-4 md:flex">
<nav aria-label="Main" className="hidden lg:flex items-center gap-1 ml-2">
{NAV.map((item) => {
const active =
item.href === "/docs"
Expand All @@ -101,18 +101,14 @@ export function SiteHeader({ searchItems }: { searchItems: SearchItem[] }) {
</nav>
</div>

{/* Center / Wide Search: ⌘K or / */}
<div className="flex-1 max-w-md mx-2 hidden sm:block">
{/* Center: Search Field */}
<div className="flex-1 min-w-0 max-w-[120px] xs:max-w-[180px] sm:max-w-xs md:max-w-md mx-1 sm:mx-2">
<SearchDialog items={searchItems} />
</div>

{/* Right: Language, GitHub, Theme, Mobile toggle */}
<div className="flex items-center gap-2 sm:gap-2.5">
<div className="sm:hidden">
<SearchDialog items={searchItems} />
</div>

<div className="hidden sm:flex items-center rounded border border-border bg-card px-2 py-0.5 font-mono text-[11px] text-muted-foreground">
{/* Right Controls */}
<div className="flex items-center gap-1 shrink-0">
<div className="hidden xl:flex items-center rounded border border-border bg-card px-2 py-0.5 font-mono text-[11px] text-muted-foreground">
<span className="font-semibold text-foreground">Python</span>
<span className="text-faint ml-1">3.11+</span>
</div>
Expand All @@ -122,7 +118,7 @@ export function SiteHeader({ searchItems }: { searchItems: SearchItem[] }) {
target="_blank"
rel="noreferrer"
aria-label="Agentling on GitHub"
className="flex size-8 items-center justify-center rounded border border-border text-muted-foreground hover:text-foreground hover:border-border-strong transition-colors"
className="hidden sm:flex size-8 items-center justify-center rounded border border-border text-muted-foreground hover:text-foreground hover:border-border-strong transition-colors"
>
<GithubIcon className="size-3.5" aria-hidden />
</a>
Expand All @@ -133,7 +129,7 @@ export function SiteHeader({ searchItems }: { searchItems: SearchItem[] }) {
onClick={() => setMenuOpen((open) => !open)}
aria-expanded={menuOpen}
aria-label={menuOpen ? "Close menu" : "Open menu"}
className="flex size-8 cursor-pointer items-center justify-center rounded border border-border text-muted-foreground md:hidden"
className="flex size-8 cursor-pointer items-center justify-center rounded border border-border text-muted-foreground lg:hidden shrink-0"
>
{menuOpen ? <X className="size-3.5" aria-hidden /> : <Menu className="size-3.5" aria-hidden />}
</button>
Expand All @@ -143,7 +139,7 @@ export function SiteHeader({ searchItems }: { searchItems: SearchItem[] }) {
{menuOpen && (
<nav
aria-label="Mobile"
className="border-t border-border bg-background px-4 py-3 md:hidden shadow-lg"
className="border-t border-border bg-background px-4 py-3 lg:hidden shadow-lg"
>
<ul className="flex flex-col gap-1">
{NAV.map((item) => (
Expand Down
Loading
Loading