Skip to content

Commit d98c51c

Browse files
author
jeff
committed
Merge PR BIT-DataLab#35: Add real example images
Merged example images feature from PR BIT-DataLab#35 with history persistence from PR BIT-DataLab#36. Features combined: - Real example images in showcase (/examples/*.jpg, *.png) - History persistence with localStorage - History navigation link in navbar - Conversion history tracking in upload section
2 parents 7b53a61 + e374464 commit d98c51c

9 files changed

Lines changed: 72 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ sam3_src/
5050
# Local processing & debug
5151
arrow_processing/
5252
debug_output/
53+
TODO.md

.worktrees/T0-frontend-merge

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 329d4818e283f7f092592e0f1c075647582caac0

.worktrees/T0-logging-cleanup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit f515f509557bd2cadf5dc911e31001496401e5c7

.worktrees/T0-merge-stabilize

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 329d4818e283f7f092592e0f1c075647582caac0

apps/web/src/app/page.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
1+
<<<<<<< HEAD
12
"use client"
23

4+
=======
5+
>>>>>>> pr-35
36
import { Navbar } from "./sections/navbar"
47
import { Hero } from "./sections/hero"
58
import { UploadSection } from "./sections/upload-section"
69
import { Features } from "./sections/features"
710
import { ExampleShowcase } from "./sections/example-showcase"
811
import { Footer } from "./sections/footer"
12+
<<<<<<< HEAD
913
import { HistorySection } from "./sections/history-section"
1014
import { ConversionHistoryProvider, useConversionHistoryContext } from "@/components/history/conversion-history-provider"
1115

1216
function HomeContent() {
1317
const { history, removeHistoryItem, clearHistory } = useConversionHistoryContext()
1418

19+
=======
20+
21+
export default function Home() {
22+
>>>>>>> pr-35
1523
return (
1624
<div className="min-h-screen bg-white">
1725
<Navbar />
1826
<main>
1927
<Hero />
2028
<UploadSection />
29+
<<<<<<< HEAD
2130
<HistorySection
2231
history={history}
2332
onRemove={removeHistoryItem}
2433
onClear={clearHistory}
2534
/>
35+
=======
36+
>>>>>>> pr-35
2637
<Features />
2738
<ExampleShowcase />
2839
</main>
2940
<Footer />
3041
</div>
3142
)
3243
}
44+
<<<<<<< HEAD
3345

3446
export default function Home() {
3547
return (
@@ -38,3 +50,5 @@ export default function Home() {
3850
</ConversionHistoryProvider>
3951
)
4052
}
53+
=======
54+
>>>>>>> pr-35

apps/web/src/app/sections/example-showcase.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,37 @@ const examples: Example[] = [
1717
id: 1,
1818
title: "Flowchart Conversion",
1919
description: "Transform static flowchart images into editable diagrams",
20+
<<<<<<< HEAD
2021
beforeImage: "https://placehold.co/600x400/f3f4f6/9ca3af?text=Before:+Static+Flowchart+Image",
2122
afterImage: "https://placehold.co/600x400/fef3c7/d97706?text=After:+Editable+Diagram",
23+
=======
24+
beforeImage: "/examples/flowchart-before.jpg",
25+
afterImage: "/examples/flowchart-after.png",
26+
>>>>>>> pr-35
2227
},
2328
{
2429
id: 2,
2530
title: "Architecture Diagram",
2631
description: "Convert complex architecture diagrams to editable format",
32+
<<<<<<< HEAD
2733
beforeImage: "https://placehold.co/600x400/f3f4f6/9ca3af?text=Before:+Architecture+Image",
2834
afterImage: "https://placehold.co/600x400/fef3c7/d97706?text=After:+Editable+Architecture",
35+
=======
36+
beforeImage: "/examples/architecture-before.png",
37+
afterImage: "/examples/architecture-after.png",
38+
>>>>>>> pr-35
2939
},
3040
{
3141
id: 3,
3242
title: "Network Topology",
3343
description: "Turn network diagrams into fully editable assets",
44+
<<<<<<< HEAD
3445
beforeImage: "https://placehold.co/600x400/f3f4f6/9ca3af?text=Before:+Network+Image",
3546
afterImage: "https://placehold.co/600x400/fef3c7/d97706?text=After:+Editable+Network",
47+
=======
48+
beforeImage: "/examples/network-before.jpg",
49+
afterImage: "/examples/network-after.png",
50+
>>>>>>> pr-35
3651
},
3752
]
3853

apps/web/src/app/sections/navbar.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
"use client"
22

3+
<<<<<<< HEAD
34
import { Banana, History } from "lucide-react"
5+
=======
6+
import { Banana } from "lucide-react"
7+
>>>>>>> pr-35
48

59
export function Navbar() {
610
return (
@@ -15,13 +19,16 @@ export function Navbar() {
1519
</div>
1620
<div className="flex items-center gap-4">
1721
<a
22+
<<<<<<< HEAD
1823
href="#history"
1924
className="flex items-center gap-1.5 text-sm text-gray-600 hover:text-gray-900 transition-colors"
2025
>
2126
<History className="w-4 h-4" />
2227
History
2328
</a>
2429
<a
30+
=======
31+
>>>>>>> pr-35
2532
href="https://github.com/yourusername/edit-banana"
2633
target="_blank"
2734
rel="noopener noreferrer"

apps/web/src/app/sections/upload-section.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { track } from "@vercel/analytics"
66
import { Button } from "@/components/ui/button"
77
import { FileUpload } from "@/components/upload/file-upload"
88
import { uploadFile, getJobStatus, downloadResult, APIError } from "@/lib/api"
9+
<<<<<<< HEAD
910
import { useConversionHistoryContext } from "@/components/history/conversion-history-provider"
11+
=======
12+
>>>>>>> pr-35
1013
import type { Job } from "@/lib/types"
1114

1215
export function UploadSection() {
@@ -17,7 +20,10 @@ export function UploadSection() {
1720
const [loading, setLoading] = useState(false)
1821
const [error, setError] = useState<string | null>(null)
1922
const [resultUrl, setResultUrl] = useState<string | null>(null)
23+
<<<<<<< HEAD
2024
const { addHistoryItem, updateHistoryItem } = useConversionHistoryContext()
25+
=======
26+
>>>>>>> pr-35
2127

2228
const handleFileSelect = (file: File) => {
2329
setSelectedFile(file)
@@ -41,6 +47,7 @@ export function UploadSection() {
4147
setJobId(response.job_id)
4248
setJobStatus("pending")
4349

50+
<<<<<<< HEAD
4451
// Create initial history item
4552
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "https://editbanana.anxin6.cn"
4653
addHistoryItem({
@@ -54,6 +61,10 @@ export function UploadSection() {
5461

5562
// Poll for status
5663
pollJobStatus(response.job_id, selectedFile.name, selectedFile.size)
64+
=======
65+
// Poll for status
66+
pollJobStatus(response.job_id)
67+
>>>>>>> pr-35
5768
} catch (err) {
5869
setLoading(false)
5970
if (err instanceof APIError) {
@@ -64,7 +75,11 @@ export function UploadSection() {
6475
}
6576
}
6677

78+
<<<<<<< HEAD
6779
const pollJobStatus = async (id: string, filename: string, fileSize: number) => {
80+
=======
81+
const pollJobStatus = async (id: string) => {
82+
>>>>>>> pr-35
6883
const interval = setInterval(async () => {
6984
try {
7085
const job = await getJobStatus(id)
@@ -79,6 +94,7 @@ export function UploadSection() {
7994
clearInterval(interval)
8095
setLoading(false)
8196
setProgress(100)
97+
<<<<<<< HEAD
8298
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "https://editbanana.anxin6.cn"
8399
const newResultUrl = `${apiUrl}/api/v1/jobs/${id}/result`
84100
setResultUrl(newResultUrl)
@@ -89,27 +105,37 @@ export function UploadSection() {
89105
status: "completed",
90106
resultUrl: newResultUrl,
91107
})
108+
=======
109+
setResultUrl(`${process.env.NEXT_PUBLIC_API_URL || "https://editbanana.anxin6.cn"}/api/v1/jobs/${id}/result`)
110+
track("conversion_completed", { job_id: id })
111+
>>>>>>> pr-35
92112
} else if (job.status === "failed" || job.status === "cancelled") {
93113
clearInterval(interval)
94114
setLoading(false)
95115
setError(job.error || "Conversion failed")
116+
<<<<<<< HEAD
96117

97118
// Update history item with error status
98119
updateHistoryItem(id, {
99120
status: job.status as "failed" | "cancelled",
100121
error: job.error || "Conversion failed",
101122
})
123+
=======
124+
>>>>>>> pr-35
102125
}
103126
} catch (err) {
104127
clearInterval(interval)
105128
setLoading(false)
106129
setError("Failed to get job status")
130+
<<<<<<< HEAD
107131

108132
// Update history item with error
109133
updateHistoryItem(id, {
110134
status: "failed",
111135
error: "Failed to get job status",
112136
})
137+
=======
138+
>>>>>>> pr-35
113139
}
114140
}, 2000)
115141
}

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)