Skip to content
Merged
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
47 changes: 34 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"eslint": "^9",
"eslint-config-next": "16.1.6",
"tailwindcss": "^4",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5",
"vitest": "^4.0.18"
}
Expand Down
40 changes: 24 additions & 16 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import React, { useEffect } from "react";
import React, { useEffect, useState } from "react";
import {
AlertCircle,
RefreshCw,
Expand All @@ -17,6 +17,10 @@ interface ErrorProps {

// In this environment, the main component must be named App and be the default export
export default function App({ error, reset }: ErrorProps) {
const [errorTime] = useState(
() => new Date().toISOString().split("T")[1].split(".")[0],
);

useEffect(() => {
if (error) {
console.error("Captured Error:", error);
Expand Down Expand Up @@ -105,25 +109,29 @@ export default function App({ error, reset }: ErrorProps) {
</div>
<div className="text-gray-500 text-xs flex justify-between">
<span>timestamp:</span>
<span className="text-gray-400">
{new Date().toISOString().split("T")[1].split(".")[0]} UTC
</span>
<span className="text-gray-400">{errorTime} UTC</span>
</div>
<div className="text-gray-500 text-xs flex justify-between">
<span>module:</span>
<span className="text-gray-400">core/generator-v2.bin</span>
<span className="text-gray-400">{error?.name ?? "Error"}</span>
</div>
</div>
<div className="flex gap-2 text-blue-400/80 pt-2">
<span>➜</span>
<span className="text-gray-400 italic">
Self-healing protocol initiated...
</span>
</div>
<div className="flex gap-2 text-green-400/80">
<span>✓</span>
<span>Workspace state preserved. Ready for manual reset.</span>
</div>
{process.env.NODE_ENV === "development" && (
<>
<div className="flex gap-2 text-blue-400/80 pt-2">
<span>➜</span>
<span className="text-gray-400 italic">
Self-healing protocol initiated...
</span>
</div>
<div className="flex gap-2 text-green-400/80">
<span>✓</span>
<span>
Workspace state preserved. Ready for manual reset.
</span>
</div>
</>
)}
</div>
</div>

Expand All @@ -147,7 +155,7 @@ export default function App({ error, reset }: ErrorProps) {
<div>
<h4 className="font-bold text-sm">State Recovery</h4>
<p className="text-xs text-gray-500">
Cache has been purged to prevent recursive errors.
Click &quot;Try Again&quot; to retry the failed operation.
</p>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "tailwindcss";
@plugin "tailwindcss-animate";

:root {
--background: #ffffff;
Expand Down
Loading