|
| 1 | +diff --git a/src/components/ReviewSummaryCard.tsx b/src/components/ReviewSummaryCard.tsx |
| 2 | +index 73a5e7f..9136307 100644 |
| 3 | +--- a/src/components/ReviewSummaryCard.tsx |
| 4 | ++++ b/src/components/ReviewSummaryCard.tsx |
| 5 | +@@ -1,18 +1,20 @@ |
| 6 | +-type ChangeSummaryCardProps = { |
| 7 | +- title: string; |
| 8 | +- note: string; |
| 9 | +- changes: number; |
| 10 | +- lastSynced: string; |
| 11 | +- onOpen: () => void; |
| 12 | ++import { reviewButtonLabel, reviewTimestampLabel } from "../lib/reviewCopy"; |
| 13 | ++ |
| 14 | ++type ReviewSummaryCardProps = { |
| 15 | ++ heading: string; |
| 16 | ++ supportingText: string; |
| 17 | ++ fileCount: number; |
| 18 | ++ lastUpdated: string; |
| 19 | ++ onReview: () => void; |
| 20 | + }; |
| 21 | + |
| 22 | +-export function ChangeSummaryCard({ |
| 23 | +- title, |
| 24 | +- note, |
| 25 | +- changes, |
| 26 | +- lastSynced, |
| 27 | +- onOpen, |
| 28 | +-}: ChangeSummaryCardProps) { |
| 29 | ++export function ReviewSummaryCard({ |
| 30 | ++ heading, |
| 31 | ++ supportingText, |
| 32 | ++ fileCount, |
| 33 | ++ lastUpdated, |
| 34 | ++ onReview, |
| 35 | ++}: ReviewSummaryCardProps) { |
| 36 | + return ( |
| 37 | + <box |
| 38 | + style={{ |
| 39 | +@@ -21,19 +23,20 @@ export function ChangeSummaryCard({ |
| 40 | + borderColor: "#334155", |
| 41 | + backgroundColor: "#0f172a", |
| 42 | + flexDirection: "column", |
| 43 | ++ gap: 1, |
| 44 | + }} |
| 45 | + > |
| 46 | +- <box style={{ flexDirection: "column", gap: 0 }}> |
| 47 | +- <text fg="#f8fafc">{title}</text> |
| 48 | +- <text fg="#94a3b8">{note}</text> |
| 49 | ++ <box style={{ flexDirection: "column", gap: 1 }}> |
| 50 | ++ <text fg="#f8fafc">{heading}</text> |
| 51 | ++ <text fg="#94a3b8">{supportingText}</text> |
| 52 | + </box> |
| 53 | + |
| 54 | +- <box style={{ flexDirection: "row", justifyContent: "space-between", marginTop: 1 }}> |
| 55 | +- <text fg="#38bdf8">{changes} files changed</text> |
| 56 | +- <text fg="#64748b">Synced {lastSynced}</text> |
| 57 | ++ <box style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center" }}> |
| 58 | ++ <text fg="#38bdf8">{fileCount} files ready for review</text> |
| 59 | ++ <text fg="#64748b">{reviewTimestampLabel(lastUpdated)}</text> |
| 60 | + </box> |
| 61 | + |
| 62 | +- <button label="Open diff" onPress={onOpen} /> |
| 63 | ++ <button label={reviewButtonLabel(fileCount)} onPress={onReview} /> |
| 64 | + </box> |
| 65 | + ); |
| 66 | + } |
| 67 | +diff --git a/src/lib/reviewCopy.ts b/src/lib/reviewCopy.ts |
| 68 | +new file mode 100644 |
| 69 | +index 0000000..d211039 |
| 70 | +--- /dev/null |
| 71 | ++++ b/src/lib/reviewCopy.ts |
| 72 | +@@ -0,0 +1,7 @@ |
| 73 | ++export function reviewButtonLabel(fileCount: number) { |
| 74 | ++ return fileCount === 1 ? "Review 1 file" : `Review ${fileCount} files`; |
| 75 | ++} |
| 76 | ++ |
| 77 | ++export function reviewTimestampLabel(lastUpdated: string) { |
| 78 | ++ return `Updated ${lastUpdated}`; |
| 79 | ++} |
| 80 | +diff --git a/test/reviewSummaryCard.demo.ts b/test/reviewSummaryCard.demo.ts |
| 81 | +index 5acb770..03f9616 100644 |
| 82 | +--- a/test/reviewSummaryCard.demo.ts |
| 83 | ++++ b/test/reviewSummaryCard.demo.ts |
| 84 | +@@ -1,8 +1,9 @@ |
| 85 | + import { expect, test } from "bun:test"; |
| 86 | +-import { ChangeSummaryCard } from "../src/components/ReviewSummaryCard"; |
| 87 | ++import { ReviewSummaryCard } from "../src/components/ReviewSummaryCard"; |
| 88 | ++import { reviewButtonLabel, reviewTimestampLabel } from "../src/lib/reviewCopy"; |
| 89 | + |
| 90 | +-test("keeps the old sync-oriented labels", () => { |
| 91 | +- expect(ChangeSummaryCard).toBeDefined(); |
| 92 | +- expect("Open diff").toContain("diff"); |
| 93 | +- expect("Synced 2m ago").toContain("Synced"); |
| 94 | ++test("switches the card copy to review-oriented labels", () => { |
| 95 | ++ expect(ReviewSummaryCard).toBeDefined(); |
| 96 | ++ expect(reviewButtonLabel(3)).toBe("Review 3 files"); |
| 97 | ++ expect(reviewTimestampLabel("2m ago")).toBe("Updated 2m ago"); |
| 98 | + }); |
0 commit comments