opensanctions / opensanctions/poliloom
Add tutorial access from login screen with post-tutorial login hook
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Currently, the tutorial is only shown to logged-in users when they start their first session. This proposal adds the tutorial as a secondary option on the login screen, allowing hesitant users to try the tutorial before committing to login with their credentials.
Motivation
- Users may be hesitant to log in with their MediaWiki credentials before understanding what the app does
- The tutorial is a low-commitment way to experience the app and could serve as a conversion funnel
- There's no technical reason the tutorial requires authentication - it uses mock data
Proposed Changes
1. Add "Try Tutorial" option to login page
File: src/app/login/page.tsx
Add a secondary CTA below the "Sign in with MediaWiki" button:
<Button href="/tutorial" variant="secondary">
Try the Tutorial First
</Button>
Or a text link: "Not ready to sign in? Try the tutorial first"
2. Limit unauthenticated users to basic tutorial only
File: src/app/tutorial/TutorialContent.tsx
Unauthenticated users should only see the basic tutorial (steps 0-13). They cannot access advanced mode settings, so the advanced tutorial (steps 14-19) should be skipped.
- When calculating total steps, use
BASIC_END(13) for unauthenticated users - After step 13, show the completion screen instead of continuing to advanced steps
- Progress indicator should reflect basic-only step count
3. Add post-tutorial login hook for unauthenticated users
File: src/app/tutorial/TutorialContent.tsx
When the tutorial completes and the user is NOT authenticated, show a completion screen with a login CTA:
if (isComplete) {
if (!isAuthenticated) {
content = (
<CenteredCard emoji="🎉" title="Tutorial Complete!">
<p>You're ready to start verifying real politician data!</p>
<p className="text-gray-600">Sign in with your MediaWiki account to begin evaluating and contributing to data quality.</p>
<Button onClick={() => signIn('wikimedia')} size="large" fullWidth>
Sign in to Start Evaluating
</Button>
<Button href="/" variant="secondary" size="large" fullWidth>
Maybe Later
</Button>
</CenteredCard>
)
} else {
// Existing authenticated completion screen
}
}
4. Update skip tutorial behavior for unauthenticated users
Files: src/app/tutorial/_components/TutorialActions.tsx, TutorialFooter.tsx
When an unauthenticated user clicks "Skip Tutorial", redirect them to the login page instead of /evaluate:
const skipHref = isAuthenticated ? '/evaluate' : '/login'
Implementation Notes
- Use
useAuthSession()hook fromsrc/hooks/useAuthSession.tsto check authentication status - The tutorial already works for unauthenticated users (no API calls required)
- Tutorial completion is stored in localStorage, so it persists even if users don't log in immediately
- Unauthenticated users only see basic tutorial (steps 0-13) since advanced mode is not available to them
Files to Modify
src/app/login/page.tsx- Add tutorial CTAsrc/app/tutorial/TutorialContent.tsx- Add auth check, limit to basic tutorial for unauth users, add auth-aware completion screensrc/app/tutorial/_components/TutorialActions.tsx- Update skip behavior based on authsrc/app/tutorial/_components/TutorialFooter.tsx- Update skip behavior based on auth
Acceptance Criteria
- Login page shows a secondary option to try the tutorial
- Unauthenticated users can complete the basic tutorial (steps 0-13 only)
- Unauthenticated users do NOT see advanced tutorial steps (14-19)
- Tutorial completion screen for unauthenticated users encourages login
- Skip tutorial redirects unauthenticated users to login page
- Tutorial completion state is preserved if user logs in later
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/app/login/page.tsx and the authentication flow from src/hooks/useAuthSession.ts, then trace step limits and completion handling in src/app/tutorial/TutorialContent.tsx. Check skip handling in TutorialActions.tsx and TutorialFooter.tsx. Done means unauthenticated users can complete only steps 0–13, reach a login CTA, skip to /login, and preserve completion state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authentication, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100