Commit Graph

5916 Commits

Author SHA1 Message Date
evykassirer 71d01291b6 message_list_view: Replace util.same_sender with sender_id check. 2024-09-10 17:20:00 -07:00
evykassirer b387ad24fa timerender: Move util.the into render_date. 2024-09-10 17:20:00 -07:00
roanster007 bc384094d3 narrow: Make `with` operator behaviour consistent with API behaviour.
Previously, in presence of `dm` operators, the `with` operator
behaviour in the web client was not consistent with that of
the API. For instance, when `with` points to a stream message,
in presence of a `dm` term, then rather than narrowing to the
corresponding channel of `with` operand, the `with` term simply
used to be ignored, and narrowed to the corresponding `dm`
narrow.

Also, in cases when the `with` used to point to a direct message,
in presence of a `channel` term, then after correcting to the
right narrow, the `with` term used to be removed. The `with`
term would still be needed after correcting the narrow to
maintain consistency between channel and dm conversations.

This commit removes these inconsistencies of `with` in case
of `dm` operators, and makes it consistent to those mentioned
in the api documentation.
2024-09-10 16:29:49 -07:00
opmkumar 719518baba popovers: Add stream-info-popover when channel pill is clicked.
Shows a stream info popover whenever a channel pill is clicked (such
as in the pill widgets for adding subscribers to a channel or
invitations). The stream info popover contains channel icon and name,
channel description and a link to channel settings.

Fixes #30567.
2024-09-10 16:16:53 -07:00
opmkumar 5ecdf56336 popovers: Fix references to nonexistant popover-menu-inner-list-item.
These should have been popover-menu-list-item.
2024-09-10 16:16:53 -07:00
Varun Singh d6c34f64dd tests: Use `make_user` & `make_bot` to create test user & bot. 2024-09-10 16:02:35 -07:00
Varun Singh f9f2c32d21 example_user: Add helper functions to create user. 2024-09-10 16:02:35 -07:00
Varun Singh 4c2bb4dbe3 tests: Rename `test_stream.js` to `example_stream.js`. 2024-09-10 16:02:35 -07:00
Tim Abbott ad890890f6 lint: Fix several duplicate word typos. 2024-09-10 15:59:00 -07:00
Aman Agrawal 21b6bb9887 message_list_data_cache: Update when receiving new messages.
If we receive a message that we can add to the data cache without
talking to the server, we do that, otherwise we remove it from the
cache to avoid us having wrong filter status cached.
2024-09-10 15:58:15 -07:00
Aman Agrawal 5b9a2584c5 message_list_data_cache: Cache MessageListData objects.
We start caching MessageListData objects for the narrows which
user has visited. We restore the cached objects if the filters
match. Also, the cached objects are updated based on events. One
major piece is update path the is pending implementation is the
message move code path.
2024-09-10 15:58:15 -07:00
Aman Agrawal 259e77fbf6 message_list_data: Track if the data is rendered using message list id.
This is an easy way to track if a MessageListData is rendered.
Storing MessageList object would make us liable to cleanup the
MessageList object when the data is no longer in use.

Note that this is more like "likely / past rendered message list id",
we will have to check currently rendered message list data to verify
if the data object is really rendered.
2024-09-10 15:58:15 -07:00
Aman Agrawal fee108949d messsage_lists: Extract method to delete a rendered list. 2024-09-10 15:58:15 -07:00
joseph 65893292b5 channel_subscribe: Use IDs instead of emails when processing results.
As part of our todo in the code, we want to use the unique user IDs
instead of emails when processing the results of subscribing users to a
channel. These changes apply those changes and streamlines the use of IDs.
2024-09-10 15:37:38 -07:00
opmkumar 62f74fcb83 search: Hide close button in empty filter streams and filter topics.
Fixes #21297.
2024-09-10 15:36:30 -07:00
Karl Stolley 8ff3fb5fec message_row: Reduce space above collapsed Show More button.
This only impacts collapsed Show More buttons in a message with a
sender.

Fixes #31221
2024-09-10 14:06:58 -07:00
adnan-td eaaf26e182 buddy_list: Remove deactivated users from right sidebar.
Filter out inactive people from the buddy list in the right
sidebar.
2024-09-10 14:04:26 -07:00
Mateusz Mandera a36f906d1a presence: Add history_limit_days param to the API.
This param allows clients to specify how much presence history they want
to fetch. Previously, the server always returned 14 days of history.
With the recent migration of the presence API to the much more efficient
system relying on incremental fetches via the last_update_id param added
in #29999, we can now afford to provide much more history to clients
that request it - as all that historical data will only be fetched once.

There are three endpoints involved:
- `/register` - this is the main useful endpoint for this, used by API
clients to fetch initial data and register an events queue. Clients can
pass the `presence_history_limit_days` param here.
- `/users/me/presence` - this endpoint is currently used by clients to
update their presence status and fetch incremental data, making the new
functionality not particularly useful here. However, we still add the
new `history_limit_days` param here, in case in the future clients
transition to using this also for the initial presence data fetch.
- `/` - used when opening the webapp. Naturally, params aren't passed
here, so the server just assumes a value from
`settings.PRESENCE_HISTORY_LIMIT_DAYS_FOR_WEB_APP` and returns
information about this default value in page_params.
2024-09-10 13:15:35 -07:00
Aman Agrawal 93f0581197 messages_overlay: Fix multiple IDs selected accidentally.
Since `success_message_scheduled_banner` and scheduled message overlay
both use `data-scheduled-message-id`, `get_element_by_id` needs
to be more specific which selector it wants.
2024-09-10 09:51:18 -07:00
Prakhar Pratyush 00fb8f3014 settings: Move the user-privacy settings related code at one place.
This commit makes small refactoring to place all the user-privacy
settings code in 'server_events_dispatch.js' at one place and use
a common function 'settings_account.update_privacy_settings_box' to
update the UI.

This also helps in early return instead of executing a lot
of `if` statements related to user-preferences settings.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush 75f6ae6d20 settings: Fix live-update bug for privacy settings.
The following three privacy settings weren't being live
updated across multiple browser tabs/windows:
* send_stream_typing_notifications
* send_private_typing_notifications
* send_read_receipts

This commit fixes the bug.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush 340140954b settings: Use the generic code block to set 'enter_sends' value.
This commit performs a minor code restructuring to use the
generic code block for updating all the user_preferences
settings values.

No need to use a separate code block for 'enter_sends' setting.
2024-09-10 09:34:24 -07:00
Alex Vandiver 8bd94b82bf upload: Name the link based on the uploaded filename.
We previously parsed the filename as stored on disk, which is rather
sanitized.  Use as close to the original filename as possible.
2024-09-09 12:40:17 -07:00
Alex Vandiver 8e5cdcc174 upload: Remove impossible undefined-url test and code.
This came in during the initial conversion to Uppy in 5bab2a3762,
but it tests a case which should not be possible according to Uppy's
API, and ours.
2024-09-09 12:40:17 -07:00
Sanchit Sharma 48b60db4a4 settings_config: Use `kbd` for `realm_enter_send` label.
Fixes: #29083.
2024-09-06 11:47:04 -07:00
Sanchit Sharma 671946351c settings: Improve visibility of "Enter Sends Message" setting.
Addresses user research feedback by duplicating the "Enter Sends
Message" setting in the Settings > Preferences menu, specifically within
the General section, ensuring users can easily locate and configure
this option.

server_events_dispatch: Remove break statement.
The settings page needs to be updated when
`enter_sends` property is updated.

css: Update vertical-align to middle for the checkbox element.

Co-authored-by: Akarsh Jain<akarsh.jain.790@gmail.com>.
2024-09-06 11:47:04 -07:00
sanchi-t a8acd0ce25 compose_box: Remove non-existent classes.
The .enter_sends_true and .enter_sends_false classes were originally
removed in commit b4b71880e1.
2024-09-06 11:47:04 -07:00
joseph 5d3edf06c8 message_edit: Ask users to delete attachments after editing.
currently, after a user edits a message and removes an reference to the
uploaded file, the uploaded file stays on the storage taking up space.
We want to ask the user to possibly delete the removed attachments if
they are no longer needed. These changes applies a modal that will appear
prompting the user to delete the attachments.

Fixes: #25525.

Co-authored-by: brijsiyag
Co-authored-by: wandrew0
2024-09-06 11:40:51 -07:00
joseph 5133f34a05 attachments: Reuse base attachments schemas.
This is a prepatory commit to reuse the base attachments schemas in
other schemas that are expecting attachments as a field.
2024-09-06 11:40:51 -07:00
Karl Stolley e1e9ab0d06 portico: Ensure comparison tabs take precedence over plans. 2024-09-06 09:35:32 -07:00
Anders Kaseorg 7515cb8c6e invite: Avoid slow jQuery :input selector extension.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-06 09:33:31 -07:00
Anders Kaseorg cf186a4d86 sponsorship: Avoid slow jQuery :selected selector extension.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-06 09:33:31 -07:00
Anders Kaseorg 081c0dc97f signup: Avoid slow jQuery :selected selector extension.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-06 09:33:31 -07:00
Sahil Batra 6efa6b354c stream-settings: Check if overlay is opened when removing stream.
This commit adds code to add a check if overlay is opened before
executing the code for removing stream from UI on receiving the
stream deletion event. This makes sure that the we do not
call code which expects certain UI elements to be present in the
DOM and thus avoid errors in cases where the stream settings UI
is not opened and the related elements are not in DOM.
2024-09-06 09:32:53 -07:00
Jaimin Godhani 731575344e settings: Rename display_settings to preferences.
Fixes zulip#26874.
2024-09-05 16:17:36 -07:00
Alya Abbott 9933165e75 help modal: Remove small_hotkey style. 2024-09-03 20:52:16 -07:00
Alya Abbott b65e02ed98 help: Add missing line to Navigation section of keyboard shortcuts. 2024-09-03 20:52:16 -07:00
evykassirer ec43b41c2f move_topic: Remove extraneous classname on hidden input, fixes bug.
We initialize the topic typeahead in the modal with the element
`$("#move_topic_form .move_messages_edit_topic")`, which previously
was capturing two elements, the second one being a hidden input
element.

This wasn't causing issues, but once we added `util.the` in the
typeahead code we were getting errors for having multiple elements
where we expected one.

The fix is removing `move_messages_edit_topic` from the hidden
element's classnames, since that class is only used for input
and styling things.
2024-09-03 20:50:34 -07:00
roanster007 519614ffbb narrow: Fix last unread when narrowed to a `dm` message using `with`.
Previously, on narrowing to a direct message using the `with`
operator, we used to end up at the last message rather than
the last unread message.

This was because while correcting the narrow using the `with`
operand, we used to consider all the users of `display_recipient`.
This would also include the `current_user`. This is not right because
the unread messages for direct messages are bucketed with a
`user_ids_string`, that does not include the user id of the current
user. Hence, when looked up for the last unread id by the `with`
operator, it used to return undefined.

This is fixed by removing the current user's user id from the user ids
string if current user is not the only display recipient to the
direct message.
2024-09-03 16:35:35 -07:00
evykassirer 58bc98afb5 util: Use blueslip error for util.the instead of an assert. 2024-09-03 13:49:30 -07:00
Aman Agrawal 240c870815 typeahead: Fix compose topic typeahead partially hidden.
The `flip` popper function is not working properly here since
we migrated to use Simplebar (Can be verified by removing
`data-simplebar`).

To fix it, we need to force trigger the function as soon as tippy
is attached to DOM.
2024-09-03 12:37:33 -07:00
Shubham Padia 1ec4539550 css: Rename .icon to .sidebar-item-icon for the name to be unique.
See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1901490
for more details.
2024-09-03 12:20:42 -07:00
Shubham Padia 2f120d2572 settings: Make show more tab look similar to other tabs.
Fixes https://chat.zulip.org/#narrow/stream/101-design/topic/org.20settings.20-.20show.20more.20-.20icon.20alignment/near/1935512
Also renames `.collapse-settings-btn` to `.collapse-settings-button`.
2024-09-03 12:20:42 -07:00
Shubham Padia 4a7983fad3 css: Use a class for spoiler header text.
Having the :not() rule there affected the performance, see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1920156
for more details.
2024-09-03 10:24:40 -07:00
Shubham Padia 28d9c02479 css: Have `move-handle` for every movable row instance.
The original motivation was to remove the `+ i` instances because of
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1934360.
But it seemed better to have similar html structure and css across all
movable rows.
2024-09-03 10:22:44 -07:00
Shubham Padia 77ebdfac77 css: Use classname for show_my_user_profile_modal icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia a764e80a1b css: Use classname for scroll-to-bottom icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia fe44ce3e24 css: Use classname for all-messages-search-caution icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia 82b68e9bdb css: Use classname for play_notification_sound icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
Also does some refactoring to account for the fact that
.setting_notification_sound does not have any icons as children.
2024-09-03 10:22:44 -07:00
Shubham Padia 6ec1b89502 css: Use classname for navbar_icon_and_title icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia ea60fee0ac css: Use classname for subscribe-to-more-streams icon styles.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:22:44 -07:00
Shubham Padia 9de064dc3e css: Use classname for setting-disabled-option icon.
Having the selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-09-03 10:18:29 -07:00
Vector73 b2a07971ec dropdown_widget: Allow more than one click on dropdown.
The new saved replies feature requires removing saved replies by clicking on
trash icon on dropdown item. So dropdown widget should allow more than
one click without closing it to delete multiple saved replies.
2024-09-03 09:20:27 -07:00
Aditya Kumar Kasaudhan b2ab77746b compose: Fix disabled buttons after exiting preview mode in edit UI.
This commit fixes the issue by ensuring that the `clear_preview_area` function is called within the `end_message_row_edit` method. This ensures that when the edit UI is reopened, it resets to the correct state, with all buttons enabled and functioning as expected.

Fixes #31503.
2024-09-03 09:19:10 -07:00
Karl Stolley a8ecba8ab8 settings: Remove .new-style, unused .button ul selector. 2024-08-30 14:06:27 -07:00
Karl Stolley 7a94d484ff settings: Remove unused or unnecessary center classes from .new-style cluster. 2024-08-30 14:06:27 -07:00
Karl Stolley f98551f128 settings: Remove unnecessary .block from .new-style cluster. 2024-08-30 14:06:27 -07:00
Karl Stolley 0cfddc9874 settings: Remove .w-200 class from .new-style cluster.
All elements that use this have their width already superseded by
other selectors.
2024-08-30 14:06:27 -07:00
Karl Stolley 2e6a34042f settings: Remove unnecesary inline-block div.
This also removes the need for any min-width declarations on the
labels, which will behave as block elements and take up the
containing block's available width.
2024-08-30 14:06:27 -07:00
Karl Stolley 668660bc71 settings: Remove unused .warning from .new-style cluster.
This seems to have been used with the `password_warning()` function
in `password_quality.ts`, but that function does not appear to be
called in the app--only in the portico.
2024-08-30 14:06:27 -07:00
Karl Stolley 35f84e5381 message_row: Allow moved/edit markers to scale. 2024-08-30 10:45:39 -07:00
Karl Stolley 776a90d9ba left_sidebar: Render brackets only on non-empty channels. 2024-08-30 10:34:07 -07:00
sujal shah 2c4596d990 settings_users: Fix for filter search text issue in settings users.
This commit addresses an issue where the search query applied in
one tab was inadvertently affecting all tabs
(Users, Deactivated, Invitations).

Now, the search functionality is properly isolated to the active tab,
ensuring that users can filter results without interference
from other tabs.

(One change needed for this was included in the previous commit).
2024-08-30 10:31:07 -07:00
Shubham Padia dad40eb296 settings_users: Show previously entered text in search filter. 2024-08-30 10:30:44 -07:00
Shubham Padia 548c583cf9 settings_users: Show previously selected value in role code dropdown.
Fixes
https://chat.zulip.org/#narrow/stream/9-issues/topic/filters.20are.20not.20working.20properly/near/1923794.
This commit also changes the datatype used for the dropdown to number
which is more suitable for our case.
2024-08-30 10:30:44 -07:00
Shubham Padia f38fe78e53 css: Use classnames for settings page .sidebar li items.
Having the > ul selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-08-30 10:23:19 -07:00
Shubham Padia 3afc34050b css: Use classnames for settings page .sidebar li items.
Having the `*` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
We've used `sidebar` instead of `sidebar-wrapper` for the rules in
dark-theme also, since that is the rule being followed for light theme.
We've introduced a new class called `sidebar-item`.
2024-08-30 10:23:19 -07:00
Jaimin Godhani c1755e3d94 settings: Rename display_settings.hbs to preferences.hbs.
Fixes part of zulip#26874.
2024-08-30 10:20:06 -07:00
Aman Agrawal 6d2cda4308 typeahead: Remove patch for IME enter events.
Key value for IME enter keypress is "Process", so we
don't need to patch it here.
2024-08-29 16:32:31 -07:00
Aman Agrawal 04aada3589 typeahead: Migrate to use `key` instead of `keyCode`.
`keyCode` is deprecated and those values are not readable.
2024-08-29 16:32:31 -07:00
Sayam Samal e4f1156bea condense: Dynamically render content for message length toggle.
This moves the content inside `message_length_controller` to a new
handlerbars template `message_length_toggle.hbs`, and dynamically
renders the content based on the message length.

Since the majority of the messages aren't collapsed/condensed, this
change should improve the initial rendering of the message list.

Fixes #31133.
2024-08-29 15:52:08 -07:00
Prakhar Pratyush 656c65c74c edit_history: Remove 'prev_rendered_content_version' field.
This commit removes the 'prev_rendered_content_version'
field from:

* the 'edit_history' object within message objects in the
API response of `GET /messages`, `GET /messages/{message_id}`
and `POST /zulip-outgoing-webhook`.
* the 'update_message' event type

as it is an internal server implementation detail not used
by any client.

Note: The field is still stored in the 'edit_history' column
of the 'Message' table as it will be helpful when making
major changes to the markup rendering process.
2024-08-29 15:37:12 -07:00
Sayam Samal c51bd1eab8 message_list: Conditionally render message edit form container element.
This commit moves the placeholder elements for the message edit form,
to `message_edit_form.hbs`, so they are conditionally rendered only
when a message is being edited, rather than being present for every
message in the list.

Fixes #31134.
2024-08-29 13:32:28 -07:00
Alex Vandiver b8e4bdccd8 postprocess_content: Un-URI-escape filename in title.
The filename contains URI-escaped characters, which do not need to be
escaped for safety -- they only make the filename in the tooltip less
readable.
2024-08-29 13:29:33 -07:00
sujal shah 333eedb351 stream_settings: Add text in the left panel.
Display "No channels match your filter" in the left panel
when no matches are found for filter queries in
"Subscribed", "All channels" and "Not subscribed" tabs.

Fixes #18332.
2024-08-28 14:23:46 -07:00
sujal aafcd43038 stream_settings: Show disabled create stream button and text.
Now user who don't have permission can see disabled stream create
button with message.
2024-08-28 14:23:46 -07:00
Lauryn Menard d54ca85de2 activity: Add view to see the ledger entries for a customer plan.
Adds a link to the plan ledger view in the current plan information
shown in the support views. Link is not shown if the plan is 100%
sponsored, e.g., the Community plan.

Adds a formatted header area to the activity table template so
that it's easy to add useful information to these activity views.
2024-08-28 14:12:36 -07:00
Varun Singh 3d6dcf8fe5 compose_fade: Remove duplicate `AllVisibilityPolicies` type. 2024-08-28 11:02:26 -07:00
Varun Singh 51ff57f1bf settings_config: Rename type`ColorSchemeDetails` to `ColorSchemaValues`. 2024-08-28 11:02:26 -07:00
Jaimin Godhani 243b57154b settings: Rename user_display_settings to user_preferences.
Fixes part of zulip#26874.
2024-08-28 11:01:02 -07:00
adnan-td e23d863981 narrow_banner: Fix message view banner for dm with deactivated user.
Previously the empty view banner for DM with any recipients
contained "Why not start the conversation".

For deactivated users/bots, we are now not displaying it.
2024-08-27 15:58:29 -07:00
adnan-td 120cfa8987 narrow_banner: Refactor recipient_user in direct message. 2024-08-27 15:58:29 -07:00
Sayam Samal ccb65795d9 user_card_popover: Display bot role conditionally in user card. 2024-08-27 15:52:39 -07:00
Sayam Samal 96a105b315 bots: Display bot role in lowercase in user card and user profile modal. 2024-08-27 15:52:39 -07:00
Sayam Samal 051221002a user_profile_modal: Display detailed bot role in the "Role" field.
The "Role" field previously only displayed "Bot" for the  non-system
bot users, this commit adds the detailed bot role to the "Role" field
in the format "Bot ({role})".
2024-08-27 15:52:39 -07:00
Sayam Samal 4cdd484755 user_card_popover: Display bot owner user card popover as an overlay.
This commit displays the bot owner card as an overlay in the middle of
the screen, like we do for mobile screen sizes where the reference
elements are hidden.

This also hides the bot user card when it's bot owner card is opened.
2024-08-27 15:52:39 -07:00
Sayam Samal adbfb35bb7 user_card_popover: Display bot's role in bot user card popover.
As a follow-up to the previous commit which repositions the bot owner
field, this commit adds the bot's role in the format "Bot ({role})" to
the previous position of the bot owner field in the bot user card.
2024-08-27 15:52:39 -07:00
Sayam Samal 5590c704ca user_card_popover: Reposition bot owner field and display as user pill.
This commit repositions the bot owner field from below the bot’s name to
align with the user fields, providing more space for the newly added
bot owner user pill.
2024-08-27 15:52:39 -07:00
sujal shah 8cc4252062 settings: Convert name to pills in custom emoji section.
previously, author names are displayed in plain text, now
they are converted to pills.

Fixes #30990.
2024-08-27 13:22:34 -07:00
Pratik Chanda 64a9f83473 compose_box: Fix order of group pm recipient pills on focus.
Earlier when compose box was opened or narrowed to pm, the recipient
pills were sorted according to user email strings instead of their
full names which was inconsistent with compose box placeholder text,
recipient row and message header.

This commit fixes the behaviour by introducing a `sort_email`
function to sort emails according to their full names and display
sorted pills.

Fixes: zulip#27375.

Co-authored-by: richardshaju <richardshaju66@gmail.com>
2024-08-27 13:21:16 -07:00
Pratik Chanda c180b25a68 drafts: Fix order of group pm recipients in draft overlay.
Earlier in drafts overlay, the order of pm recipients for the draft
was sorted differently to that of the pm group title.

This commit fixes the behaviour by sorting the drafts pm recipients
using `make_strcmp`.

Fixes part of zulip#27375.

Co-authored-by: richardshaju <richardshaju66@gmail.com>
2024-08-27 13:21:16 -07:00
Pratik Chanda eeae434625 left_sidebar: Fix order of group pm recipients in left sidebar.
Earlier in left sidebar, the recipient names were not sorted
consistently with the message header of the pm.

This commit fixes the behaviour by sorting the recipient names in
left sidebar with `make_strcmp`.

Fixes part of zulip#27375.

Co-authored-by: richardshaju <richardshaju66@gmail.com>
2024-08-27 13:21:16 -07:00
Pratik Chanda 54a7cefede message_store: Fix order of group full names of pm recipients.
Earlier, in group direct message, the full names of group pm recipients
were sorted incorrectly which is used for tooltip on hovering over
recipient row and text placeholder of collapsed compose box. That
resulted in different order of recipient names.

This commit fixes the behaviour by using the `make_strcmp` to sort
the names to show in the tooltip and collapsed compose box.

Fixes part of zulip#27375.

Co-authored-by: richardshaju <richardshaju66@gmail.com>
2024-08-27 13:21:16 -07:00
Pratik Chanda 465b40e7ae filter: Fix order of group direct message recipients on message title.
Earlier, when narrowed to a group direct message, the header title
was sorted with respect to its email instead of their names. This
would result in message header and recipient row having different
order of recipients.

This commit fixes the behaviour by changing the order of the names
passed for the group message header using `make_strcmp`.

Fixes part of zulip#27375.
2024-08-27 13:21:16 -07:00
Pratik Chanda 9f94e6c58d message_header: Fix order of group direct message recipients.
Earlier, the order of recipients in recipient row of group direct
message weren't in the same sorting pattern as that of message
title which would result in inconsistent order of recipient names.

This commit fixes the behaviour in `private_message_header` in
recipient row to sort the names using `strcmp`.

Fixes part of zulip#27375.

Co-authored-by: richardshaju <richardshaju66@gmail.com>
2024-08-27 13:21:16 -07:00
opmkumar b9425d4d10 left sidebar: Improve how starred message count is hidden.
Fixes #30898.
2024-08-27 13:08:29 -07:00
Karl Stolley cd88f4421b left_sidebar: Better handle bracket with resolved topics. 2024-08-27 13:03:55 -07:00
Karl Stolley de69424a81 left_sidebar: Extend bottom bracket for show all topics control. 2024-08-27 13:03:55 -07:00
Karl Stolley 2374c8a8c0 left_sidebar: Add grouping border to channel and topics. 2024-08-27 13:03:55 -07:00
Karl Stolley 65cd772e24 left_sidebar: Adjust gridded rows to match Vlad's design. 2024-08-27 13:03:55 -07:00
Karl Stolley a22aa41367 left_sidebar: Update left sidebar padding for new design.
This also moves the 2px of reduced lefthand padding to the overall
width of the left sidebar, which will keep the left sidebar at its
same width (in other words, the message area will not shift any
further to the left, either).

Fixes #27565
2024-08-27 13:03:55 -07:00
evykassirer 3dd0ef6bf9 message_list_view: Calculate date divider variables before assignment.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
2024-08-26 08:14:57 -07:00
evykassirer fa4d5bec2c message_list_view: Use clearer variable name for clear_message_date_divider. 2024-08-26 08:14:57 -07:00
evykassirer 3266eda3e9 message_list_view: Calculate group display date with a pure function.
Where "pure function" means that the group's value isn't changed
in this function.

This commit also modifies the function to just take a message.

This is part of a bigger refactor to calculate message list group
attributes and creating the group all at once instead of piecewise.
This is necessary to convert this module to typescript, since a
partially formed group is hard to type.
2024-08-26 08:14:57 -07:00
evykassirer b8bda635b7 message_list_view: Only pass message to same_day.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
2024-08-26 08:14:57 -07:00
evykassirer e815fbb499 message_list_view: Only pass message to get_timestr.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
2024-08-26 08:14:57 -07:00
evykassirer 79f8d2ed79 message_list_view: Calculate _get_msg_timestring with only message.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
2024-08-26 08:14:57 -07:00
evykassirer 017bca56e4 message_list_view: Refactor me message calculation for typescript.
We're going to need to be able to build the message list view
in pieces and put it all together in the end, instead of assigning
values directly to a half-formed object (which is hard to type).

This is part of the work towards that.
2024-08-26 08:14:57 -07:00
evykassirer 1a204ff554 message_list_view: Use util.the for converting JQuery to HTMLElement. 2024-08-26 08:14:57 -07:00
evykassirer 2f77463864 util: Fix same_sender type signature to allow undefined messages. 2024-08-26 08:14:57 -07:00
evykassirer fc0367ff0d message_container: Remove two unused class variables. 2024-08-26 08:14:57 -07:00
evykassirer 44522a6244 message_list_view: Standardize type of dom_updates.html_updates.
When we convert this module to typescript, the type of `rendered_date`
will need to be a valid input to `$element.html`. Elsewhere in this
file, the date is a string. Here it's a JQuery object, which isn't
a valid input, but HTMLElement is, so this commit converts it to that.

I tested this manually and it still renders correctly.
2024-08-26 08:14:57 -07:00
evykassirer 1a47a2ccaa message_list_view: Remove unused parameter to _rerender_header.
This param was added in 7d8d9c1bf9 but
never added to _rerender_header itself.
2024-08-26 08:14:57 -07:00
evykassirer 6c063f4974 message_list_view: Remove unused return statement. 2024-08-26 08:14:57 -07:00
Anders Kaseorg 892f988404 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-26 07:44:14 -07:00
Anders Kaseorg 8196c4f63d eslint: Fix @typescript-eslint/prefer-regexp-exec.
https://typescript-eslint.io/rules/prefer-regexp-exec/

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-26 07:44:14 -07:00
Anders Kaseorg e6344bd1f5 debug-require-webpack-plugin: Add null check for TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-08-26 07:44:14 -07:00
opmkumar 8911347cdb hotkey: Add keyboard shortcut to navigate to starred messages view.
This commit adds '*' as a keyboard shortcut to navigate to the starred messages view and the shortcut is documented in various required locations accordingly.
Fixes #31397.
2024-08-23 15:49:31 -07:00
Aman Agrawal 5f6045c878 typeahead: Change icon for wildcard mentions. 2024-08-23 15:43:44 -07:00
afeefuddin f013eb1037 message_fetch: Convert module to TypeScript. 2024-08-23 13:34:13 -07:00
afeefuddin ec19a34089 message_fetch: Pass msg_list_data explicitly to load_messages. 2024-08-23 13:34:13 -07:00
afeefuddin afe405e0ab message_fetch: Avoid variable reuse in narrow transformation logic. 2024-08-23 13:34:13 -07:00
afeefuddin b41a17a1d0 message_lists: Add is_combined_feed_view to MessageList type. 2024-08-23 13:34:13 -07:00
afeefuddin 8741fe92be message_list_data: Update callback parameter types.
Correct the type annotations for the callback function parameter in
set_add_messages_callback.
2024-08-23 13:34:13 -07:00
afeefuddin 17e2d46760 message_store: Rewrite RawMessage type using Zod.
This commit rework RawMessage and it's related type to use
Zod for parsing the data received from the server.
2024-08-23 13:34:13 -07:00
Varun Singh f148a7a3ed popover_menus_data: Convert module to TypeScript. 2024-08-23 13:10:50 -07:00
Varun Singh d86e5eab78 user_topics: Add `AllVisibilityPolicies` to type. 2024-08-23 13:10:50 -07:00
Varun Singh 118c53dfc3 state_data: Type `realm_enable_read_receipts` field. 2024-08-23 13:10:50 -07:00
Varun Singh df395e99eb settings_config: Add type ColorSchemeDetails. 2024-08-23 13:10:50 -07:00
Varun Singh 1ce76e5fbd message_lists: Add field `message_containers` to `MessageListView` type. 2024-08-23 13:10:50 -07:00
Varun Singh 79dbb8dc79 base_page_params: Add `show_remote_billing` field to schema. 2024-08-23 13:10:50 -07:00
Varun Singh fcb9c7be26 widgetize: Fix type of `data` field. 2024-08-23 12:30:27 -07:00
Varun Singh 2cf09602df todo_widget: Convert module to TypeScript. 2024-08-23 12:30:27 -07:00
Varun Singh 9cd41e1c5b poll_widget: Amalgamate 'outbound_data' types for poll-widgets.
This will help in migration of downstream JS code.
2024-08-23 12:30:27 -07:00
Sahil Batra 5c7756e1ef user_profile: Update stream dropdown option value to be of "number" type.
It is better to have stream dropdown option value, which is the ID
of the stream, to be of "number" type.

This fixes the assertion error which occurred when someone tried to
subscribe the user to a stream from user profile modal.
2024-08-23 09:12:43 -07:00
Sahil Batra d2c7e7e94c user_groups: Fix live updating user groups UI.
This commit updates code to live update the groups UI if
realm or group level setting to manage groups is changed.

This commit also does some refactoring to better organize the
code in different functions.

And also, the code to hide/disable the UI if the user does not
have permission to manage the group in JS such that the same code
is used for live-updating as well.
2024-08-23 09:09:03 -07:00
Sahil Batra 03ec0e1f14 stream-settings: Live update subscribers list correctly.
This commit fixes the live update of subscribers list
on changing can_remove_subscribers_group setting.

Previously, whole members panel, including the pill container
to add subscriebrs, is re-rendered. But the click and input
handlers for the add subscribers UI is not added again after
re-rendering and thus they do not work.

This commit updates the code to just re-render the subscribers
list which is only needed to update the "Unsubscribe" button.
2024-08-23 09:09:03 -07:00
Karl Stolley 27bf68637b global_times: Correct malformed closing tags in overlay. 2024-08-22 09:12:20 -07:00
evykassirer 6ff793590f bootstrap_typeahead: Fix bug on select with no active item.
This bug was introduced in d9f25d01a1
It's possible that `find(".active")` returns `undefined` here.
2024-08-21 16:07:37 -07:00
Karl Stolley 562e6d6802 global_times: Allow global times to display inline. 2024-08-21 16:02:33 -07:00
Karl Stolley 02161582fd mentions: Allow mentions to display inline. 2024-08-21 16:02:33 -07:00
Aman Agrawal 580b9e9dae navbar: Remove signup button.
This allows log in button in navbar for spectators to have more space
to be displayed in different languages without being truncated.
Login page already has 2 buttons for user to sign up from.
2024-08-21 12:02:59 -07:00
Sahil Batra 6718ff5166 user_groups: Make bottom margin for setting consistent with streams.
This commit increases the gap between group setting elements to make
it same with what we have for stream settings.
2024-08-21 10:30:25 -07:00
Sahil Batra 688def19ab user_groups: Fix showing tooltip for disabled settings.
Preivously, the tooltip was shown only for first element
since initialize_disable_btn_hint_popover only added the
tooltip to first element. And then after d9f25d01a1, there
was an error shown as initialize_disable_btn_hint_popover
asserted that only single element list was passed.

This commit fixes it by calling initialize_disable_btn_hint_popover
for each setting element. Similarly the code to destroy the
tooltip on enabling the setting elements is called for each
element.
2024-08-21 10:30:25 -07:00
afeefuddin be9d879682 settings_bots: Convert module to TypeScript. 2024-08-21 08:28:40 -07:00
afeefuddin 4b89d0ff06 state_data: Add realm_bot_creation_policy type. 2024-08-21 08:28:40 -07:00
afeefuddin 5579700920 list_widget: Make filter_value optional in render_empty_list_message_if_needed. 2024-08-21 08:28:40 -07:00
Aman Agrawal 7f38c95384 dropdown_widget: Fix click event being triggered multiple times.
Reset event handlers attached to the dropdown widget and by removing
it from DOM.

User is unlikely to use the same dropdown multiple times, even if
they do, the operation is fast.
2024-08-20 09:56:59 -07:00
Aman Agrawal 82d3058b53 dropdown_widget: Remove unused instance property. 2024-08-20 09:56:59 -07:00
evykassirer d9f25d01a1 web: Use util.the for accessing element of single-item lists. 2024-08-20 09:48:15 -07:00