Skip to content

Commit 8f45760

Browse files
committed
Updated the card designs
1 parent 85771e2 commit 8f45760

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

changelog-generator/app/response/[runId]/page.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import { useMemo, useRef, useState } from "react";
55
import { useRealtimeRun, useRealtimeStream } from "@trigger.dev/react-hooks";
66
import { Streamdown } from "streamdown";
77
import { ArrowLeft, AlertCircle, Calendar, Copy, Check } from "lucide-react";
8-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
8+
import {
9+
Card,
10+
CardContent,
11+
CardFooter,
12+
CardHeader,
13+
CardTitle,
14+
} from "@/components/ui/card";
915
import { Button } from "@/components/ui/button";
1016
import { Alert, AlertDescription } from "@/components/ui/alert";
1117
import { changelogStream } from "@/trigger/changelog-stream";
@@ -48,7 +54,7 @@ function parseChangelogSections(
4854
sections.push({
4955
title: currentTitle,
5056
content,
51-
category: currentCategory || undefined,
57+
category: currentCategory || "Update",
5258
date,
5359
});
5460
}
@@ -64,7 +70,7 @@ function parseChangelogSections(
6470
sections.push({
6571
title: currentTitle,
6672
content,
67-
category: currentCategory || undefined,
73+
category: currentCategory || "Update",
6874
date,
6975
});
7076
}
@@ -73,10 +79,10 @@ function parseChangelogSections(
7379
}
7480

7581
function extractDate(content: string): { content: string; date?: string } {
76-
const dateMatch = content.match(/\[DATE:\s*([^\]]+)\]\s*$/);
82+
const dateMatch = content.match(/\[DATE:\s*([^\]]+)\]/);
7783
if (dateMatch) {
7884
return {
79-
content: content.replace(/\[DATE:\s*[^\]]+\]\s*$/, "").trim(),
85+
content: content.replace(/\[DATE:\s*[^\]]+\]\s*/, "").trim(),
8086
date: dateMatch[1].trim(),
8187
};
8288
}
@@ -187,7 +193,7 @@ export default function ResponsePage() {
187193
</Button>
188194

189195
<h1 className="text-2xl font-bold tracking-tight">
190-
Changelog entries
196+
Generated changelogs
191197
</h1>
192198
</header>
193199

@@ -270,19 +276,10 @@ export default function ResponsePage() {
270276
<Card key={i}>
271277
<CardHeader className="flex gap-4">
272278
<div className="flex items-center w-full justify-between gap-4 shrink-0">
273-
{(section.category || section.date) && (
274-
<div className="gap-3 flex items-center">
275-
{section.category && (
276-
<span className="text-xs font-medium text-muted-foreground bg-secondary px-2 py-0.5 rounded">
277-
{section.category}
278-
</span>
279-
)}
280-
{section.date && (
281-
<span className="text-xs text-muted-foreground">
282-
{section.date}
283-
</span>
284-
)}
285-
</div>
279+
{section.category && (
280+
<span className="text-xs font-medium text-muted-foreground bg-secondary px-2 py-0.5 rounded">
281+
{section.category}
282+
</span>
286283
)}
287284

288285
<Button
@@ -316,6 +313,13 @@ export default function ResponsePage() {
316313
{section.content}
317314
</Streamdown>
318315
</CardContent>
316+
{section.date && (
317+
<CardFooter className="pt-4 border-t border-border">
318+
<span className="text-xs text-muted-foreground">
319+
{section.date}
320+
</span>
321+
</CardFooter>
322+
)}
319323
</Card>
320324
))}
321325

changelog-generator/trigger/generate-changelog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ CHANGELOG FORMAT (MDX):
166166
- Write entries in chronological order: NEWEST FIRST (most recent date at top)
167167
- Write technical content, no fluff
168168
- Breaking changes go at the top with migration steps
169-
- Include the date at the END of the entry in format: [DATE: Dec 7]
169+
- At the END of each entry, include the date: [DATE: Dec 7]
170170
- Do NOT include commit SHAs
171171
172172
WHAT TO INCLUDE - ask "does this change or improve the developer experience?":

0 commit comments

Comments
 (0)