-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
model: Highlight stream name in reporting of moving/splitting topics. #1196
model: Highlight stream name in reporting of moving/splitting topics. #1196
Conversation
2fba636
to
e96594c
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.
@srdeotarse This achieves the formatting fine, but there are many ways to style text in urwid, so passing ["some string", ("named_style", " another string"), ...]
is going to be simpler.
This has been discussed in the past in terms of better defining an actual type for this 'styled text' in other topics and open PRs, which you may find informative - it's rather complex due to what is possible!
One followup aspect to this is that we're casually passing in a list to report_success
and this is not being flagged by mypy! We may well want to change the type of the function, but I'd like to know why mypy is not warning about this - tests appear to be passing.
e96594c
to
32b0717
Compare
@neiljp |
32b0717
to
28b5f9f
Compare
@zulipbot add "PR needs review". |
This doesn't explain why it wasn't showing the error previously. As per my stream comment just now, I suspect this is due to lack of typing between major modules, and we have a few options to what this 'should' be. |
28b5f9f
to
c0bbffd
Compare
@zulipbot add "PR needs review". |
c0bbffd
to
b44090a
Compare
@srdeotarse The second commit looks fine to merge, but I'm a little concerned the first does not take into account all the call sites? |
b44090a
to
8530f4e
Compare
8530f4e
to
c2e644b
Compare
@zulipbot add "PR needs review". |
2662ae7
to
d14f51d
Compare
d14f51d
to
648b188
Compare
@zulipbot add "PR needs review". |
ERROR: Label "PR needs review" already exists and was thus not added to this pull request. |
Change argument type of report_success from text: str to text: List[Union[str, Tuple[Literal["footer_contrast"], str]]]. Tests updated.
Change argument type of report_warning from text: str to text: List[Union[str, Tuple[Literal["footer_contrast"], str]]]. Tests updated.
Change argument type of report_error from text: str to text: List[Union[str, Tuple[Literal["footer_contrast"], str]]]. Tests updated.
Tests updated. Partial fix towards zulip#1172.
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.
@srdeotarse There were a few minor points here which I've addressed myself in a quick tidy and pushed back:
- the blacken is in an incorrect commit (but passed overall)
- some strings had been combined (and were overly long)
- in one case the text was already a list, that was passed to report_error
As long as this passes, which I don't expect any problems with, I'll merge shortly after :)
zulipterminal/ui_tools/boxes.py
Outdated
@@ -329,7 +329,7 @@ def _tidy_valid_recipients_and_notify_invalid_ones( | |||
), | |||
" to autocomplete.", | |||
] | |||
self.view.controller.report_error(invalid_recipients_error) | |||
self.view.controller.report_error([invalid_recipients_error]) |
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.
This is already a list.
tests/helper/test_helper.py
Outdated
[f"Message is sent outside of current narrow. Press [{key}] to narrow to conversation."], | ||
[ | ||
f"Message is sent outside of current narrow. Press [{key}] to narrow to conversation." | ||
], |
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.
This is a blacken.
648b188
to
dc5ba6b
Compare
Hello @srdeotarse, it seems like you have referenced #1172 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! |
@srdeotarse Thanks for the followup here! 🎉 |
What does this PR do?
This PR highlights stream names in reporting of moving/splitting topic in footer text.
Partially fixes #1172
CZO - https://chat.zulip.org/#narrow/stream/206-zulip-terminal/topic/.E2.9C.94.20Improve.20reporting.20on.20moving.2Fsplitting.20topics.20.23T1172.20.23T1178
New CZO - https://chat.zulip.org/#narrow/stream/206-zulip-terminal/topic/Highlight.20text.20of.20reporting.20on.20moving.2Fsplitting.20topics
Tested?
Commit flow
Notes & Questions
Interactions
Visual changes