Fix unnecessary community API calls and improve Link performance

Summary

This MR contains performance improvements for the Denser application:

1. Skip community API calls for non-community tags (Fixes #768 (closed))

When navigating to posts or pages with regular tags (e.g., /test/@user/post or /created/test), the app was unnecessarily calling get_community API which would fail because regular tags are not communities. Communities in Hive always start with the hive- prefix.

Changes:

  • sort-page.tsx: Wrapped community-related prefetch queries (getCommunity, getSubscribers, getAccountNotifications) in a tag.startsWith('hive-') check
  • get-metadata.ts: Added hive- prefix check in getCommunityMetadata() to skip API calls for regular tags
  • page.tsx: Fixed query key inconsistency from ['communityData', community] to ['community', community] for proper cache sharing

2. Add global Link wrapper with prefetch disabled by default

Created a custom Link component that wraps Next.js Link with prefetch={false} by default to reduce unnecessary network requests and improve initial page load performance.

Test plan

  • Navigate to /created/test - should NOT call get_community API
  • Navigate to /test/@guest4test1/6cmabj-test-template - should NOT call get_community API
  • Navigate to /hive-123456/@user/post - SHOULD call get_community API
  • Verify no console errors related to community API calls for regular tags
  • Verify Link components work correctly without prefetching by default

🤖 Generated with Claude Code

Merge request reports

Loading