chore: add model switch notice and move sponsor button to about page (#52)

- Remove sponsor iframe from chat panel header
- Add notice about switching from Opus 4.5 to Haiku 4.5 due to high traffic
- Add sponsor button next to Support & Contact section title
- Update all i18n about pages (EN, CN, JA)
This commit is contained in:
Dayuan Jiang
2025-12-03 16:47:45 +09:00
committed by GitHub
parent a8e627f1f8
commit 33fed6fa9f
4 changed files with 74 additions and 18 deletions

View File

@@ -58,6 +58,12 @@ export default function AboutCN() {
</div> </div>
</div> </div>
<div className="bg-amber-50 border border-amber-200 rounded-lg p-4 mb-6">
<p className="text-amber-800">
Claude Opus 4.5 Claude Haiku 4.5
</p>
</div>
<p className="text-gray-700"> <p className="text-gray-700">
AI功能的Next.js网页应用draw.io图表无缝结合AI辅助可视化来创建 AI功能的Next.js网页应用draw.io图表无缝结合AI辅助可视化来创建
</p> </p>
@@ -149,7 +155,16 @@ export default function AboutCN() {
</p> </p>
{/* Support */} {/* Support */}
<h2 className="text-2xl font-semibold text-gray-900 mt-10 mb-4"></h2> <div className="flex items-center gap-4 mt-10 mb-4">
<h2 className="text-2xl font-semibold text-gray-900"></h2>
<iframe
src="https://github.com/sponsors/DayuanJiang/button"
title="Sponsor DayuanJiang"
height="32"
width="114"
style={{ border: 0, borderRadius: 6 }}
/>
</div>
<p className="text-gray-700"> <p className="text-gray-700">
{" "} {" "}
<a href="https://github.com/sponsors/DayuanJiang" target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:underline"> <a href="https://github.com/sponsors/DayuanJiang" target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:underline">

View File

@@ -58,6 +58,12 @@ export default function AboutJA() {
</div> </div>
</div> </div>
<div className="bg-amber-50 border border-amber-200 rounded-lg p-4 mb-6">
<p className="text-amber-800">
Claude Opus 4.5 Claude Haiku 4.5
</p>
</div>
<p className="text-gray-700"> <p className="text-gray-700">
AI機能とdraw.ioダイアグラムを統合したNext.jsウェブアプリケーションですAI支援の可視化により AI機能とdraw.ioダイアグラムを統合したNext.jsウェブアプリケーションですAI支援の可視化により
</p> </p>
@@ -149,7 +155,16 @@ export default function AboutJA() {
</p> </p>
{/* Support */} {/* Support */}
<h2 className="text-2xl font-semibold text-gray-900 mt-10 mb-4"></h2> <div className="flex items-center gap-4 mt-10 mb-4">
<h2 className="text-2xl font-semibold text-gray-900"></h2>
<iframe
src="https://github.com/sponsors/DayuanJiang/button"
title="Sponsor DayuanJiang"
height="32"
width="114"
style={{ border: 0, borderRadius: 6 }}
/>
</div>
<p className="text-gray-700"> <p className="text-gray-700">
{" "} {" "}
<a href="https://github.com/sponsors/DayuanJiang" target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:underline"> <a href="https://github.com/sponsors/DayuanJiang" target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:underline">

View File

@@ -58,6 +58,12 @@ export default function About() {
</div> </div>
</div> </div>
<div className="bg-amber-50 border border-amber-200 rounded-lg p-4 mb-6">
<p className="text-amber-800">
This app is designed to run on Claude Opus 4.5 for best performance. However, due to higher-than-expected traffic, running the top-tier model has become cost-prohibitive. To avoid service interruptions and manage costs, I have switched the backend to Claude Haiku 4.5.
</p>
</div>
<p className="text-gray-700"> <p className="text-gray-700">
A Next.js web application that integrates AI capabilities with draw.io diagrams. A Next.js web application that integrates AI capabilities with draw.io diagrams.
Create, modify, and enhance diagrams through natural language commands and AI-assisted visualization. Create, modify, and enhance diagrams through natural language commands and AI-assisted visualization.
@@ -150,7 +156,16 @@ export default function About() {
</p> </p>
{/* Support */} {/* Support */}
<h2 className="text-2xl font-semibold text-gray-900 mt-10 mb-4">Support &amp; Contact</h2> <div className="flex items-center gap-4 mt-10 mb-4">
<h2 className="text-2xl font-semibold text-gray-900">Support &amp; Contact</h2>
<iframe
src="https://github.com/sponsors/DayuanJiang/button"
title="Sponsor DayuanJiang"
height="32"
width="114"
style={{ border: 0, borderRadius: 6 }}
/>
</div>
<p className="text-gray-700"> <p className="text-gray-700">
If you find this project useful, please consider{" "} If you find this project useful, please consider{" "}
<a href="https://github.com/sponsors/DayuanJiang" target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:underline"> <a href="https://github.com/sponsors/DayuanJiang" target="_blank" rel="noopener noreferrer" className="text-blue-600 hover:underline">

View File

@@ -26,7 +26,10 @@ interface ChatPanelProps {
onToggleVisibility: () => void; onToggleVisibility: () => void;
} }
export default function ChatPanel({ isVisible, onToggleVisibility }: ChatPanelProps) { export default function ChatPanel({
isVisible,
onToggleVisibility,
}: ChatPanelProps) {
const { const {
loadDiagram: onDisplayChart, loadDiagram: onDisplayChart,
handleExport: onExport, handleExport: onExport,
@@ -44,8 +47,14 @@ export default function ChatPanel({ isVisible, onToggleVisibility }: ChatPanelPr
onExport(); onExport();
}), }),
new Promise<string>((_, reject) => new Promise<string>((_, reject) =>
setTimeout(() => reject(new Error("Chart export timed out after 10 seconds")), 10000) setTimeout(
) () =>
reject(
new Error("Chart export timed out after 10 seconds")
),
10000
)
),
]); ]);
}; };
// Add a step counter to track updates // Add a step counter to track updates
@@ -96,7 +105,7 @@ export default function ChatPanel({ isVisible, onToggleVisibility }: ChatPanelPr
edits: Array<{ search: string; replace: string }>; edits: Array<{ search: string; replace: string }>;
}; };
let currentXml = ''; let currentXml = "";
try { try {
// Fetch current chart XML // Fetch current chart XML
currentXml = await onFetchChart(); currentXml = await onFetchChart();
@@ -116,7 +125,10 @@ export default function ChatPanel({ isVisible, onToggleVisibility }: ChatPanelPr
} catch (error) { } catch (error) {
console.error("Edit diagram failed:", error); console.error("Edit diagram failed:", error);
const errorMessage = error instanceof Error ? error.message : String(error); const errorMessage =
error instanceof Error
? error.message
: String(error);
// Provide detailed error with current diagram XML // Provide detailed error with current diagram XML
addToolResult({ addToolResult({
@@ -148,7 +160,7 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
// Debug: Log status changes // Debug: Log status changes
useEffect(() => { useEffect(() => {
console.log('[ChatPanel] Status changed to:', status); console.log("[ChatPanel] Status changed to:", status);
}, [status]); }, [status]);
const onFormSubmit = async (e: React.FormEvent<HTMLFormElement>) => { const onFormSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
@@ -227,7 +239,10 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
</ButtonWithTooltip> </ButtonWithTooltip>
<div <div
className="text-sm text-gray-500 mt-8" className="text-sm text-gray-500 mt-8"
style={{ writingMode: 'vertical-rl', transform: 'rotate(180deg)' }} style={{
writingMode: "vertical-rl",
transform: "rotate(180deg)",
}}
> >
Chat Chat
</div> </div>
@@ -241,18 +256,14 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
<CardHeader className="p-4 flex flex-row justify-between items-center"> <CardHeader className="p-4 flex flex-row justify-between items-center">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<CardTitle>Next-AI-Drawio</CardTitle> <CardTitle>Next-AI-Drawio</CardTitle>
<Link href="/about" className="text-sm text-gray-600 hover:text-gray-900 transition-colors"> <Link
href="/about"
className="text-sm text-gray-600 hover:text-gray-900 transition-colors"
>
About About
</Link> </Link>
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<iframe
src="https://github.com/sponsors/DayuanJiang/button"
title="Sponsor DayuanJiang"
height="32"
width="114"
style={{ border: 0, borderRadius: 6 }}
/>
<a <a
href="https://github.com/DayuanJiang/next-ai-draw-io" href="https://github.com/DayuanJiang/next-ai-draw-io"
target="_blank" target="_blank"