From 4bbdbb9647ea6e21f3647e6237d1c332f1f30c16 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Thu, 20 Aug 2026 21:18:03 +0700 Subject: [PATCH] feat(web-ui): overhaul docs index, doc page, and sidebar with card-based layout - Docs index: hero section with search bar, card grid with metadata/tags, recent strip - Doc page: section badges, card-style related docs, improved revision history - Sidebar: section icons, active state highlighting, better typography --- apps/web/app/[section]/[...slug]/page.tsx | 138 +++++++++++------ apps/web/app/components/Sidebar.tsx | 39 ++++- apps/web/app/docs/page.tsx | 178 +++++++++++++++++++--- 3 files changed, 280 insertions(+), 75 deletions(-) diff --git a/apps/web/app/[section]/[...slug]/page.tsx b/apps/web/app/[section]/[...slug]/page.tsx index 29eeb52..85a3209 100644 --- a/apps/web/app/[section]/[...slug]/page.tsx +++ b/apps/web/app/[section]/[...slug]/page.tsx @@ -15,6 +15,20 @@ interface DocPageProps { searchParams: Promise<{ edit?: string }>; } +const SECTION_LABEL: Record = { + docs: "Documentation", + writeups: "Writeup", + research: "Research", + notes: "Note", +}; + +const SECTION_ICON: Record = { + docs: "๐Ÿ“„", + writeups: "๐Ÿ“", + research: "๐Ÿ”ฌ", + notes: "๐Ÿ“Œ", +}; + export default async function DocPage({ params, searchParams }: DocPageProps) { const { section, slug } = await params; const { edit } = await searchParams; @@ -60,8 +74,9 @@ export default async function DocPage({ params, searchParams }: DocPageProps) { const revisions = await listRevisions(fullSlug, 10); return ( -
-
+
+ {/* Breadcrumb */} +
+ / + {doc.title} + -

{doc.title}

- -
- {doc.author || "unknown"} - โ€ข - {new Date(doc.updatedAt).toLocaleDateString()} - {doc.tags.map((t) => ( - - #{t} + {/* Header */} +
+
+ {SECTION_ICON[doc.section] || "๐Ÿ“„"} + + {SECTION_LABEL[doc.section] || doc.section} - ))} +
+

+ {doc.title} +

+ +
+ {doc.author || "unknown"} + ยท + + {doc.tags.map((t) => ( + + #{t} + + ))} +
+ {/* Content + TOC */}
+ {/* Related docs (card-style) */} {related.length > 0 && ( -
)} + {/* History */} {revisions.length > 0 && ( -