-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
Display 'Message sent outside current narrow' when narrowing from all_messages and all_PMs. #1204
base: main
Are you sure you want to change the base?
Conversation
@zulipbot add "PR needs review". |
From #1194:
I may not have been clear in this comment, but what I meant is that the two messages are not necessarily correlated since the conditions vary:
|
@@ -664,7 +660,6 @@ def check_narrow_and_notify( | |||
def notify_if_message_sent_outside_narrow( | |||
message: Composition, controller: Any | |||
) -> None: | |||
current_narrow = controller.model.narrow |
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 appears a valid one-off tidy-up, but if it's not related to the bulk of the code then it's good to note it in the commit text body. More tidies => maybe it belongs in it's own commit.
f4df59c
to
c4bba4f
Compare
@zulipbot add "PR needs review". |
@srdeotarse Left messages in stream for discussion. Also please address comments in a PR via changes or comments, or discuss in stream and reach a conclusion, before requesting review again :) |
c4bba4f
to
e31d5af
Compare
e31d5af
to
4c48ed0
Compare
Also applicable to title_write_box and to_write_box.
4c48ed0
to
af52470
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 The extra commit here looks interesting, but I'd be inclined to split it out into another PR since it's really extending the "random" help to be more contextual.
The first commit doesn't quite address one of my original points; I referenced that inline, and it likely requires the test structure to be slightly updated to indicate the output. Hopefully you'll find that easier after working on that other PR.
self.check_stream_topic_edit_txt(self.check_stream_topic_edit_txt_flag) | ||
|
||
@asynch | ||
def check_stream_topic_edit_txt( |
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.
Minor perhaps, but this handles private cases too.
("footer", "Help(?): "), | ||
("footer_contrast", f" {narrow_key} "), | ||
("footer", " 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 styling (and below) is extracted from the other location. It would be better to use a common functionality.
("footer_contrast", f" {send_key} "), | ||
("footer", " Send a message."), | ||
] | ||
while check_stream_topic_edit_txt_flag: |
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.
We don't want to use a busy loop for this, if we do take this approach. This sends the zulip-term CPU usage to 100%+.
An urwid on-change signal may be better, though note that while potentially helpful, alt .
will not (or shouldn't) do anything if the recipients aren't valid, so we can avoid showing the notice in that case.
and current_narrow != outer_narrow | ||
and current_narrow != inner_narrow | ||
): | ||
if current_narrow != inner_narrow: |
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 the correct condition for the narrowing hint, but please see #1204 (comment)
There are two separate conditions; one handles the 'outside of narrow' part of the message (doesn't need updating), another separate one handles the showing of the second (hint) part.
True, | ||
id="all_private__pm__not_notified", |
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.
We may need to update either the test or the ids, to represent what we're expecting here.
At the very least, this change is now inconsistent: True => notified :)
However, there are different aspects being notified here, so a boolean doesn't fully encapsulate the results any more.
Heads up @srdeotarse, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Follow up PR #1194
What does this PR do?
This PR displays
Message sent outside current narrow
even if narrowing fromall_messages
orall_PMs
Tested?
Commit flow
Notes & Questions
Interactions
CZO - https://chat.zulip.org/#narrow/stream/206-zulip-terminal/topic/.E2.9C.94.20Support.20'Narrow.20to.20current.20compose.20box.20recipient'.20.23T1194
Cases for showing success message - #1194 (comment)
Visual changes