-
-
Notifications
You must be signed in to change notification settings - Fork 397
feat: red dot indicator for new unread articles #1780
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
Conversation
7c3ee08 to
afc56c6
Compare
|
Thank you for your PR! I’ve noted a few general remarks below.
|
|
Got it thanks. I'll get working on that as soon as I can. The local storage solution should work because it holds the previous key that shows the amount and then every single time the component renders it checks if the new root feed lengths are bigger then whatever key we had. But I understand your idea so I'll work on this other solution. |
|
Getting super super close you can see what I added if your curious, just need to touch it up for the linting, add it to all category, but the core logic is there. Busy with work might get it done in the next week or two. But yea your approach is way better, it looks way better now that it is all in Redux. Ill let you know when im ready for another review to push(ignore the bad formatting for now and logs lol will fix that)! |
Yes, I think it would make sense for the indicator to disappear as soon as the entries are shown/reloaded. If that's the case, when the use revisits CommaFeed later, the entries for the 'All' category will be loaded and the indicator will instantly disappear, so I'm not sure it's actually useful to store anything in the localStorage. I would just set the flag to true when the tree is reloaded or a websocket event is received, and clear the flag as soon as the loadEntries.fulfilled redux event resolves.
Yes, and also intermediate categories if they are collapsed. |
|
Thank you, gonna be busy with work next few days give me up to a week to finish it! |
|
Hey is this better? About 90% done, I did it for all the sub categories, I think of what the last one you said I just have to finish the 'All' category but I want to make sure my logic is good so far and i understand what you mean. Addressing confusion about the 'All' categoryI was confused in terms of what you meant by "when the use revisits CommaFeed later, the entries for the 'All' category will be loaded and the indicator will instantly disappear,"? So when a user clicks a category, comes back later and it reloads, the 'All' indicator will go away? Then what is the point of the indicator for 'All'? I was thinking if any subcategoy is clicked, then the 'All' inidcator will go away as well as that specific subcategories. Since “All” is the default view that loads automatically when CommaFeed starts, wouldn’t that cause the red dot on “All” to disappear immediately — before the user has a chance to notice it? If that's the case, what’s the intended value of showing an indicator for "All"? If you think my confusion comes from not understanding some terminology of the application, please let me know. What I did for the sub categories-I adjusted the code to not use local storage, and it only adjust the hasNewEntries through the redux reducers/thunks/states. -I turn that indicator on with a reducer called 'setHasNewEntries'(a new one i created) in the reducer that handles the websocket to detect if new feeds are created(newFeedEntriesDiscovered thunk). -And then when each sub category is clicked(loadEntries thunk with "entries/load") I clear that flag and set hasNewEntries to false. -And for the all category I think it was pretty simple I just Other QuestionsIs there a way for me to test it? is there any feeds you guys use for testing I would want to see how it looks if a new feed gets a new article but I can't test it. |
|
To clarify, there are two use cases: Use Case 1: Use Case 2: This is why I don’t think persisting anything in localStorage is necessary. Does this make things clearer? If it helps, I can take it from here based on what you did so far. |
|
Yea okay I understood why the local storage is not needed now I get the All stuff. And yea feel free to take it from there, what I did so far is good? Feel free to merge it and work on the rest, id love to have my first official contribution lol. |
sure! |

This is the feature to show the red dot inidcator for new messages, in case that issue gets approved if you guys want to merge it.
And feel free to give me feedback.