Commit Graph

1919 Commits

Author SHA1 Message Date
Tim Abbott
07c09083fb message_view: Fix whitespace in finicky node tests. 2025-07-02 11:39:38 -07:00
whilstsomebody
77cf174b1b empty_feed_notice: Show only query words for empty search results.
Previously, we included channel, topic, sender name and search
qeries (if present) in the empty feed banner.

With this commit, we will now not include channel, topic and sender
name and we only display the search queries when there are excluded
stop words.

Fixes: #34872
2025-07-02 11:27:33 -07:00
PieterCK
1e4b0bdfea filter: Rename supports_collapsing_recipients.
This renames the function to `contains_no_partial_conversations`. The
function initially was created to determine whether its appropriate to
collapse recipient/sender headings. Since then it has many other use
cases, so it's renamed to clearly describe what it does instead.
2025-07-01 16:14:56 -07:00
Maneesh Shukla
52b83f7b58 topic_list: Filter topics by resolved state in "more topics" view.
Fixes: #24200.
2025-07-01 14:02:57 -07:00
PieterCK
e59c5ce655 test_bot_data: Make test cases more accurate.
This removes the "service" field from the `test_bot` fixture, because it
is a default bot. In the `/bots` API endpoint, only service bots can
have their own service.

This is a prep commit for #34524, this cleans up the test cases related
to service bots so that it would keep things from getting confusing when
adding test for the changes to that PR.
2025-07-01 13:25:00 -07:00
Evy Kassirer
31fb0bd6d7 channel_folders: Let a new channel in a folder be created through a hash. 2025-06-27 17:09:08 -07:00
opmkumar
d3a7122b62 left_sidebar: Use personal settings to hide unread summary counts.
This commit adds code to use
`web_left_sidebar_unreads_count_summary` from personal
settings in web app.

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>

Fixes part of #28759.
2025-06-27 13:50:18 -07:00
Prakhar Pratyush
8e1f0c4bcf topic_list: Fix "show all topics" flashing.
Earlier, 'all_topics_in_cache' used to return `false`
in the case where we were unsure if some topics were
present even before the user subscribed to the channel
and hence missing in the cache.

Returning `false` led to visible 'show all topics',
even if all the topics were already displayed. This was
helpful if the API call to fetch channel history failed,
as users had the option to make another request.

That resulted in a bug where "show all topics" was flashing
in channels with less number of topics. We used to display
"show all topics" initially and then hide it after the API
call confirmed that there were no new topics to display.

To fix this bug, we return `true`. So, the "show all topics"
is not displayed beforehand. We let the API call fetch the history
and rebuild the topic list based on the updated data.

Instead of show then hide. We now prefer, show if needed.

To fix the issue of API call failure and users having no option
to see all topics, we did prep work in the last commit
to add retry mechanism to the concerned API call.
2025-06-26 10:11:05 -07:00
Prakhar Pratyush
43249cb431 stream_topic_history_util: Add retry mechanism to get_server_history.
Earlier, in `get_server_history` the API call to fetch stream-topic
history didn't have a retry logic.

This commit adds a retry mechanism.

If the request to fetch stream topic history fails, we now retry
the request up to a fixed number of times before giving up.
This improves UX in case of temporary network issues.
2025-06-26 10:11:05 -07:00
Prakhar Pratyush
2bf13c36be test_stream_topic_history: Remove unused mock for people.ts.
This commit removes the unused mock for 'people.ts' in
'stream_topic_history.test.cjs'.
2025-06-26 10:11:05 -07:00
Vector73
b612351e48 stream_setting: Add setting for who can move messages out of channel.
Adds `can_move_messages_out_of_channel_group` channel-level
permission for who can move messages out of the channel.

Fixes #34243.
2025-06-24 16:52:53 -07:00
Vector73
703601a5d5 stream_setting: Add setting for who can move messages within channel.
Adds `can_move_messages_within_channel_group` channel-level
permission for who can move messages within the channel.
2025-06-24 16:52:53 -07:00
Vector73
43dcc6e3fd bug: Fix incorrect topic resolution check.
Previously, when sending messages to resolved topics, the warning
suggesting to resolve that topic used wrong check to verify if the
user is allowed to resolve the topic. This commit fixes that.
2025-06-24 16:52:53 -07:00
Evy Kassirer
ec65dad063 stream_pill: Fetch all subscribers before getting user ids for a stream.
Work towards #34244.
2025-06-23 17:04:47 -07:00
Aman Agrawal
93c4dcbdc9 hotkey: Merge uses of M hotkey.
It was not a good idea to have the hotkey
fallthrough the `case` for user not being in message list.

We merge both the cases and also remove `M` from
`message_view_only_keys`.
2025-06-20 15:56:19 -07:00
Karl Stolley
e19b815eaf compose: Rename functions to reflect attention level. 2025-06-20 15:54:59 -07:00
Karl Stolley
966c8451df compose: Add functions to mute/unmute recipient row. 2025-06-19 17:21:20 -07:00
Prakhar Pratyush
4515c29d44 topic_list: Fix missing 'show all topics' when messages not cached.
Earlier, when number of topics displayed in the topic list
widget was at max `topic_list_data.max_topics` and
first_message_id of stream >= first_cached_message_id.
There was a possibility of a few topics missing for messages
which were sent when the user wasn't subscribed.

We were neither displaying 'show more topics', nor fetching it
from server to update the list asyncronously.

This commit fixes that bug to display 'show all topics' in that
case and also initiates an API call in parallel to fetch all topics
for that stream and update the topic list asyncronously if topics
were actually missing.

Fixes #28949.
2025-06-19 12:43:02 -07:00
Prakhar Pratyush
7d55ad3c13 topic_list: Move and reorganize couple of functions to topic_list.ts.
A prep commit to move `is_complete_for_stream_id` and
`all_topics_in_cache` from `stream_topic_history` to `topic_list`
as it is specifically used while building topic list widget.

As it makes more sense to use `is_complete_for_stream_id` instead of
`all_topics_in_cache` directly, we reorganize to put it inside
`is_complete_for_stream_id`.

We rename `is_complete_for_stream_id` to
`is_full_topic_history_available` for clarity.

It'll also help to avoid tackling circular import issue
while resolving #28949.

No functional change in this commit.
2025-06-19 12:43:02 -07:00
Prakhar Pratyush
f94d3bd4a2 stream_topic_history: Use first_including_muted for the oldest message.
Earlier, we were using `all_messages_data.first()` for the oldest
message ID we have in cache, which is incorrect.

`all_messages_data.first_including_muted()` returns the oldest ID.

This commit fixes the bug.
2025-06-19 12:43:02 -07:00
Kislay Verma
2f696c5ec3 tests: Add library function to create message lists.
This function actually instantiates the
`MessageList` and `MessageListData` classes instead
of just mocking its structure as it is currently done.

It addresses https://github.com/zulip/zulip/pull/34645#discussion_r2099058418
2025-06-19 10:50:21 -07:00
Kislay Verma
5174dafb37 drafts: Use library functions in test.
In this commit we use functions from `example_stream`
and `example_user` modules in our test library.

Fixes part of 32326
2025-06-19 10:50:21 -07:00
Kislay Verma
1ece5ad15e topic_link_util: Add support for empty topics in the frontend.
Though the frontend module generated correct urls for
empty topics, it would sometime generate incorrect
link text in the fallback md link syntax. (eg, if
empty string was provided as the topic name).

This commit fixes that.
2025-06-18 13:03:56 -07:00
Aman Agrawal
b77ecca1a3 user_pill: Use user_id to get user info instead of email. 2025-06-18 11:27:59 -07:00
Aman Agrawal
76313f1753 compose_typeahead: Check for unique full name syntax in query.
Add support for `full_name|user_id` syntax support for compose
typeahead.
2025-06-18 11:27:59 -07:00
Aman Agrawal
b1f6eb41d9 zephyr/user_pill: Remove special condition for zephyr realm.
This makes user_id no longer optional in `UserPill` and hence,
we can query them by email instead of user_id.
2025-06-18 11:27:59 -07:00
Vector73
6094bbe8a5 stream_settings: Add new topics_policy setting.
Added `topics_policy` channel setting to configure sending
messages in the empty topic.

Fixes #33549.
2025-06-17 17:05:58 -07:00
Vector73
92672c1339 settings: Add can_set_topics_policy_group realm setting.
Added `can_set_topics_policy_group` realm setting to control
permission to change per-channel `topics_policy`.
2025-06-17 17:05:58 -07:00
Vector73
62c67eae8e settings: Add a new topics_policy realm setting.
Added a new realm setting, `topics_policy` and deprecated
`mandatory_topics` setting as it now replaced by `topics_policy`.

Fixes part of #33549.
2025-06-17 17:05:58 -07:00
Vector73
8fb1eeeb09 mandatory_topics: Refactor mandatory_topics check into a function. 2025-06-17 17:05:58 -07:00
Shubham Padia
7eb9c9deef Groups: Can perform any join, leave, add, remove for deactivated group.
Fixes #33804.

We still do not allow permission settings to be set to deactivated
groups.
2025-06-11 14:58:14 -07:00
Sahil Batra
32287a084b channel-folders: Add UI to create new channel folder.
This commit adds a button besides the folder dropdowin in
stream settings UI which can be used to create a new folder.
2025-06-10 11:51:58 -07:00
Sahil Batra
7c01e61e5a streams: Add UI to add or remove stream from a folder.
This commit adds UI to add a stream to a folder while
creating them and also for adding/removing an existing
stream from a folder.
2025-06-10 11:51:58 -07:00
Sahil Batra
403b73e1a6 channel_folders: Add support for channel folders in webapp.
This commit adds code to handle channel folders data in
webapp.
2025-06-10 11:51:58 -07:00
Sahil Batra
e643d7e6fd dropdown-list-widget: Allow customization for "Disable" option.
We currently always show fa-ban icon and "Disable" text for
"Disabled" or "None selected" option in dropdown-list widget.

This commit adds code to provide an option for not showing the
fa-ban icon and having the option text be something other than
"Disable". This will be used in channel folder dropdown widget
where we want to have "None" text in the option without icon.
2025-06-10 11:51:58 -07:00
apoorvapendse
3cd0f87d47 draft_overlay: Clarify the editing UI for drafts.
Co-authored-by: Sayam Samal <sayam@zulip.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-06-10 11:08:35 -07:00
Shubham Padia
3dc54a10d7 filter: Do not set anchor as first_unread for starred messages view.
Fixes
https://chat.zulip.org/#narrow/channel/9-issues/topic/Starred.20messages.20view.20performance/near/2184251.
Anchor for starred messages was `first_unread` and the query to find
first_unread in a user's starred messages can turn out to be expensive.
This commit ensures that we default to newest instead since first_unread
is not of important for the starred messages view.
By excluding starred messages from using `first_unread`, it will default
to newest based on the logic in message_view.ts.
2025-06-09 16:21:09 -07:00
Saubhagya Patel
5f164582a4 settings: Add channel notifications customization in Personal settings.
This commit adds an option to change the notification settings
of a channel from default to custom in the Notifications menu
of Personal settings.

Fixes #19849.
2025-06-09 13:50:55 -07:00
Saubhagya Patel
45f38795e9 settings: Add push_notifications_disabled in notification checkboxes.
This commit adds a variable `push_notifications_disabled` to the
checkboxes used in the notifications table in Settings > Notifications.
The variable is used to control the mobile push notifications
disabled tooltip.
2025-06-09 13:50:55 -07:00
Evy Kassirer
d1023660da search_pill: Prevent adding duplicate search pills.
We shouldn't show duplicate suggestions in the typeahead, but
duplicate pills were still possible by typing a term twice in
the search bar and pressing enter after each one, and this
commit prevents that from putting duplicate pills in the search
bar.
2025-06-07 22:59:14 -07:00
Evy Kassirer
f0210fd6e8 search_suggestion: Prevent duplicate terms in default suggestion. 2025-06-07 22:59:14 -07:00
Evy Kassirer
fa03c42009 search: Show correct description string for public channels.
Previously, typing "channels: public" would show "Channels public"
in the typeahead, which was especially confusing because we'd show
"All public channels" until the term was completely typed out.
2025-06-06 18:04:48 -07:00
Tim Abbott
bbeede1e52 people: Optimize is_person_active.
Calling settings_data.user_can_access_all_other_users on every call to
this function could be expensive when using this function in loops
over every user in the organization.

After the previous commit, those calls are still somewhat expensive
for guest users.
2025-06-06 10:53:03 -07:00
Tim Abbott
446ba1b538 settings_data: Optimize user_can_access_all_other_users.
This fixes an important issue where this function being called in a
loop can consume as much as 1ms per iteration for users who are in a
lot of groups.
2025-06-06 10:53:03 -07:00
Shubham Padia
7b925ce94a buddy_list: Set html instead of append for view all subscribers link.
Earlier, we were appending view all subscribers link using
JQuery.append, which leaves open the possibility for the component to
be appended multiple times if the function calling it gets called
multiple times.
It is better to have the link div in right_sidebar.hbs
and then insert the html when required.
2025-06-05 16:13:07 -07:00
Shubham Padia
90a1f0f7aa buddy_list: Set html instead of append for view all users link.
Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/buddy.20list.20view.20all.20users.20appears.20twice
Earlier, we were appending view all users link using JQuery.append, so
when `render_view_user_list_links` is called twice, `view all users`
appears twice. It is better to have the link div in right_sidebar.hbs
and then insert the html when required.
2025-06-05 16:13:05 -07:00
Evy Kassirer
b31d3ce5b9 search_suggestion: Canonicalize search text terms before suggesting.
Fixes bug reported here
https://chat.zulip.org/#narrow/channel/9-issues/topic/search.20typeahead.20duplicates.20.22sent.20by.20me.22/near/2183976
2025-06-05 16:10:02 -07:00
Evy Kassirer
b63b4a26c8 filter: Don't lowercase search operands.
Searching e.g. "NASA" would put "nasa" in the search bar if you
selected "search for NASA" in the typeahead. This probably looks
weird to users, so let's not lowercase search operands.
2025-06-05 16:10:02 -07:00
Aditya Kumar Kasaudhan
a5632a9356 drafts: Refactor draft deletion to support bulk operations.
This commit updates the draft deletion functionality to handle
multiple draft IDs at once, reducing localStorage writes.
2025-06-05 15:34:11 -07:00
Aditya Kumar Kasaudhan
9a4de8d9b8 drafts: Enable dynamic re-rendering of draft list in overlay.
This commit laying the groundwork for dynamic re-rendering of
drafts.

Previously, the draft list was rendered once with the overlay,
and re-rendering wasn't needed. However, to support features like
"undo," we now need to re-render the draft list dynamically.
2025-06-05 15:34:11 -07:00