-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Handle internal links #708
Conversation
1865ad0
to
90a7016
Compare
I was meaning to change the |
90a7016
to
a2d980f
Compare
7c4d7df
to
3a0dade
Compare
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.
@preetmishra Reviewed the first three commits and left one comment. Besides that the first 3 commits look good if we want to merge them separately.
3a0dade
to
1223ad1
Compare
@sumanthvrao Thanks for the review. As discussed in the PM, the first three commits are merged! 🎉 I have pushed a rebased version for further review. |
1223ad1
to
f03ef65
Compare
Hello @preetmishra, it seems like you have referenced #352 in your pull request description, but you have not referenced them in your commit message description(s). When you reference an issue in a commit message, it automatically closes the corresponding issue when the commit is merged. Please run An example of a correctly-formatted commit:
Thank you for your contributions to Zulip! |
Updated to resolve conflicts. |
f03ef65
to
82c6867
Compare
Updated with tests. |
ec28c38
to
084da38
Compare
Updated with tests and rebase onto upstream/master. |
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.
@preetmishra This looks great! It's a little verbose due to type handling and few other aspects, which is the last thing I'd like to see improve (pending reviewing of tests).
I think we can simplify the type notes sprinkled throughout using some TypedDict
use, which will make the code a lot more concise and readable. There are a few other ideas inline on how we can compact the code.
Since I've given a few notes on the types and data being passed around, I've held off on the reviewing the tests for now.
9e1946f
to
18548a7
Compare
@neiljp Thanks for the suggestions. They make the code clearer and concise. In the latest update, I have incorporated the suggestions that you left in-line and amended the tests accordingly. |
18548a7
to
caefdf6
Compare
Updated to resolve conflicts. |
This introduces handle_narrow_link(), along with a couple of helper methods, to handle narrow links and support stream narrow in MessageLinkButton. Helper methods: * _parse_narrow_link(). * _decode_stream_data(). * _validate_narrow_link(). * _validate_and_patch_stream_data(). * _switch_narrow_to(). Additionally, this adds a helper method, hash_util_decode(), in helper.py to decode server URL excerpts. Tests added.
This extends the existing helper methods, _parse_narrow_link(), _validate_narrow_link() and _switch_narrow_to(), to add support for topic narrow. Tests amended.
This extends the existing helper methods, _parse_narrow_link(), _validate_narrow_link() and _switch_narrow_to(), and adds _decode_message_id() to add support for near stream and near topic narrow. The near operator is used to set focus to a particular message (using the anchor) while switching narrow. Tests amended.
caefdf6
to
330cef9
Compare
Updated to resolve conflicts. |
@preetmishra Thanks for working on this - this is another feature that will make ZT easier to use for jumping between streams/topics 👍 This took a while to review due to the size, and there are a few refactors we can do to improve this, but I'm going to merge this now so we can get it out for wider view 🎉 |
The PR adds support for handling internal links - stream, topic and near narrow.
Commits
The commits introduce
MessageLinkButton
inMsgInfoView
and then incrementally add support for different narrows.I would greatly appreciate any feedback on the changes, the commit chronology and the structure in general.
Partially fixes #352 and #764.