Skip to content

feat: display unread count in sidebar #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged

feat: display unread count in sidebar #147

merged 2 commits into from
Apr 25, 2025

Conversation

0x2E
Copy link
Owner

@0x2E 0x2E commented Apr 25, 2025

image

Fix #125

@0x2E 0x2E requested a review from Copilot April 25, 2025 05:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the unread count functionality to be displayed in the sidebar by including the unread_count field in the API responses and propagating the data through to the frontend view.

  • Added unread_count to FeedForm in server/feed_form.go
  • Modified repo/feed.go to aggregate unread item counts and integrate them into the Feed model
  • Updated frontend/src/lib/api/model.ts to reflect the new unread_count field

Reviewed Changes

Copilot reviewed 6 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
server/feed_form.go Added unread_count to the FeedForm struct
server/feed.go Passed through unread_count when constructing responses
repo/feed.go Aggregated unread count from items and updated Feed
model/feed.go Introduced UnreadCount field in the Feed model
frontend/src/lib/api/model.ts Updated TS model to include unread_count
Files not reviewed (4)
  • frontend/package.json: Language not supported
  • frontend/pnpm-lock.yaml: Language not supported
  • frontend/src/lib/components/Sidebar.svelte: Language not supported
  • go.mod: Language not supported

Comment on lines +46 to +47
// count unread items of each feed.
// yeah this is stupid, but I don't know how to do it in a single query using GORM.
Copy link
Preview

Copilot AI Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider revising this comment to use more professional language, for example: 'Using multiple queries due to current GORM limitations.'

Suggested change
// count unread items of each feed.
// yeah this is stupid, but I don't know how to do it in a single query using GORM.
// Count unread items of each feed.
// Using multiple queries due to current GORM limitations.

Copilot uses AI. Check for mistakes.

@0x2E 0x2E merged commit 103ece6 into main Apr 25, 2025
1 check passed
@0x2E 0x2E deleted the group_items branch April 25, 2025 05:31
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.

[FR] Notifications on the sidebar for new articles
1 participant