Commit Graph

4430 Commits

Author SHA1 Message Date
Aman Agrawal 933870f2fd message_fetch: Don't include full messages data in sentry logs.
Sentry has a limit for how much data it can store as extra info,
we cannot pass full message object here.
2024-11-22 13:01:40 -08:00
Aman Agrawal 6d66312707 message_fetch: Account for recently sent messages in data verification. 2024-11-22 13:01:40 -08:00
Aman Agrawal 05339921d7 message_view: Verify msg list data state when restoring cached data.
When rendering message list directly from cached data, we sometimes
ask server to verify the current data.

If the data doesn't match, we include events at the time cached
data was restored to help with debugging or to determine if there
was race in updating the data.
2024-11-22 13:01:40 -08:00
Aman Agrawal 07f9dff62b message_fetch: Extract function to standardize API parameters.
There some common checks we need to perform before requesting
messages from the server. We extract it to be used elsewhere.
2024-11-22 13:01:40 -08:00
Aman Agrawal 20be5fb567 message_fetch: Remove no longer needed check for home filter.
`Filter.public_terms` will return the same result even if the
narrow is combined feed. Since we are no longer passing
empty narrow parameters for combined feed, this condition is
not required.
2024-11-22 13:01:40 -08:00
Aman Agrawal 808a222d41 message_fetch: Remove inaccurate comment.
This comment became inaccurate as we made combined feed to no longer
be a special view.
2024-11-22 13:01:40 -08:00
Aman Agrawal feb6ba6c52 message_events: Remove non matching edited msgs from search result. 2024-11-22 13:01:40 -08:00
Aman Agrawal 99a79ed8f4 message_events: Fix live update for search narrow on content update.
For messages whose content was edited, we ask the server if the
message matches the current search narrow.
2024-11-22 13:01:40 -08:00
Aman Agrawal bbc71cb91a message_events: Update cached msg list data when moving messages. 2024-11-22 13:01:40 -08:00
Aman Agrawal 452d378e1c message_view: Avoid initial fetch if we have enough context to render.
We don't contact the server at all when rendering a narrow if the
locally cached data has enough number of messages.
2024-11-22 13:01:40 -08:00
Aman Agrawal 88d0328e49 message_view: Attempt rendering cached data without contacting server.
For narrows for which we cannot filter the messages locally,
we attempt to select a message without contacting the server.
2024-11-22 13:01:40 -08:00
Aman Agrawal 4b6fd4057c message_events: Avoid populating from outdated cached msg data.
When we will no longer clear cached data on moving messages in
later commits, we have to clear cached data for the new filter when
changing narrow to avoid the message list from being populated
from it since the cached msg data is not updated as per the moved
topic and needs to be updated.
2024-11-22 13:01:40 -08:00
Aman Agrawal fb6432a77d message_events: Add comment. 2024-11-22 13:01:40 -08:00
Aman Agrawal 5e9fe4a83c message_view: Copy fetch status of superset data to msg data.
We can rely on the fetch status of the superset data since it
is now live update for message events.
2024-11-22 13:01:40 -08:00
Aman Agrawal 4dc8cc80fa message_fetch: Extract part of post message fetch process.
This will be useful to separately call when restoring msg list
from cached msg list data.
2024-11-22 13:01:40 -08:00
Aman Agrawal e34b96cb7e message_events: Update cached msg list data for msg property update.
We extend the existing logic that updates message events for
rendered message lists to apply for cached message list data
objects as well.

Manually tested for common message property narrows to test
update of the message property.
2024-11-22 13:01:40 -08:00
Pratik Chanda 46651a1591 navbar: Make login button work with keyboard navigation.
Earlier in navbar navigation, keyboard events only worked with `gear-
menu`, `personal-menu` and `help-menu`.

This commit introduces the ability to navigate to login in spectator
mode by adding `navbar-item` class and trigger focus to it.

Fixes: zulip#28037.
2024-11-22 10:55:11 -08:00
Pratik Chanda bb6b25d0d1 navbar_menu: Make userlist-toggle-button work with keyboard navigation.
Earlier in navbar navigation, keyboard events only worked with `gear-
menu`, `personal-menu` and `help-menu`. Now that userlist-toggle is
introduced in navbar, we should make it navigable.

This commit introduces the ability to navigate from `help-menu` to
userlist button by adding `navbar-item` class and trigger focus to it.

Fixes: zulip#29465.
2024-11-22 10:55:11 -08:00
Pratik Chanda e0e81aa47c navbar_menu: Use switch/case to handle navbar menu toggle.
This commit refactors `change_active_navbar_menu` to use switch/case
to toggle open target menu after closing any open popovers.
2024-11-22 10:55:11 -08:00
Pratik Chanda d4bcf5bae3 navbar_menu: Refactor `change_active_navbar_menu` to use target menu.
This commit introduces `navbar-item` class for each navbar menus and
`active-navbar-menu` class to indicate active navbar menu. Also
introduces new function `get_target_navbar_menu` to return target
navbar menu from keyboard event. `change_active_navbar_menu` uses target
menu to switch between navbar items.
2024-11-22 10:55:11 -08:00
Pratik Chanda 566e5e688b navbar_menu: Refactor keyboard events for navbar menu.
This commit extracts menu switching logic from `handle_keyboard_events`
to separate `change_active_navbar_menu` to toggle between the current
active navbar menu and the adjacent navbar menu.
2024-11-22 10:55:11 -08:00
Pratik Chanda 9d578247a7 navbar_menu: Add keyboard event check for navbar navigation.
This commit adds a keyboard event check statement for navbar navigation.
2024-11-22 10:55:11 -08:00
Sahil Batra 7a6159eee2 streams: Do not show archived streams in dropdown.
Dropdown widget in compose box and in message move modal should
not show archived streams in dropdown as we do not allow sending
messages or moving messages to archived streams.

We need a more focused audit of code for fixing other things
where archived streams are shown.
2024-11-22 10:40:59 -08:00
Anders Kaseorg 801e267e00 integrations: Properly pass data-categories as a JSON array.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-21 14:41:36 -08:00
Tim Abbott 77cac403ee integrations: Fix jQuery .data mishandling translated category names.
Apparently `.data("category")` would be come back as a single-element
array for some French translations, rather than a string.

We fix this by using `.attr("data-category")` across this file, which
is our preferred coding pattern anyway.
2024-11-21 14:41:36 -08:00
Sahil Batra d1e76a9281 streams: Allow admins to unsubscribe others irrespective of setting. 2024-11-21 11:28:54 -08:00
Sayam Samal d4aebccd62 portico: Remove `bootstrap-btn.css` dependency from portico.
This commit removes the final vestiges of `bootstrap-btn.css` from
portico, allowing us to move `bootstrap-btn.css` from `common.ts` bundle
to just `app.ts` bundle.
2024-11-21 06:44:05 -08:00
Saubhagya Patel 65f05794ee invitations: Default to empty channel list when inviting guest users.
This commit includes the following changes:
 - While inviting users for guest roles, we display an
   empty channel list rather than the default channel list
   and the default channels checkbox is unselected.
 - While inviting users for non-guest roles we continue
   to select the default channels checkbox.
 - When switching between guest and non-guest roles, the
   previous state of included channels for the guest role
   is restored while inviting a user as a guest.

Fixes: #31988.
Co-authored-by: Aditya <113302312+userAdityaa@users.noreply.github.com>
2024-11-20 16:21:13 -08:00
Vector73 4e89b4a88c settings: Add `can_invite_users_group` realm setting.
Added `can_invite_users_group` realm setting to replace
`invite_to_realm_policy`.
2024-11-20 13:35:05 -08:00
joseph ca650368bc settings: Open group setting typeahead when its label has been clicked.
Add an event listener so that clicking on its label will open the
typeahead.

Fixes part of #21769.
2024-11-19 18:37:02 -08:00
joseph 9aaa7719fa settings: Focus on the input when its label has been clicked.
Our user type field utilizes the contenteditable div which isn't a
labelable element, so clicking on its label doesn't do anything. Add
an event listener so that clicking on the label will focus on the input.

The cursor will always be placed at the start of the input if the field
is accessed in this way. This is the browser's default behavior.

Fixes part of #21769.
2024-11-19 18:37:02 -08:00
joseph e237faabf5 settings: Open the date picker when its label has been clicked.
Flatpickr isn't a native input element, so clicking on its label
doesn't do anything. Add an event listener so that clicking on the
label will open the date picker.

Fixes part of #21769.
2024-11-19 18:37:02 -08:00
evykassirer 60763763b2 stream_settings_ui: Convert module to typescript. 2024-11-19 14:01:10 -08:00
evykassirer 9e3cceb551 stream_settings_ui: Consistently return boolean from switch_rows.
This probably worked before because JQuery objects are truthy,
but the one caller of this function seems to expect it to
return boolean.
2024-11-19 14:01:10 -08:00
evykassirer ffef153a14 stream_list: Remove unused parameter passed to rename_stream. 2024-11-19 14:01:10 -08:00
evykassirer 919cebe0f9 components: Let toggle label be optional.
`stream_settings_ui` has only `label_html` and no `label`,
so we need fix this type to be able to convert that module
to typescript.
2024-11-19 14:01:10 -08:00
evykassirer dc0e82deef buddy_list: Move arrow toggle to the left of the header text. 2024-11-19 13:54:40 -08:00
Maneesh Shukla c2335ebc72 settings: Add user counts to role filter.
This commit enhances the user role filter dropdown by displaying the
count of users for each role in the format "Role Name (count)" (e.g.,
"Owners (3)").Additionally, it shows the total user count in the
"All roles" option, formatted as "All roles (total_count)" for easy
visibility of the overall user base.

Fixes: #18618.
2024-11-19 13:45:15 -08:00
vivek-tripathi-9005 d3ac1d5cb1 notifications: Add help link for "Followed topics" in triggers table.
Previously, the Notification triggers table in Settings lacked a
direct link to documentation for 'Followed topics'.

This commit updates the AllNotifications type to include an optional
'help_link' field and adds conditional rendering in the template to
show the help icon only if 'help_link' is present.The corresponding
test has been updated to verify the presence of the help link.
This enables direct links to relevant docs, improving usability.

Fixes: #32033.
2024-11-19 13:36:12 -08:00
Sahil Batra 7c6110e47a stream_data: Fix code to check permission for unsubscribe others.
We no longer allow admins to unsubscribe others from stream if
they are not allowed as per the can_remove_subscribers_group
setting.
2024-11-19 13:26:42 -08:00
Aman Agrawal 4e7bb6c57a message_edit: Show confirm dialog to explain the behaviour. 2024-11-18 15:06:26 -08:00
Aman Agrawal 98265fd149 message_edit: Fix edit last msg hotkey unintentionally marks msgs read.
Fixes #17737

If you write a message in a narrowed view, then go back to an unnarrowed
view, there may now be many unread messages between your new current
position and the message you just wrote. If you then accidentally press
`←`, all of those messages will be marked read unexpectedly, causing you
to lose your place while catching up.

So, we disable the hotkey in this scenario to fix this bug.
2024-11-18 15:06:26 -08:00
Aman Agrawal dd58698c02 message_edit: Rename variable for clarity. 2024-11-18 15:06:26 -08:00
Aman Agrawal c16f3c5eca message_edit: Remove incorrect `from_scroll` value.
Since it is important that the message being edited is visible,
it is safe to ignore `from_scroll` here which is also an
unlikely possibility here.
2024-11-18 15:06:26 -08:00
Karl Stolley f4554613a0 compose: Delegate max-length tooltip to body. 2024-11-18 12:44:24 -08:00
Sahil Batra cde4c335b1 group-settings: Refactor code to set up permission setting widgets.
This commit refactors code to set up permission setting widgets
by looping over list of settings.
2024-11-18 11:55:19 -08:00
Sahil Batra 3af84d6e69 group-settings: Use group_setting_value_pill_input template.
We now use group_setting_value_pill_input template for user
group permission settings to avoid duplicate code.
2024-11-18 11:55:19 -08:00
evykassirer b066f58c54 stream_muting: Convert module to typescript. 2024-11-18 11:13:36 -08:00
evykassirer a60beda676 settings_panel_menu: Convert module to typescript. 2024-11-18 11:13:10 -08:00
evykassirer 6093aa4b23 settings_sections: Convert module to typescript. 2024-11-18 10:35:21 -08:00