File tree Expand file tree Collapse file tree
src/app/[...parts]/_page/catalog Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ async function CatalogPageInner({ specs }: CatalogPageProps) {
3737
3838 return (
3939 < div className = "mx-auto w-full max-w-7xl py-8" >
40- < div className = "grid grid-cols-1 gap-8 lg:grid-cols-2 " >
40+ < div className = "grid grid-cols-1 gap-8 lg:grid-cols-[2fr,3fr] " >
4141 < div className = "flex flex-col" >
4242 < PackageMeta packument = { pack } />
4343 </ div >
@@ -55,7 +55,7 @@ async function CatalogPageInner({ specs }: CatalogPageProps) {
5555function CatalogPageFallback ( ) {
5656 return (
5757 < div className = "mx-auto w-full max-w-7xl py-8" >
58- < div className = "grid grid-cols-1 gap-8 lg:grid-cols-2 " >
58+ < div className = "grid grid-cols-1 gap-8 lg:grid-cols-[2fr,3fr] " >
5959 < div className = "flex flex-col" >
6060 < Skeleton className = "h-96 w-full rounded-md" />
6161 </ div >
Original file line number Diff line number Diff line change @@ -26,13 +26,22 @@ function getHighlightIndex(type: "major" | "minor" | "patch"): number {
2626 }
2727}
2828
29+ /**
30+ * Threshold for omitting the package name in the "to" spec
31+ * When package name is 24+ characters, we show "pkg@1.0.0...2.0.0" instead of "pkg@1.0.0...pkg@2.0.0"
32+ */
33+ const PACKAGE_NAME_LENGTH_THRESHOLD = 24 ;
34+
2935/**
3036 * Right column showing the list of comparisons
3137 */
3238export default function ComparisonList ( {
3339 packageName,
3440 comparisons,
3541} : ComparisonListProps ) {
42+ const showSecondPackageName =
43+ packageName . length < PACKAGE_NAME_LENGTH_THRESHOLD ;
44+
3645 if ( comparisons . length === 0 ) {
3746 return (
3847 < BorderBox >
@@ -73,7 +82,11 @@ export default function ComparisonList({
7382 < span className = "text-muted-foreground" >
7483 ...
7584 </ span >
76- < PackageNamePrefix packageName = { packageName } />
85+ { showSecondPackageName ? (
86+ < PackageNamePrefix
87+ packageName = { packageName }
88+ />
89+ ) : null }
7790 < VersionWithHighlight
7891 version = { comparison . to }
7992 highlightIndex = { highlightIndex }
You can’t perform that action at this time.
0 commit comments