Skip to content

Commit e4807d5

Browse files
committed
improvements to timeline peer review, settings, login screen
1 parent f6051c5 commit e4807d5

6 files changed

Lines changed: 314 additions & 284 deletions

File tree

package-lock.json

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

papers2code-ui/src/App.tsx

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -187,59 +187,63 @@ function App() {
187187
window.location.reload();
188188
};
189189

190+
const isLoginPage = location.pathname === '/login';
191+
190192
// 3. Wrap your existing providers and components with QueryClientProvider
191193
return (
192194
<QueryClientProvider client={queryClient}>
193195
<ModalProvider>
194196
<AuthInitializer />
195-
<div className="flex flex-col min-h-screen w-full max-w-full box-border relative before:content-[''] before:fixed before:inset-0 before:w-full before:h-full before:pointer-events-none before:opacity-40 before:bg-[radial-gradient(var(--gradient-accent)_1px,transparent_1px),radial-gradient(var(--gradient-accent)_1px,transparent_1px)] before:bg-[length:40px_40px] before:bg-[0_0,20px_20px] before:z-[-1]">
196-
<GlobalHeader currentUser={currentUser} handleLogout={handleLogout} />
197-
<main className="flex-grow p-0 w-full box-border flex flex-col items-stretch justify-start relative overflow-y-auto overflow-x-hidden before:content-[''] before:absolute before:top-0 before:left-0 before:w-full before:h-[200px] before:bg-gradient-to-b before:from-[rgba(25,124,154,0.03)] before:to-transparent before:z-[-1] before:pointer-events-none">
198-
<ErrorBoundary>
199-
<Suspense fallback={null}>
200-
<Routes>
201-
<Route path="/" element={<LandingPage />} />
202-
<Route path="/login" element={<LoginPage />} />
203-
<Route
204-
path="/papers"
205-
element={
206-
<PaperListErrorBoundary>
207-
<PaperListPage authLoading={authLoading} currentUser={currentUser} />
208-
</PaperListErrorBoundary>
209-
}
210-
/>
211-
<Route
212-
path="/paper/:paperId"
213-
element={
214-
<PaperDetailErrorBoundary>
215-
<PaperDetailPage currentUser={currentUser} />
216-
</PaperDetailErrorBoundary>
217-
}
218-
/>
219-
<Route path="/dashboard" element={<Dashboard />} />
220-
<Route path="/user/:github_username" element={<ProfilePage />} />
221-
<Route path="*" element={<NotFoundPage />} />
222-
</Routes>
223-
</Suspense>
224-
</ErrorBoundary>
225-
</main>
226-
<LoginPromptModal />
227-
228-
{/* Account Link Modal */}
229-
{linkModalData && (
230-
<AccountLinkModal
231-
open={showLinkModal}
232-
onClose={() => setShowLinkModal(false)}
233-
existingAccount={linkModalData.existingAccount}
234-
newAccount={linkModalData.newAccount}
235-
onConfirm={handleLinkAccounts}
236-
onCancel={handleKeepSeparate}
237-
/>
238-
)}
239-
197+
<div className={`flex flex-col w-full max-w-full box-border relative before:content-[''] before:fixed before:inset-0 before:w-full before:h-full before:pointer-events-none before:opacity-40 before:bg-[radial-gradient(var(--gradient-accent)_1px,transparent_1px),radial-gradient(var(--gradient-accent)_1px,transparent_1px)] before:bg-[length:40px_40px] before:bg-[0_0,20px_20px] before:z-[-1] ${isLoginPage ? 'h-screen overflow-hidden' : 'min-h-screen'}`}>
198+
<GlobalHeader currentUser={currentUser} handleLogout={handleLogout} />
199+
<main className={`flex-grow p-0 w-full box-border flex flex-col items-stretch justify-start relative ${isLoginPage ? 'overflow-hidden' : 'overflow-y-auto overflow-x-hidden'} before:content-[''] before:absolute before:top-0 before:left-0 before:w-full before:h-[200px] before:bg-gradient-to-b before:from-[rgba(25,124,154,0.03)] before:to-transparent before:z-[-1] before:pointer-events-none`}>
200+
<ErrorBoundary>
201+
<Suspense fallback={null}>
202+
<Routes>
203+
<Route path="/" element={<LandingPage />} />
204+
<Route path="/login" element={<LoginPage />} />
205+
<Route
206+
path="/papers"
207+
element={
208+
<PaperListErrorBoundary>
209+
<PaperListPage authLoading={authLoading} currentUser={currentUser} />
210+
</PaperListErrorBoundary>
211+
}
212+
/>
213+
<Route
214+
path="/paper/:paperId"
215+
element={
216+
<PaperDetailErrorBoundary>
217+
<PaperDetailPage currentUser={currentUser} />
218+
</PaperDetailErrorBoundary>
219+
}
220+
/>
221+
<Route path="/dashboard" element={<Dashboard />} />
222+
<Route path="/user/:github_username" element={<ProfilePage />} />
223+
<Route path="*" element={<NotFoundPage />} />
224+
</Routes>
225+
</Suspense>
226+
</ErrorBoundary>
227+
</main>
228+
<LoginPromptModal />
229+
230+
{/* Account Link Modal */}
231+
{linkModalData && (
232+
<AccountLinkModal
233+
open={showLinkModal}
234+
onClose={() => setShowLinkModal(false)}
235+
existingAccount={linkModalData.existingAccount}
236+
newAccount={linkModalData.newAccount}
237+
onConfirm={handleLinkAccounts}
238+
onCancel={handleKeepSeparate}
239+
/>
240+
)}
241+
242+
{!isLoginPage && (
240243
<footer className="bg-[rgba(241,243,245,0.8)] text-[var(--text-muted-color)] text-center py-4 text-sm border-t border-[var(--border-color-light)]">
241244
</footer>
242-
</div>
245+
)}
246+
</div>
243247
</ModalProvider>
244248
</QueryClientProvider>
245249
);

papers2code-ui/src/features/auth/LoginPage.tsx

Lines changed: 79 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,72 +18,97 @@ const LoginPage: React.FC = () => {
1818
};
1919

2020
return (
21-
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-background to-muted/20">
22-
<div className="w-full max-w-sm px-4">
23-
{/* Logo and Title */}
24-
<div className="text-center mb-6">
25-
<div className="flex justify-center mb-3">
21+
<div className="h-full w-full flex bg-background overflow-hidden">
22+
{/* Left Side - Branding */}
23+
<div className="hidden lg:flex lg:w-1/2 bg-gradient-to-br from-primary/10 via-primary/5 to-background relative overflow-hidden">
24+
<div className="absolute inset-0 bg-grid-pattern opacity-[0.02]" />
25+
<div className="relative z-10 flex flex-col items-center justify-center w-full px-12">
26+
<img
27+
src={logo}
28+
alt="Papers2Code"
29+
className="h-20 w-auto mb-8"
30+
/>
31+
<p className="text-lg text-muted-foreground text-center max-w-md">
32+
Bridging the gap between research papers and production-ready code
33+
</p>
34+
</div>
35+
</div>
36+
37+
{/* Right Side - Login Form */}
38+
<div className="flex-1 flex items-center justify-center px-4 sm:px-6 lg:px-8">
39+
<div className="w-full max-w-md">
40+
{/* Mobile Logo */}
41+
<div className="lg:hidden flex justify-center mb-4">
2642
<img
2743
src={logo}
2844
alt="Papers2Code"
29-
className="h-12 w-auto"
45+
className="h-10 w-auto"
3046
/>
3147
</div>
32-
<h1 className="text-2xl font-bold mb-1">Welcome Back</h1>
33-
<p className="text-sm text-muted-foreground">
34-
Sign in to continue
35-
</p>
36-
</div>
3748

38-
{/* Login Options Card */}
39-
<div className="bg-card border rounded-lg shadow-sm p-6 space-y-3">
40-
{/* GitHub Login Button */}
41-
<Button
42-
onClick={handleGitHubLogin}
43-
variant="default"
44-
className="w-full h-10 gap-2"
45-
>
46-
<Github className="h-4 w-4" />
47-
<span>Continue with GitHub</span>
48-
</Button>
49+
{/* Title */}
50+
<div className="text-center mb-4">
51+
<h2 className="text-3xl font-bold mb-2">Welcome Back</h2>
52+
<p className="text-muted-foreground text-sm">
53+
Sign in to continue to Papers2Code
54+
</p>
55+
</div>
4956

50-
{/* Divider */}
51-
<div className="relative my-3">
52-
<div className="absolute inset-0 flex items-center">
53-
<div className="w-full border-t"></div>
54-
</div>
55-
<div className="relative flex justify-center text-xs">
56-
<span className="bg-card px-2 text-muted-foreground">or</span>
57+
{/* Login Card */}
58+
<div className="bg-card border rounded-xl shadow-lg p-6 space-y-4">
59+
{/* GitHub Login Button */}
60+
<Button
61+
onClick={handleGitHubLogin}
62+
variant="default"
63+
size="lg"
64+
className="w-full gap-3 h-12 text-base font-medium"
65+
>
66+
<Github className="h-5 w-5" />
67+
<span>Continue with GitHub</span>
68+
</Button>
69+
70+
{/* Divider */}
71+
<div className="relative my-4">
72+
<div className="absolute inset-0 flex items-center">
73+
<div className="w-full border-t border-border"></div>
74+
</div>
75+
<div className="relative flex justify-center text-sm">
76+
<span className="bg-card px-3 text-muted-foreground font-medium">or</span>
77+
</div>
5778
</div>
58-
</div>
5979

60-
{/* Google Login Button */}
61-
<Button
62-
onClick={handleGoogleLogin}
63-
variant="outline"
64-
className="w-full h-10 gap-2"
65-
>
66-
<GoogleIcon size={16} />
67-
<span>Continue with Google</span>
68-
</Button>
80+
{/* Google Login Button */}
81+
<Button
82+
onClick={handleGoogleLogin}
83+
variant="outline"
84+
size="lg"
85+
className="w-full gap-3 h-12 text-base font-medium"
86+
>
87+
<GoogleIcon size={20} />
88+
<span>Continue with Google</span>
89+
</Button>
6990

70-
{/* Feature Access Info */}
71-
<div className="mt-4 pt-4 border-t">
72-
<p className="text-xs text-muted-foreground text-center">
73-
GitHub accounts have full access. Google accounts can vote and view papers.
74-
Link both for complete features.
75-
</p>
91+
{/* Feature Access Info */}
92+
<div className="mt-4 pt-4 border-t border-border">
93+
<div className="bg-muted/50 rounded-lg p-3">
94+
<p className="text-xs text-muted-foreground leading-relaxed">
95+
<span className="font-semibold text-foreground">GitHub accounts</span> have full access.
96+
<span className="font-semibold text-foreground"> Google accounts</span> can vote and view papers.
97+
Link both for complete features.
98+
</p>
99+
</div>
100+
</div>
76101
</div>
77-
</div>
78102

79-
{/* Footer */}
80-
<div className="mt-6 text-center">
81-
<button
82-
onClick={() => navigate('/')}
83-
className="text-xs text-muted-foreground hover:text-foreground transition-colors"
84-
>
85-
← Back to home
86-
</button>
103+
{/* Footer */}
104+
<div className="mt-4 text-center">
105+
<button
106+
onClick={() => navigate('/')}
107+
className="text-sm text-muted-foreground hover:text-foreground transition-colors inline-flex items-center gap-2"
108+
>
109+
← Back to home
110+
</button>
111+
</div>
87112
</div>
88113
</div>
89114
</div>

papers2code-ui/src/features/paper-detail/Tabs/ImplementationProgress/HorizontalTimeline.tsx

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -111,36 +111,20 @@ const COMMUNITY_PATH_STEPS: JourneyStep[] = [
111111
order: 4,
112112
path: 'community',
113113
},
114-
{
115-
id: 'implementation_complete',
116-
title: 'Implementation Complete',
117-
description: 'Community implementation is complete.',
118-
icon: CheckCircle,
119-
order: 5,
120-
path: 'community',
121-
},
122114
{
123115
id: 'peer_review_required',
124116
title: 'Peer Review Required',
125-
description: 'Awaiting peer review from non-contributor.',
117+
description: 'Implementation complete, awaiting peer review.',
126118
icon: Clock,
127-
order: 6,
128-
path: 'community',
129-
},
130-
{
131-
id: 'peer_review_approved',
132-
title: 'Peer Review Approved',
133-
description: 'Implementation has been reviewed and approved.',
134-
icon: ShieldCheck,
135-
order: 7,
119+
order: 5,
136120
path: 'community',
137121
},
138122
{
139123
id: 'code_completed',
140124
title: 'Official Code Posted',
141-
description: 'Community implementation is verified and published.',
125+
description: 'Community implementation reviewed and published.',
142126
icon: CheckCircle,
143-
order: 8,
127+
order: 6,
144128
path: 'community',
145129
},
146130
];
@@ -155,6 +139,31 @@ export const HorizontalTimeline: React.FC<HorizontalTimelineProps> = ({ progress
155139
}
156140

157141
// Check which path based on status
142+
// Check for community path first (including community that reaches OFFICIAL_CODE_POSTED)
143+
const hasCommunityPath = progress.updates.some(u =>
144+
u.eventType === UpdateEventType.STATUS_CHANGED &&
145+
u.details?.newStatus &&
146+
(u.details.newStatus === ProgressStatus.REFUSED_TO_UPLOAD ||
147+
u.details.newStatus === ProgressStatus.NO_RESPONSE ||
148+
u.details.newStatus === ProgressStatus.GITHUB_CREATED ||
149+
u.details.newStatus === ProgressStatus.PEER_REVIEW_REQUIRED ||
150+
u.details.newStatus === ProgressStatus.PEER_REVIEW_IN_PROGRESS ||
151+
u.details.newStatus === ProgressStatus.PEER_REVIEW_APPROVED)
152+
);
153+
154+
if (hasCommunityPath) {
155+
return 'community';
156+
}
157+
158+
if (progress.status === ProgressStatus.REFUSED_TO_UPLOAD ||
159+
progress.status === ProgressStatus.NO_RESPONSE ||
160+
progress.status === ProgressStatus.GITHUB_CREATED ||
161+
progress.status === ProgressStatus.PEER_REVIEW_REQUIRED ||
162+
progress.status === ProgressStatus.PEER_REVIEW_IN_PROGRESS ||
163+
progress.status === ProgressStatus.PEER_REVIEW_APPROVED) {
164+
return 'community';
165+
}
166+
158167
if (progress.status === ProgressStatus.OFFICIAL_CODE_POSTED || progress.status === ProgressStatus.CODE_UPLOADED) {
159168
// Check if we went through refactoring
160169
const hasRefactoring = progress.updates.some(u =>
@@ -179,16 +188,6 @@ export const HorizontalTimeline: React.FC<HorizontalTimelineProps> = ({ progress
179188
return 'refactoring';
180189
}
181190

182-
if (progress.status === ProgressStatus.REFUSED_TO_UPLOAD ||
183-
progress.status === ProgressStatus.NO_RESPONSE ||
184-
progress.status === ProgressStatus.GITHUB_CREATED ||
185-
progress.status === ProgressStatus.IMPLEMENTATION_COMPLETE ||
186-
progress.status === ProgressStatus.PEER_REVIEW_REQUIRED ||
187-
progress.status === ProgressStatus.PEER_REVIEW_IN_PROGRESS ||
188-
progress.status === ProgressStatus.PEER_REVIEW_APPROVED) {
189-
return 'community';
190-
}
191-
192191
// Default to community path for future steps display
193192
return 'community';
194193
}, [progress]);
@@ -365,15 +364,9 @@ function mapUpdateToJourneyStep(eventType: UpdateEventType, currentStatus: Progr
365364
if (newStatus === ProgressStatus.GITHUB_CREATED) {
366365
return 'github_created';
367366
}
368-
if (newStatus === ProgressStatus.IMPLEMENTATION_COMPLETE) {
369-
return 'implementation_complete';
370-
}
371367
if (newStatus === ProgressStatus.PEER_REVIEW_REQUIRED) {
372368
return 'peer_review_required';
373369
}
374-
if (newStatus === ProgressStatus.PEER_REVIEW_APPROVED) {
375-
return 'peer_review_approved';
376-
}
377370
}
378371
return null;
379372
case UpdateEventType.GITHUB_REPO_LINKED:
@@ -382,10 +375,13 @@ function mapUpdateToJourneyStep(eventType: UpdateEventType, currentStatus: Progr
382375
currentStatus === ProgressStatus.REFACTORING_STARTED) {
383376
return 'code_needs_refactoring';
384377
}
385-
if (currentStatus === ProgressStatus.GITHUB_CREATED) {
378+
// For community path, linking a repo counts as github_created
379+
if (currentStatus === ProgressStatus.GITHUB_CREATED ||
380+
currentStatus === ProgressStatus.REFUSED_TO_UPLOAD ||
381+
currentStatus === ProgressStatus.NO_RESPONSE) {
386382
return 'github_created';
387383
}
388-
return null;
384+
return 'github_created'; // Default to github_created for any repo linking
389385
default:
390386
return null;
391387
}

0 commit comments

Comments
 (0)