feat: refresh frontend and remove legacy research ui#415
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request performs a comprehensive redesign and refactoring of the PaperBot Web UI, including the dashboard, research workspace, and authentication flows. It introduces new documentation for testing and UI tracking, as well as components for managing research tracks and paper collections. Feedback focuses on ensuring a professional and consistent tone throughout the UI, replacing placeholder labels with context-relevant data, and improving performance and error handling in data-fetching logic.
| Dashboard | ||
| </div> | ||
| <h1 className="mt-2 text-[36px] font-bold leading-[1.1] tracking-[-0.025em] text-[#0a0a0a]"> | ||
| Oh, God! 你回来了! |
There was a problem hiding this comment.
| <div className="flex justify-center gap-6 pt-3.5"> | ||
| <span className="inline-flex items-center gap-1.5 text-[12px] text-[#0a0a0a]"> | ||
| <span className="h-2 w-2 rounded-[2px] bg-[#0a0a0a]" /> | ||
| Mobile |
There was a problem hiding this comment.
| </span> | ||
| <span className="inline-flex items-center gap-1.5 text-[12px] text-[#0a0a0a]"> | ||
| <span className="h-2 w-2 rounded-[2px] bg-[#737373]" /> | ||
| Desktop |
| cache: "no-store", | ||
| headers: accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined, | ||
| }) | ||
| if (!res.ok) return [] |
There was a problem hiding this comment.
Returning an empty array on a failed fetch request silently masks potential issues (e.g., 401 Unauthorized or 500 Internal Server Error). Consider logging the error or throwing it so it can be handled by an error boundary or reported to the user.
if (!res.ok) {
console.error("Failed to fetch saved papers: " + res.status + " " + res.statusText);
return [];
}
| for (const paper of visiblePapers) { | ||
| const res = await fetch(`/api/research/collections/${selectedCollectionId}/items`, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ paper_id: String(paper.id) }), | ||
| }) | ||
| if (!res.ok) throw new Error(await res.text().catch(() => `${res.status}`)) | ||
| } |
There was a problem hiding this comment.
Executing API requests sequentially within a loop can lead to poor performance, especially as the number of papers increases. Consider using Promise.all to execute these requests in parallel for better efficiency.
| for (const paper of visiblePapers) { | |
| const res = await fetch(`/api/research/collections/${selectedCollectionId}/items`, { | |
| method: "POST", | |
| headers: { "Content-Type": "application/json" }, | |
| body: JSON.stringify({ paper_id: String(paper.id) }), | |
| }) | |
| if (!res.ok) throw new Error(await res.text().catch(() => `${res.status}`)) | |
| } | |
| await Promise.all(visiblePapers.map(async (paper) => { | |
| const res = await fetch("/api/research/collections/" + selectedCollectionId + "/items", { | |
| method: "POST", | |
| headers: { "Content-Type": "application/json" }, | |
| body: JSON.stringify({ paper_id: String(paper.id) }), | |
| }) | |
| if (!res.ok) throw new Error(await res.text().catch(() => String(res.status))) | |
| })) |
|



No description provided.