-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add community promo toast and rename Forum to Community #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add a toast notification encouraging users to visit the community forum 3 days after their first login. The toast only appears for authenticated users who haven't yet linked their Discourse account (forum_username is null), and is persisted via localStorage so it only shows once. Key changes: - New useCommunityPromoToast hook with comprehensive guard conditions - Toast integrates with shadcn/ui toast system for consistent styling - Smooth slide-in-from-bottom animation (300ms duration) - Toast stays open until user dismisses or clicks action button - Avoids overlap with PWA install banner - Includes test mode via localStorage for easier testing Also renames "Forum" to "Community" throughout the app: - Navigation sidebar label - Profile modal field label and helper text - Associated tests Additionally adds favicon to website HTML pages to match the app. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (feature/community-promo-toast) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
==========================================
+ Coverage 86.83% 86.91% +0.07%
==========================================
Files 116 117 +1
Lines 14565 14684 +119
Branches 2238 2262 +24
==========================================
+ Hits 12647 12762 +115
- Misses 1918 1922 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Pull Request ReviewSummaryThis PR adds a community promotion toast notification, renames "Forum" to "Community" throughout the app, and adds favicons to website pages. Overall, the implementation is well-structured with excellent test coverage. I have some recommendations to improve code quality and address potential issues. ✅ Strengths1. Excellent Test Coverage
2. Good Architecture
3. User Experience
|
- Fix potential memory leak by clearing timeout before scheduling new one - Remove duplicate localStorage write (now handled only via onOpenChange) - Fix onOpenChange order in use-toast.ts (call custom handler before dismiss) - Add popup blocker handling with console warning - Add missing tests: unmount cleanup and popup blocker handling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pull Request ReviewThis PR adds a community promo toast notification and renames "Forum" to "Community" throughout the app. Overall, this is a well-implemented feature with excellent test coverage and thoughtful UX considerations. Here's my detailed feedback: ✅ Strengths1. Excellent Test Coverage (309 lines!)The
2. Thoughtful UX Design
3. Clean Hook Implementation
4. Accessibility Considerations
5. Improved Toast UI
🔍 Issues & Suggestions1. Critical:
|
- Reset hasScheduledRef on unmount so remounting can re-schedule toast - Add comment explaining dependency array (isTestMode is intentionally not a dep) - Optimize favicon: remove explicit width/height, keep only viewBox for scalability Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pull Request Review - PR #160SummaryThis PR adds a community promo toast notification system and renames "Forum" to "Community" throughout the app. The implementation is well-thought-out with excellent test coverage and attention to UX details. ✅ Strengths1. Excellent Code Quality
2. Outstanding Test CoverageThe test file (src/hooks/useCommunityPromoToast.test.ts) is exceptional:
3. Smart UX Considerations
4. Performance Optimizations
5. Accessibility
6. Design System Compliance
🔍 Observations & Minor Suggestions1. Toast UI Refinements (src/components/ui/toast.tsx)The toast styling updates are good, but consider:
const baseClasses = "group pointer-events-auto relative flex...";
const animationClasses = "data-[state=open]:animate-in data-[state=open]:fade-in-0...";
const toastVariants = cva([baseClasses, animationClasses].join(' '), {2. ToastClose Styling Change (src/components/ui/toast.tsx:70)
3. Toaster Layout Restructure (src/components/ui/toaster.tsx)The new layout is cleaner, but the action button placement changed:
4. Hook Dependency Array (useCommunityPromoToast.ts:122)The comment at lines 120-122 mentions 5. Cleanup Effect Dependency Array (useCommunityPromoToast.ts:125)The cleanup effect has an empty dependency array, which means it only runs on unmount. The comment suggests remounting allows re-scheduling, but // Reset on unmount so the hook can schedule again if component remounts
// (only if localStorage wasn't set, preventing duplicate toasts)🐛 Potential Issues1. Race Condition with Profile Data (AppLayout.tsx:84-88)The hook is called with
Current behavior: The Suggested fix: Add profile loading state to the conditions or ensure profile loads before AppLayout mounts. Check if 2. localStorage Timing Issue (useCommunityPromoToast.ts:113-116)The Current: Toast persists across page loads until user dismisses If current behavior is intended, it's fine. Just flagging for consideration. 3. Window.open Popup Blocker (useCommunityPromoToast.ts:98-103)The popup blocker handling is good, but the toast stays open after onClick: () => {
const newWindow = window.open(COMMUNITY_URL, '_blank', 'noopener,noreferrer');
if (!newWindow) {
console.warn('Popup blocked. Please allow popups to visit the community forum.');
}
// Auto-dismiss toast after click (will trigger onOpenChange)
return true; // or call dismiss() if available
}Currently, clicking the button opens the link but leaves the toast visible. User must manually click X. 🔒 Security Review✅ No Security Concerns Identified
🎨 Design System Compliance✅ Follows CLAUDE.md Guidelines
Minor Note: Toast StylingThe toast now uses 🧪 Testing AssessmentExcellent Test Coverage ✅The test suite is exemplary:
Suggested Additional TestConsider adding a test for the profile loading race condition mentioned above: it('does not show toast if profile loads late with forum_username', () => {
const { rerender } = renderHook(
({ forumUsername }) => useCommunityPromoToast({
userCreatedAt: getDateDaysAgo(5),
forumUsername,
isAuthenticated: true
}),
{ initialProps: { forumUsername: null } }
);
vi.advanceTimersByTime(1000); // Before toast shows
rerender({ forumUsername: 'late_loaded_user' });
vi.advanceTimersByTime(1000); // After profile loads
expect(mockToast).not.toHaveBeenCalled();
});📝 Naming Changes Review"Forum" → "Community" Rename ✅
🌐 Website Favicon Addition✅ Good Addition
NoteVerify the SVG renders correctly across all browsers. Some older browsers might need a PNG fallback. 📊 Performance ImpactMinimal Performance Impact ✅
🎯 Recommendations PriorityHigh Priority
Medium Priority
Low Priority (Optional)
✅ Final VerdictAPPROVE with minor suggestions This is high-quality work with exceptional attention to detail:
The code is production-ready. The suggestions above are minor improvements that can be addressed in a follow-up PR if desired. Great work! 🎉 Reviewed with Claude Code |
Summary
Community Promo Toast: New toast notification encouraging users to visit the community forum
forum_usernameis null)localStorage.setItem('community-toast-test-mode', 'true')for easier testingRename "Forum" → "Community": Updated navigation sidebar, profile modal, and associated tests
Website Favicon: Added favicon.svg to all website HTML pages to match the app
Test plan
localStorage.setItem('community-toast-test-mode', 'true'))npm run test:run🤖 Generated with Claude Code