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
unread: Indicate which streams and topics have unread @-mentions. #22583
unread: Indicate which streams and topics have unread @-mentions. #22583
Conversation
2ee493e
to
985fd7f
Compare
985fd7f
to
86cf17b
Compare
86cf17b
to
41f4c79
Compare
de3146e
to
921bc0f
Compare
db946fd
to
6bd9478
Compare
5335ca3
to
51d4a4f
Compare
5c69b44
to
84937a4
Compare
I did some rewriting of this, primarily inspired by the insight that the I'd appreciate your tweaking the tests so that they would fail if we didn't handle case-sensitivity correctly. There's a TODO I added that I'd like you to investigate. |
c0930c5
to
10ad027
Compare
Also can you fix the node test? Might be best done in a new commit we plan to squash, just so it's easy for me to see your changes. |
25bc93e
to
bb62169
Compare
@timabbott , I added a prep commit above and rebased the other commits accordingly and made each individual commit pass the CI, can you please take a look at them now? |
I'm going to test-deploy this on chat.zulip.org. Can you add a proper commit message to the new prep commit explaining why it's correct? Specifically, what code fills in the unread count already? And does the history suggest why this function existed if it's a noop? |
Ahh, Thanks a lot @timabbott for suggesting to look in the history why this function was introduced if it's a noop; I looked through the commits in history and have found something tricky which makes this prep commit buggy; |
f107062
to
068a654
Compare
a76da9d
to
a0a8bd9
Compare
@timabbott , I've updated the PR with completing the TODO added and made the node tests pass for each individual commit; Left some comments above for you to have a look; |
4ddd0fd
to
22a74f2
Compare
Fixes part of zulip#21637. Co-authored-by: Tim Abbott <tabbott@zulip.com>
22a74f2
to
71204ab
Compare
@@ -30,6 +30,7 @@ const scroll_util = mock_esm("../../static/js/scroll_util", { | |||
mock_esm("../../static/js/ui", {get_scroll_element: ($element) => $element}); | |||
mock_esm("../../static/js/unread", { | |||
num_unread_for_stream: () => num_unread_for_stream, | |||
stream_has_any_unread_mentions: () => stream_has_any_unread_mentions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge this, but I think it'd be better to change this test to use the real unread.js
module; it's a data module, so it should be easy to setup with a bit of data for the relevant streams rather than mocking it.
Merged, thanks for doing this @jai2201! Hopefully you've learned a bit about how to do simple but efficient data structures through this project :) |
Fixes: #21637
Screenshots and screen captures:
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: