From e216c3bc97994b4172d15d52b46d5f6b75f35ea4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 13 Feb 2026 22:01:12 +0900 Subject: feat: add feed sidebar and cursor-based pagination Add a feed sidebar to /unread and /read pages for filtering articles by feed, and replace the fixed 100-article limit with cursor-based pagination using a "Load more" button. Backend: - Add PageInfo, ArticleConnection types and pagination args to GraphQL - Replace GetUnreadArticles/GetReadArticles with parameterized queries - Add GetFeedUnreadCounts query and composite index - Add shared pagination helper in resolver Frontend: - Add FeedSidebar component with unread count badges - Add usePaginatedArticles hook for cursor-based fetching - Update ArticleList with Load more button and single-feed mode - Use ?feed= query parameter for feed filtering Co-Authored-By: Claude Opus 4.6 --- frontend/src/graphql/queries.graphql | 57 +++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 24 deletions(-) (limited to 'frontend/src/graphql/queries.graphql') diff --git a/frontend/src/graphql/queries.graphql b/frontend/src/graphql/queries.graphql index d08140b..0b0e25c 100644 --- a/frontend/src/graphql/queries.graphql +++ b/frontend/src/graphql/queries.graphql @@ -5,41 +5,50 @@ query GetFeeds { title fetchedAt isSubscribed - articles { - id - isRead - } + unreadCount } } -query GetUnreadArticles { - unreadArticles { - id - feedId - guid - title - url - isRead - feed { +query GetUnreadArticles($feedId: ID, $after: ID, $first: Int) { + unreadArticles(feedId: $feedId, after: $after, first: $first) { + articles { id + feedId + guid title - isSubscribed + url + isRead + feed { + id + title + isSubscribed + } + } + pageInfo { + hasNextPage + endCursor } } } -query GetReadArticles { - readArticles { - id - feedId - guid - title - url - isRead - feed { +query GetReadArticles($feedId: ID, $after: ID, $first: Int) { + readArticles(feedId: $feedId, after: $after, first: $first) { + articles { id + feedId + guid title - isSubscribed + url + isRead + feed { + id + title + isSubscribed + } + } + pageInfo { + hasNextPage + endCursor } } } -- cgit v1.3-1-g0d28