Skip to content

Commit 55b69d9

Browse files
authored
Merge pull request #43 from BeyteFlow/copilot/sub-pr-42
Fix animation plugin, stale timestamp, and misleading debug data in error page
2 parents 8477665 + 3386d10 commit 55b69d9

5 files changed

Lines changed: 82 additions & 46 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"eslint": "^9",
3434
"eslint-config-next": "16.1.6",
3535
"tailwindcss": "^4",
36+
"tailwindcss-animate": "^1.0.7",
3637
"typescript": "^5",
3738
"vitest": "^4.0.18"
3839
}

src/app/error.tsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import React, { useEffect } from "react";
3+
import React, { useEffect, useState } from "react";
44
import {
55
AlertCircle,
66
RefreshCw,
@@ -17,6 +17,10 @@ interface ErrorProps {
1717

1818
// In this environment, the main component must be named App and be the default export
1919
export default function App({ error, reset }: ErrorProps) {
20+
const [errorTime] = useState(
21+
() => new Date().toISOString().split("T")[1].split(".")[0],
22+
);
23+
2024
useEffect(() => {
2125
if (error) {
2226
console.error("Captured Error:", error);
@@ -105,25 +109,29 @@ export default function App({ error, reset }: ErrorProps) {
105109
</div>
106110
<div className="text-gray-500 text-xs flex justify-between">
107111
<span>timestamp:</span>
108-
<span className="text-gray-400">
109-
{new Date().toISOString().split("T")[1].split(".")[0]} UTC
110-
</span>
112+
<span className="text-gray-400">{errorTime} UTC</span>
111113
</div>
112114
<div className="text-gray-500 text-xs flex justify-between">
113115
<span>module:</span>
114-
<span className="text-gray-400">core/generator-v2.bin</span>
116+
<span className="text-gray-400">{error?.name ?? "Error"}</span>
115117
</div>
116118
</div>
117-
<div className="flex gap-2 text-blue-400/80 pt-2">
118-
<span></span>
119-
<span className="text-gray-400 italic">
120-
Self-healing protocol initiated...
121-
</span>
122-
</div>
123-
<div className="flex gap-2 text-green-400/80">
124-
<span></span>
125-
<span>Workspace state preserved. Ready for manual reset.</span>
126-
</div>
119+
{process.env.NODE_ENV === "development" && (
120+
<>
121+
<div className="flex gap-2 text-blue-400/80 pt-2">
122+
<span></span>
123+
<span className="text-gray-400 italic">
124+
Self-healing protocol initiated...
125+
</span>
126+
</div>
127+
<div className="flex gap-2 text-green-400/80">
128+
<span></span>
129+
<span>
130+
Workspace state preserved. Ready for manual reset.
131+
</span>
132+
</div>
133+
</>
134+
)}
127135
</div>
128136
</div>
129137

@@ -147,7 +155,7 @@ export default function App({ error, reset }: ErrorProps) {
147155
<div>
148156
<h4 className="font-bold text-sm">State Recovery</h4>
149157
<p className="text-xs text-gray-500">
150-
Cache has been purged to prevent recursive errors.
158+
Click &quot;Try Again&quot; to retry the failed operation.
151159
</p>
152160
</div>
153161
</div>

src/app/globals.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "tailwindcss";
2+
@plugin "tailwindcss-animate";
23

34
:root {
45
--background: #ffffff;

0 commit comments

Comments
 (0)