Skip to content

Feature/offline support#1328

Closed
Nareshkumawat-star wants to merge 6 commits into
SB2318:mainfrom
Nareshkumawat-star:feature/offline-support
Closed

Feature/offline support#1328
Nareshkumawat-star wants to merge 6 commits into
SB2318:mainfrom
Nareshkumawat-star:feature/offline-support

Conversation

@Nareshkumawat-star

Copy link
Copy Markdown

PR Description

This PR introduces robust offline support, an animated connectivity indicator, and smart data caching so users can continue reading articles even when they lose their internet connection.

Key Changes:

  • Connectivity Indicator (OfflineBanner.tsx): A global, animated banner that slides down to inform the user when they are offline.
  • Network Hook (useNetworkStatus.ts): Created a clean hook wrapped around @react-native-community/netinfo with full unit test coverage.
  • Smart Caching (CacheUtils.ts): All successful API responses for Paginated Articles, Article Details, and Article Content are now securely cached locally using AsyncStorage.
  • API Fallbacks: Modified React Query queryFn implementations for all core article hooks to gracefully catch network errors or offline states and automatically serve cached data instead of crashing or showing infinite spinners.
  • Auto-Refresh Data (AppContent.tsx): The app monitors network state transitions; when transitioning from offline to online, it silently invalidates all queries to fetch the latest content in the background.
  • Graceful Empty States (HomeScreen.tsx & ArticleScreen.tsx): If the user is completely offline and there is no cached data available for a particular view, they are presented with a friendly Offline UI state rather than a blank screen or a loading skeleton.

Type of Change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update

Select your work-area

  • Frontend
  • Backend
  • Documentation
  • Others

Related Issue

N/A

Fixes #1273

Checklist

  • I have updated my branch and synced it with the project's 'develop' branch before making this PR.
  • I have optimized the file changes.
  • I have added a snapshot of my work example.
  • I have made a PR to the project's develop branch.

Undertaking

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thank you @, for creating the PR and contributing to our UltimateHealth project 💗.
Our team will review the PR and will reach out to you soon! 😇
Make sure that you have marked all the tasks that you are done with ✅.
Thank you for your patience! 😀

@SB2318 SB2318 added gssoc and removed gssoc labels Jun 9, 2026
@SB2318 SB2318 closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💡[Feature]: Add Offline Mode & No-Internet State Handling

2 participants