Skip to content

feat: Add disclaimer for crisis data updates with dismiss functionality - #96

Merged
geeth24 merged 1 commit into
mainfrom
BR-141
Nov 17, 2025
Merged

feat: Add disclaimer for crisis data updates with dismiss functionality#96
geeth24 merged 1 commit into
mainfrom
BR-141

Conversation

@AnishG-git

@AnishG-git AnishG-git commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Introduced a crisis data update disclaimer on the data feed page with an information icon.
    • Users can dismiss the disclaimer using the close button; dismissal preference is remembered across future sessions to prevent re-displaying the alert.

@AnishG-git
AnishG-git requested a review from a team as a code owner November 17, 2025 21:43
@coderabbitai

coderabbitai Bot commented Nov 17, 2025

Copy link
Copy Markdown

Walkthrough

A 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

Cohort / File(s) Summary
Disclaimer Feature
client/app/dashboard/data-feed/page.tsx
Added Info and X icon imports from lucide-react. Introduced showDisclaimer state initialized to true with localStorage logic to read data-feed-disclaimer-dismissed key on mount. Implemented dismissible disclaimer UI panel positioned in the page layout. Dismiss button hides panel and persists state to localStorage.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward state management and localStorage integration with minimal business logic
  • Single file modification with clear, linear control flow
  • Standard UI patterns for dismissible panels

Poem

🐰 A disclaimer blooms upon the feed,
With info icon for those who need,
One click and poof—it fades away,
Remembered well till the next day,
Crisis clarity, neatly dismissed! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: adding a disclaimer UI for crisis data updates with the ability to dismiss it.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BR-141

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.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining why this PR is needed, why this solution was chosen, and what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added enhancement New feature or request version: minor ✨ New features - bumps minor version (1.0.0 → 1.1.0) labels Nov 17, 2025
@github-actions

github-actions Bot commented Nov 17, 2025

Copy link
Copy Markdown

✨ Version Bump Prediction

When this PR is merged to main, the version will be bumped:

1.47.21.48.0 (minor)


💡 How to change the version bump type

The version bump is determined by your commit messages and PR title:

  • Major (2.0.0): Use BREAKING CHANGE: or MAJOR: in title/commits
  • Minor (1.48.0): Use feat: or feature: in title/commits
  • Patch (1.47.3): Use fix:, chore:, docs:, etc.

What I analyzed:

  • PR Title: feat: Add disclaimer for crisis data updates with dismiss functionality
  • Commits: 1 commit(s)

Edit your PR title or commit messages to change the bump type.

@github-actions github-actions Bot added version: minor ✨ New features - bumps minor version (1.0.0 → 1.1.0) and removed version: minor ✨ New features - bumps minor version (1.0.0 → 1.1.0) labels Nov 17, 2025
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment Ready!

Backend: https://api-br-141.private.bluerelief.app
Frontend: https://br-141.private.bluerelief.app
Email Service: https://email-api-br-141.private.bluerelief.app

Commit: 0ced1d4


🔐 Authentication

Demo Login: Click "Google Sign In" → Use demo auth (no Google account needed)
Demo Account: demo@bluerelief.test
Note: Google OAuth not available for preview domains. Demo mode enabled for testing.


✨ Version Bump Prediction

When this PR is merged to main, the version will be bumped:

1.47.21.48.0 (minor)

💡 How to change the version bump type

  • For patch: Use fix:, chore:, docs:, or ci: in commit messages
  • For minor: Use feat: or feature: in commit messages
  • For major: Include BREAKING CHANGE or breaking: in commit messages

Preview will be automatically deleted when PR is closed or merged.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 true and only updates after the useEffect runs.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 405216e and 5778958.

📒 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.

@geeth24
geeth24 merged commit 07ccae1 into main Nov 17, 2025
10 checks passed
@geeth24
geeth24 deleted the BR-141 branch November 17, 2025 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request version: minor ✨ New features - bumps minor version (1.0.0 → 1.1.0)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants