From 5fadd6436762e70bc3f2f8b7f383f4d4015ac5e7 Mon Sep 17 00:00:00 2001 From: Pascal Linxweiler Date: Mon, 5 Oct 2026 20:16:00 +0200 Subject: [PATCH] Model page: header, content and sidebar as consistent cards Tabs become a segmented control in the content card header; drop the full-bleed header band and the page-wide tab line; files tab without nested boxes; download card heading matches the other sidebar cards. Co-Authored-By: Claude Opus 5.5 --- src/app/(app)/[org]/[repo]/download-card.tsx | 6 +- src/app/(app)/[org]/[repo]/page.tsx | 171 +++++++++++-------- 2 files changed, 106 insertions(+), 71 deletions(-) diff --git a/src/app/(app)/[org]/[repo]/download-card.tsx b/src/app/(app)/[org]/[repo]/download-card.tsx index afb312e..ddad510 100644 --- a/src/app/(app)/[org]/[repo]/download-card.tsx +++ b/src/app/(app)/[org]/[repo]/download-card.tsx @@ -1,5 +1,6 @@ "use client"; +import { DownloadIcon } from "lucide-react"; import Link from "next/link"; import { useState } from "react"; import { cancelJob, startDownload } from "@/components/job-actions"; @@ -37,7 +38,10 @@ export function DownloadCard({ modelId, status }: { modelId: string; status: Mod return (
-

Download

+

+ + Download +

{latest && }

{hint}

diff --git a/src/app/(app)/[org]/[repo]/page.tsx b/src/app/(app)/[org]/[repo]/page.tsx index 53b88b3..99ae9df 100644 --- a/src/app/(app)/[org]/[repo]/page.tsx +++ b/src/app/(app)/[org]/[repo]/page.tsx @@ -105,11 +105,12 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o const shown = new Set([...Object.keys(FORMATS), model.architecture, author.toLowerCase(), model.pipelineTag]); const extraTags = hubTags.filter((t) => !shown.has(t) && !languageName(t)).slice(0, 8); + const tabHref = (id: TabId) => (id === "card" ? `/${model.repoId}` : `/${model.repoId}?tab=${id}`); + return ( -
- {/* Header, styled after the Hugging Face model page */} - {/* Full-bleed background behind the header (the page itself is width-limited). */} -
+
+ {/* Header card, styled after the Hugging Face model page */} +
@@ -126,7 +127,7 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o )}
-
+
{model.pipelineTag && ( {titleCase(model.pipelineTag)} @@ -147,12 +148,12 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o ))}
-
+
Your tags
-
+
馃 Hugging Face Files @ {shortSha(model.pinnedSha)} Commits @@ -161,44 +162,65 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o Base: {baseModels[0]} )}
+ - -
- -
-
- {tab === "card" && - (card ? ( - - ) : ( -

- {card === null ? "This repository has no model card." : "The model card could not be loaded."}{" "} - - Open on Hugging Face - -

- ))} +
+ )} {tab === "files" && } - {tab === "jobs" && } - + {tab === "jobs" && ( +
+ +
+ )} +