Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/skills/roast-skill
Submodule roast-skill added at f2302d
10 changes: 10 additions & 0 deletions .cursor/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"hooks": {
"afterAgentResponse": [
{
"command": ".cursor/hooks/say-complete.sh"
}
]
}
}
10 changes: 10 additions & 0 deletions .cursor/hooks/say-complete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Read and discard hook payload from stdin.
cat >/dev/null

if command -v say >/dev/null 2>&1; then
say "已完成" >/dev/null 2>&1 &
fi

printf '{}\n'
49 changes: 49 additions & 0 deletions apps/demo/src/app/app-error-boundary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Component, type ErrorInfo, type ReactNode } from "react";

type Props = { children: ReactNode };

type State = { error: Error | null };

export class AppErrorBoundary extends Component<Props, State> {
state: State = { error: null };

static getDerivedStateFromError(error: Error): State {
return { error };
}

componentDidCatch(error: Error, info: ErrorInfo) {
console.error("Demo app error:", error, info.componentStack);
}

render() {
if (this.state.error) {
return (
<div
style={{
padding: 24,
fontFamily: "system-ui, sans-serif",
maxWidth: 720,
}}
>
<h1 style={{ fontSize: 20, marginBottom: 12 }}>页面加载出错</h1>
<p style={{ color: "#666", marginBottom: 16 }}>
请打开开发者工具(Console)查看完整堆栈,或把下方错误信息发给开发者。
</p>
<pre
style={{
whiteSpace: "pre-wrap",
wordBreak: "break-word",
background: "#f5f5f5",
padding: 12,
borderRadius: 8,
fontSize: 13,
}}
>
{this.state.error.message}
</pre>
</div>
);
}
return this.props.children;
}
}
Loading
Loading