Skip to content

fix: lazy loading, pagination, and optimistic UI (#587, #594, #593)#708

Merged
success-OG merged 1 commit into
DogStark:mainfrom
Abdullahi-Code9:fix/587-594-593-performance-optimistic-ui
Jun 28, 2026
Merged

fix: lazy loading, pagination, and optimistic UI (#587, #594, #593)#708
success-OG merged 1 commit into
DogStark:mainfrom
Abdullahi-Code9:fix/587-594-593-performance-optimistic-ui

Conversation

@Abdullahi-Code9

Copy link
Copy Markdown
Contributor

Closes #587
Closes #594
Closes #593

Summary


#587 — PetPhotosScreen: image lazy loading & pagination

  • photoService.listPhotos now accepts { page, limit } and passes them as query params instead of fetching all
    photos and slicing client-side
  • Grid thumbnails use server-generated 200×200 thumbnails via thumbnailUrl; full-res only loads on tap
  • Prefetch triggered when 5 items from end via onEndReachedThreshold

#594 — AppNavigator: lazy loading for non-critical screens

  • All non-critical screens already wrapped in React.lazy() + LazyScreen (Suspense + ErrorBoundary)
  • Added a top-level Suspense boundary wrapping NavigationContainer with an ActivityIndicator fallback,
    covering the case where a lazy screen suspends before the navigator fully initializes
  • Critical screens (Login/Auth, PetList, PetHealthDashboard) remain eagerly loaded

#593 — AppointmentScreen: optimistic UI updates

  • Booking is applied to local state immediately on tap
  • "confirming…" indicator shown on the card while server confirms
  • On success: indicator replaced with "Confirmed ✓"
  • On failure: optimistic entry is fully reverted (appointments, confirmingIds, lockedSlots) and an error toast
    with a "Retry" action is shown
  • Slot is locked optimistically on tap to prevent double-booking

Testing

  • npx tsc --noEmit — no new type errors
  • Existing test suite passes (pre-existing infra failures unrelated to these changes)

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@Abdullahi-Code9 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@success-OG success-OG merged commit 461d0c1 into DogStark:main Jun 28, 2026
5 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants