TradingAgents/frontend
MarkLo 22f57a8674 feat: recover pending analysis tasks after page close
Added task recovery system that allows users to recover and save
analysis results even if they accidentally close the page:

1. New pending-task.ts utility:
   - Saves task info to localStorage when analysis starts
   - Clears after task completes/fails
   - 24-hour expiry for old tasks

2. PendingTaskRecovery component:
   - Shows on history page if pending task found
   - Polls API for task status
   - Saves result to IndexedDB + cloud upon completion

3. Updated useAnalysis hook:
   - Tracks pending tasks in localStorage
   - Clears on completion/failure

Now users visiting /history after closing the page during analysis
will see a prompt to recover and save their completed report.
2025-12-14 03:55:12 +08:00
..
app feat: recover pending analysis tasks after page close 2025-12-14 03:55:12 +08:00
components feat: recover pending analysis tasks after page close 2025-12-14 03:55:12 +08:00
context 2025-12-12 19:01:49 +08:00
contexts 2025-12-13 16:48:12 +08:00
hooks feat: recover pending analysis tasks after page close 2025-12-14 03:55:12 +08:00
lib feat: recover pending analysis tasks after page close 2025-12-14 03:55:12 +08:00
public 2025-11-29 00:19:17 +08:00
.dockerignore 2025-12-12 05:43:08 +08:00
.gitignore 2025-11-20 21:56:47 +08:00
Dockerfile 2025-11-21 22:52:52 +08:00
Dockerfile.railway 2025-11-22 01:26:09 +08:00
README.md 2025-11-20 21:56:47 +08:00
components.json 2025-11-20 21:56:47 +08:00
eslint.config.mjs 2025-12-12 05:57:55 +08:00
next.config.ts 2025-12-13 01:54:47 +08:00
package.json 2025-12-12 19:01:49 +08:00
pnpm-lock.yaml 2025-12-12 19:10:04 +08:00
pnpm-workspace.yaml 2025-12-05 23:34:50 +08:00
postcss.config.mjs 2025-11-20 21:56:47 +08:00
tsconfig.json 2025-11-20 21:56:47 +08:00

README.md

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.