Conversation
WalkthroughA dismissible disclaimer panel has been added to the data feed page that displays crisis data update information. The panel's visibility persists across sessions using localStorage, automatically hiding if previously dismissed by the user. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Page as Data Feed Page
participant LocalStorage as localStorage
User->>Page: Visit page / Initial load
Page->>LocalStorage: Read 'data-feed-disclaimer-dismissed'
alt Disclaimer not previously dismissed
LocalStorage-->>Page: 'true' or missing
Page->>Page: Set showDisclaimer = true
Page-->>User: Render disclaimer panel
else Disclaimer previously dismissed
LocalStorage-->>Page: 'true'
Page->>Page: Set showDisclaimer = false
Page-->>User: Skip disclaimer rendering
end
User->>Page: Click dismiss button
Page->>Page: Set showDisclaimer = false
Page->>LocalStorage: Store 'data-feed-disclaimer-dismissed' = 'true'
Page-->>User: Hide disclaimer panel
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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 |
✨ Version Bump PredictionWhen this PR is merged to 1.47.2 → 1.48.0 ( 💡 How to change the version bump typeThe version bump is determined by your commit messages and PR title:
What I analyzed:
Edit your PR title or commit messages to change the bump type. |
🚀 Preview Deployment Ready!Backend: https://api-br-141.private.bluerelief.app Commit: 🔐 AuthenticationDemo Login: Click "Google Sign In" → Use demo auth (no Google account needed) ✨ Version Bump PredictionWhen this PR is merged to main, the version will be bumped: 1.47.2 → 1.48.0 (minor) 💡 How to change the version bump type
Preview will be automatically deleted when PR is closed or merged. |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
client/app/dashboard/data-feed/page.tsx (2)
79-79: Consider preventing flash of dismissed disclaimer.The current implementation may briefly show the disclaimer on page load before hiding it if previously dismissed. This happens because the initial state is
trueand only updates after theuseEffectruns.For a smoother UX, consider initializing state from localStorage directly:
- const [showDisclaimer, setShowDisclaimer] = useState(true) + const [showDisclaimer, setShowDisclaimer] = useState(() => { + if (typeof window === 'undefined') return true + return localStorage.getItem('data-feed-disclaimer-dismissed') !== 'true' + })And simplify the useEffect:
async function fetchInitialData() { try { setLoading(true) - const dismissed = typeof window !== 'undefined' ? localStorage.getItem('data-feed-disclaimer-dismissed') : null - if (dismissed === 'true') { - setShowDisclaimer(false) - } const [statusData, overviewData] = await Promise.all([Also applies to: 85-88
226-252: Well-implemented disclaimer with good accessibility.The implementation correctly handles SSR safety, includes proper ARIA labels, and manages localStorage persistence. The UI is clean and the dismiss functionality works as expected.
Optional enhancement: Consider adding keyboard shortcut support for better accessibility:
<Button variant="ghost" size="icon" className="shrink-0 text-muted-foreground hover:text-foreground" aria-label="Dismiss data freshness disclaimer" onClick={() => { setShowDisclaimer(false) if (typeof window !== 'undefined') { localStorage.setItem('data-feed-disclaimer-dismissed', 'true') } }} + onKeyDown={(e) => { + if (e.key === 'Escape') { + setShowDisclaimer(false) + if (typeof window !== 'undefined') { + localStorage.setItem('data-feed-disclaimer-dismissed', 'true') + } + } + }} >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
client/app/dashboard/data-feed/page.tsx(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: deploy
🔇 Additional comments (1)
client/app/dashboard/data-feed/page.tsx (1)
226-252: Inconsistent with AI summary.The AI summary states the disclaimer is "rendered in two locations within the page layout (at the top area and near the header)", but the code shows it's only rendered once at this location.
Summary by CodeRabbit