This function is called when entering a message feed view. Therefore,
it should always have a defined MessateListData filter.
Follow-up clean up from reworking the home view to use a Filter
object.
Renames is_for_stream_id to narrowed_to_stream_id, and updates it
to use narrow_state.stream_id for the comparison check instead of
getting the full StreamSubscription object.
Previously, when searching for extremely long queries,
they would overflow beyond the screen.
This commit fixes the bug by ensuring that long
search queries do not overflow.
Fixes: #29568
This commit enables topic suggestions for
channel links of the format
[#channel name](path)>some topic.
Previously no typeahead suggestion was shown
for above format.
Selecting a topic will result in link of format
[#stream name > topic name](topic path)
Typing `>` after the fallback md stream link also
shows topic suggestions, parallel to the standard
Fixes#32556
This does lookups by email address, which is very much a legacy way to
do things, and could throw exceptions if trying to lookup details on
an unknown user ID.
This is a pre-commit to add the function
"format_array_output_based_on_and_preference()" which will take
two parameters- string array and a boolean whether we want and
based output or not. This function return a string formatted
using Intl.ListFormat.
Previously, for spectators, when a negated search operator was
present, navigating forward or backward triggered the "signup/login"
modal.
This commit fixes this issue.
This commit adds a new function to fetch presence data when the user
card is opened. This data is then used to display the user's presence
status in the card.
Fixes: #31037.
We don't always know about every user id. So, our code should
reflect the same.
Fixed by refactoring the function to use User object a function
parameter and let the called get the user object if possible.
This reduces duplicate calculation to get user object too.
Instead of showing the "None" empty message, just hide the whole section
instead. Notably this uses the total user counts and not the number of users
rendered, so it's possible we'll still show the sections when they're partially
loaded or if they have inactive users (in which case we'd show the "view more"
links).
The exception is the "THIS CHANNEL" section which we always want to show,
since it can be confusing to see other sections without this section
present. More conversation on that here:
https://chat.zulip.org/#narrow/channel/101-design/topic/right.20sidebar.20design.20tweaks/near/2099241
This commit adds the `invalid-input` class to the inline topic edit
input element when the new topic name is considered empty as a result
of realm_mandatory_topics property being set to True. This adds the
red glow borders to the invalid input field, which visually
communicates that some thing is wrong with the new topic name.
Use a more instructive placeholder instead of "Topic" when
topic is not mandatory in a realm.
Updated placeholder:
'Enter a topic (skip for general chat)'.
This commit also attempts to fix a bug, present in main, where a
draft restored directly to the compose box loses its original topic
upon switching to other topic narrows.
Co-authored-by: Prakhar Pratyush <prakhar@zulip.com>
Note that the puppeteer tests only tested
copying whereas the node tests only tested
pasting, which is why the puppeteer tests
for pasting and node tests for copying are
absent after this split.
There's a rare possibility for a user to have no last_active_time. In
such a case, we always want to fall back to date_joined for displaying
"Last active" in the UI.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
This commit implements the frontend of migrating the
`allow_edit_history` setting to `message_edit_history_visibility`.
This allows organizations, to have an intermediate setting to
view only the "Moves" history of the messages.
Fixes#21398.
Co-authored-by: Shlok Patel <shlokcpatel2001@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
This commit makes it easier to link to topics in the same channel.
Typing `#>` in the compose box replaces it with `#**channel_name>`
and opens the topic_list typeahead.
Channel names producing broken link syntax
are handled by generating a fallback md link
syntax when the topic is chosen.
Fixes#31420
A minor bug was introduced in #32184 where we didn't check if the
channel name would cause a broken link syntax (and hence should
generate a fallback md link). This would cause problems when
implementing a shortcut syntax to link to current channel.
Fixes part of #31420.
Copying links to a Zulip element now generate 3 content types:
- plain url, pasteable in address bar and non rich text editor
- HTML, for rich text editors.
- x-gfm, for pasting into GitHub and other services that support
Markdown, new in this PR.
Fixes: #31813.
This commit adds tooltip support for various
invalid conditions mentioned in issue 32115.
A `show_banner` positional argument is added
in the `validate` method which has a default
value of true.
The reason behind introducing this is to
not trigger banners on hovering the disabled
send button, since the tooltip message is also
determined using the same validate method.
We want to only disable the button on hover,
which is why the update_send_button_status() method
is called only on "mouseenter" event, which is
added to the send button in compose_setup.js
To incorporate this change a new param is
introduced which determines whether to enable/disable
send_button by running update_send_button_status
Earlier, typing something in the textarea or
recipient box would also trigger
`update_send_button_status` which doesn't
work well since we've introduced a lot of
new booleans which determine whether send
button gets disabled causing send button to
get disabled while typing instead while hovering
Hence this change.