Skip to content

Conversation

nazgu1
Copy link
Contributor

@nazgu1 nazgu1 commented Sep 5, 2025

Pull to Refresh Implementation for iOS PWA

Addresses #173. This implementation provides native-like pull-to-refresh for iOS PWA environments.

Remarks

  • Automatically detects and activates only on iOS PWA environments
  • Styled to match the app's existing design system
  • Only displays and functions on compatible devices/environments

Implementation Details

The component detects iOS PWA environment by checking:

  • iOS user agent (/iPad|iPhone|iPod/)
  • Standalone display mode (window.matchMedia('(display-mode: standalone)'))
  • WebApp mode (navigator.standalone)
  • Excludes regular Safari browsing

The component has been integrated into:

  • Main unread items page (/)
  • All items page (/all)
  • Bookmarks page (/bookmarks)
  • Individual feed pages (/feeds/[id])
  • Group pages (/groups/[id])

Each integration uses the appropriate refresh strategy:

  • Main pages: Refresh all feeds (refreshFeeds({ all: true }))
  • Individual feeds: Refresh specific feed (refreshFeeds({ id: feed.id }))

Usage

<script lang="ts">
  import { invalidateAll } from '$app/navigation';
  import { refreshFeeds } from '$lib/api/feed.js';
  import PullToRefresh from '$lib/components/PullToRefresh.svelte';

  async function handleRefresh() {
    ...
  }
</script>

<PullToRefresh onRefresh={handleRefresh}>
  <!-- Your page content -->
</PullToRefresh>

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.

1 participant