Skip to content

fix several issues including avatar display and password reset#57

Merged
Sskift merged 5 commits intodevfrom
issues
Dec 18, 2025
Merged

fix several issues including avatar display and password reset#57
Sskift merged 5 commits intodevfrom
issues

Conversation

@Dynamite2003
Copy link
Copy Markdown
Owner

基于第三次阶段检查反馈的一些问题做出修改

Copilot AI review requested due to automatic review settings December 18, 2025 09:14
@Sskift Sskift merged commit cd11b77 into dev Dec 18, 2025
8 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses several issues identified in the third phase review, focusing on password reset functionality, avatar display improvements, and enhanced user experience features.

Key Changes

  • Password Reset Flow: Added complete password reset functionality with email verification code flow
  • Avatar Display: Enhanced default avatar styling in dark mode with better border and shadow effects
  • Marketing Component: Replaced static video with interactive animated workflow visualization using framer-motion
  • Auto-Summary Feature: Added automatic paper summary generation when parsing completes
  • Recommendations Caching: Implemented daily caching system for recommendations to improve performance

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
frontend/src/lib/api-client.ts Added password reset request and confirmation API interfaces and functions
frontend/src/components/auth-form.tsx Implemented password reset UI with two-stage flow (request code → verify and reset), removed OAuth login options
frontend/src/components/marketing/insight-workflow.tsx New animated marketing component showcasing product features with framer-motion
frontend/src/components/ai-agent/AgentChatPanel.tsx Added automatic summary generation when paper parsing completes
frontend/src/components/academic/IntelligentConversation.tsx Increased bottom padding to prevent content overlap
frontend/src/components/Recommendations.tsx Added caching system, sorting preferences (relevance/recency/citations), and citation count display
frontend/src/app/upload/page.tsx Enhanced file upload UI with better visual feedback and file size formatting
frontend/src/app/smart-reading/page.tsx Refactored layout interaction handlers for better maintainability
frontend/src/app/profile/page.tsx Improved default avatar styling with dark mode support
frontend/src/app/page.tsx Added automatic redirect to auth page for unauthenticated users
frontend/src/app/notes/page.tsx Redesigned notes organization UI with collapsible sections and better visual hierarchy
frontend/src/app/auth/page.tsx Replaced video element with new interactive workflow component
frontend/src/app/academic/page.tsx Enhanced textarea styling with better shadows and backgrounds
frontend/package.json Added framer-motion dependency for animations
frontend/package-lock.json Lock file updates for framer-motion and peer dependencies
Files not reviewed (1)
  • frontend/package-lock.json: Language not supported

<path d={d} stroke="currentColor" strokeWidth="1" strokeDasharray="6 4" fill="none" className="text-slate-300 opacity-30" />
);

const ActivePath = ({ d, isActive }) => (
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter 'd' and 'isActive' are missing type annotations. For better type safety and code maintainability, these should have explicit types like 'd: string' and 'isActive: boolean'.

Copilot uses AI. Check for mistakes.
);

// --- 节点 1:论文推荐 ---
const RecommendationNode = ({ isActive }) => (
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'isActive' parameter is missing a type annotation. Consider adding an explicit type annotation like 'isActive: boolean' for better type safety.

Suggested change
const RecommendationNode = ({ isActive }) => (
const RecommendationNode = ({ isActive }: { isActive: boolean }) => (

Copilot uses AI. Check for mistakes.
);

// --- 节点 2:论文搜索 ---
const SearchNode = ({ isActive }) => {
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'isActive' parameter is missing a type annotation. Consider adding an explicit type annotation like 'isActive: boolean' for better type safety.

Copilot uses AI. Check for mistakes.
// =====================================================================
// ▼▼▼ 重构的节点 3:Agent 论文阅读 (带机器人分析动画) ▼▼▼
// =====================================================================
const AgentReadingNode = ({ isActive }) => (
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'isActive' parameter is missing a type annotation. Consider adding an explicit type annotation like 'isActive: boolean' for better type safety.

Suggested change
const AgentReadingNode = ({ isActive }) => (
const AgentReadingNode = ({ isActive }: { isActive: boolean }) => (

Copilot uses AI. Check for mistakes.
} else {
setDisplayText("");
}
}, [isActive]);
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency array includes 'isActive' but the effect also uses 'fullText'. While 'fullText' is a constant, it's better to explicitly include all external dependencies in the dependency array to avoid confusion and future bugs if the constant is changed to a variable.

Suggested change
}, [isActive]);
}, [isActive, fullText]);

Copilot uses AI. Check for mistakes.
Comment on lines +166 to +173
function clamp01(value: number) {
if (!Number.isFinite(value)) {
return 0;
}
if (value < 0) return 0;
if (value > 1) return 1;
return value;
}
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clamp01 function doesn't handle NaN values consistently with infinite values. When a NaN value is passed, it returns 0, but the check 'Number.isFinite(value)' catches both Infinity and NaN. Consider explicitly checking for NaN separately for clarity, or add a comment explaining that NaN is intentionally treated as 0.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +26
const ConnectingArrow = ({ d }) => (
<path d={d} stroke="currentColor" strokeWidth="1" strokeDasharray="6 4" fill="none" className="text-slate-300 opacity-30" />
);

const ActivePath = ({ d, isActive }) => (
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arrow function parameter 'd' is missing a type annotation. TypeScript should enforce type safety for component props. Consider adding a type annotation like 'd: string' to ensure the path data parameter is properly typed.

Suggested change
const ConnectingArrow = ({ d }) => (
<path d={d} stroke="currentColor" strokeWidth="1" strokeDasharray="6 4" fill="none" className="text-slate-300 opacity-30" />
);
const ActivePath = ({ d, isActive }) => (
const ConnectingArrow = ({ d }: { d: string }) => (
<path d={d} stroke="currentColor" strokeWidth="1" strokeDasharray="6 4" fill="none" className="text-slate-300 opacity-30" />
);
const ActivePath = ({ d, isActive }: { d: string; isActive: boolean }) => (

Copilot uses AI. Check for mistakes.


// --- 节点 4:文献库管理 ---
const DocsNode = ({ isActive }) => {
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'isActive' parameter is missing a type annotation. Consider adding an explicit type annotation like 'isActive: boolean' for better type safety.

Suggested change
const DocsNode = ({ isActive }) => {
const DocsNode = ({ isActive }: { isActive: boolean }) => {

Copilot uses AI. Check for mistakes.
setResetCode("");
setError(null);
setSuccess(null);
setForm((prev) => ({ ...prev, password: "", confirmPassword: "" }));
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handleForgotPassword function resets form fields but doesn't reset all form state. Consider also resetting 'isSubmitting' to false to ensure consistency if this function is called while a submission is in progress.

Suggested change
setForm((prev) => ({ ...prev, password: "", confirmPassword: "" }));
setForm((prev) => ({ ...prev, password: "", confirmPassword: "" }));
setIsSubmitting(false);

Copilot uses AI. Check for mistakes.
},
);

if (!conversationId && paperId) {
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use of variable 'paperId' always evaluates to true.

Suggested change
if (!conversationId && paperId) {
if (!conversationId) {

Copilot uses AI. Check for mistakes.
@Dynamite2003 Dynamite2003 deleted the issues branch December 24, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants