Commit Graph

3576 Commits

Author SHA1 Message Date
Prakhar Pratyush a8d056ac3b typing: Fix assertion error when narrowed to a non existing stream.
When narrowing to a stream which doesn't exist, the
code to render users who are typing in that narrow
resulted in an assertion error as the stream didn't exist.

This commit removes the assertion and returns an empty array
(array of users who are typing) in such case to fix the issue.
2024-02-22 16:12:42 -08:00
Prakhar Pratyush f023a11d01 typing: Fix "Missing stream_id" server error.
This commit fixes an error where composing a message with
no stream selected resulted in making a POST request to
'/typing' with stream_id as undefined which resulted in
a "Missing server_id" error.

We no longer make a POST request if the stream is not
selected.
2024-02-22 16:12:42 -08:00
Karl Stolley 1a5c475910 features: Make All view table as narrow as possible. 2024-02-22 16:10:56 -08:00
Karl Stolley 65bbfa8d44 features: Tweak edge cases across feature subheaders. 2024-02-22 16:10:56 -08:00
evykassirer ea2818786e buddy_list: Convert module to typescript. 2024-02-22 16:05:27 -08:00
evykassirer 5db0f5f29a buddy list: Remove stale jank from find_li.
It's clearer to return undefined than an empty list,
because it's easier to do an equality check for undefined
at call sites to this function.

`ListCursor.get_row` returns early for falsey values
returned from `find_li`, so I think whatever this
comment is referring to is no longer relevant.
2024-02-22 16:05:27 -08:00
evykassirer be033394b1 stream events: Rebuild buddy list when user is subscribed or unsubscribed. 2024-02-22 16:05:27 -08:00
evykassirer 5434130171 buddy list: Calculate render data once per view.
The work now being done in set_render_data used
to be done in render_more, which is called in
batches of 20 rows at a time. This work only
needs to be done once per narrow/view, so this
is a great performance improvement.
2024-02-22 16:05:27 -08:00
evykassirer 231c0087a4 compose fade users: Remove fade logic in favor of buddy list split.
This also removes buddy_list.get_items which were only used
for compose_fade logic.
2024-02-22 16:05:27 -08:00
evykassirer 231aa098cb buddy list: Create section in buddy list for users from narrow.
Fixes #21285.
2024-02-22 16:05:27 -08:00
Sahil Batra b154cb39f8 groups: Handle "#groups/new" url for users who cannot create groups.
We already do not show the buttons for opening the group creation
form if user is not allowed to create group at all, but the
user can still open the form by going on "#groups/new" url.

This commit fixes this by redirecting such users to "#groups/your"
like we do for streams.
2024-02-22 13:09:33 -08:00
Sahil Batra 2fe36cc0d7 group-settings: Handle invalid urls correctly.
There were couple of problems in our handling of invalid or
incomplete URLs-
- The browser back button behavior breaks if someone enters
url with invalid group ID, incorrect group name.
- On typing group edit URLs with invalid group ID, an error
was raised and the URLs remained the same with just opening
the groups overlay with "Your" tab selected in left panel.
- On typing group edit URLs with incorrect right side tab or
without any right side tab, we showed "general" section, which
is fine, but the URL was still incorrect.

This commit fixes the above mentioned problems-
- URLs with invalid group IDs are now handled gracefully
with groups UI opening in the same way as before but the
url is updated to "#groups/your".
- We now update the right side tab to "general" if right
side tab is invalid or there is no right side tab.
- All the URL updates to fix invalid urls are done using
"history.replaceState" to make sure the browser back button
behaves as expected.
- All the code for checking the urls is done in hashchange.js
itself, so we can remove some code from change_state.
2024-02-22 13:09:33 -08:00
Sahil Batra eea5ee8923 stream-settings: Handle invalid urls correctly.
There were couple of problems in our handling of invalid or
incomplete URLs-
- The browser back button behavior breaks if someone enters
url with invalid or inaccessible stream ID, incorrect stream
name, "#streams/new" url without permission to create streams.
- On typing stream edit URLs with incorrect right side tab or
without any right side tab, we showed "general" section, which
is fine, but the URL was still incorrect.

This commit fixes the above mentioned problems-
- We now update the right side tab to "general" if right
side tab is invalid or there is no right side tab.
- All the URL updates to fix invalid urls are done using
"history.replaceState" to make sure the browser back button
behaves as expected.
- All the code for checking the urls is done in hashchange.js
itself, so we can remove some code from change_state.
2024-02-22 13:09:33 -08:00
Sahil Batra 7da8f9650c streams: Handle "#streams/new" url for users who cannot create streams.
We already do not show the buttons for opening the stream creation
form if user is not allowed to create streams at all, but the
user can still open the form by going on "#streams/new" url.

This commit fixes this by redirecting such users to
"#streams/subscribed" like we do for guests.
2024-02-22 13:09:33 -08:00
Sahil Batra 54bc960898 message_view_header: Include right tab in stream settings link.
Previously, the link opened on clicking the stream name in
header was "#streams/{stream_id}/{stream_name}". It is now
changed to "#streams/{stream_id}/{stream_name}/general" as
the stream edit UI is opened with "general" tab.
2024-02-22 13:09:33 -08:00
Sahil Batra 61d481559f group_settings: Include tab selected in right section in url hash.
The url hash for a group edit view now includes "general" or
"members" in the end depending upon which tab is selected in
the right section.

Fixes #28678.
2024-02-22 13:09:33 -08:00
Sahil Batra 79975ae27e group_settings: Refactor code to handle tabs in right section.
We now use "data-group-section" attribute to set the "key" for
toggler in right section of groups overlay.

This change is preparatory work for showing the section opened
in right side in the url hash as we would use the "key" value
in url hash as well and the existing "group_general_settings"
and "group_member_settings" toggler key values were too long to
be used in the url. We previously used toggler key value as
class name and then used that class as selector to show the
relevant section but we now use "data-group-setting" section
to avoid using common class names like "general" and "members".
2024-02-22 13:09:33 -08:00
Sahil Batra e40846ef4e user_group_edit: Do not pass unused parameter to function.
There is no need to pass group as parameter to
update_toggler_for_group_setting.
2024-02-22 13:09:33 -08:00
Anders Kaseorg ac166dcfd4 dependencies: Upgrade JavaScript dependencies.
Fixes #26969.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-22 12:46:40 -08:00
Sayam Samal 9a12d1798e read_receipts: Fix duplication bug when opening menu repeatedly.
The (1) delay in fetching the read receipts data from the api call to
`/json/messages/${message_id}/read_receipts`; followed by the execution
of the success callback function, and the (2) use of `.append()` to
render the modal and user list, together lead to duplication of the read
receipts modal and also the user list inside the read receipts menu.

This commit adds a check to set the read receipts menu contents only if
the read receipts modal for the selected message ID is open by the time
the network request is resolved.

In addition, this commit also uses the `on_shown` hook instead of the
`on_show` hook in the read receipts modal logic, to add a delay in the
calling of the read receipts API, which prevents the stacking of the
requests.
2024-02-22 10:49:29 -08:00
Sayam Samal ece115c22d hotkey: Reorder "Edit selected message or view source" in ? and /help. 2024-02-22 10:49:29 -08:00
Sayam Samal eae148b67a hotkey: Add `Shift` + `V` shortcut to toggle read receipts modal.
The read receipts option, resides under the triple-dot message actions
menu. This made the process of viewing the read receipts take up
multiple steps, even via a keyboard-driven workflow.

Via this commit, now while focused on any message in a message feed,
and pressing `Shift` + `V`, efficiently brings up the read receipts
for that message.

Fixes part of #24716.

Co-Authored-by: SameepAher <sameepaher@gmail.com>
2024-02-22 10:49:29 -08:00
evykassirer b30f6bb705 user_search: Convert module to typescript. 2024-02-21 19:14:02 -08:00
evykassirer 860150525c sidebar_ui: Convert module to typescript. 2024-02-21 18:50:51 -08:00
evykassirer 134c5a8315 sidebar_ui: Add missing param to should_mask_unread_count. 2024-02-21 18:50:51 -08:00
evykassirer b609d3d88e base_page_params: Add realm_rendered_description. 2024-02-21 18:50:51 -08:00
Karl Stolley ecbfd61e6a left_sidebar: Remove padding from bot icon.
This is no longer necessary for vertical alignment, and by
removing the 6px of padding it represents, bot DM rows will have
the same 22px height as other DM rows.
2024-02-21 13:14:02 -08:00
Tim Abbott 2598596ad2 vdom: Eliminate undefined type declaration for impossible case.
This was just debugging logic working around the fact that vdom.ts was
not originally implemented in TypeScript, and should not be polluting
our types.
2024-02-21 10:49:24 -08:00
evykassirer aab25fae6a pm_list: Convert module to typescript. 2024-02-21 10:49:24 -08:00
Karl Stolley 1093ff841f left_sidebar: Remove unnecessary padding on bot icon. 2024-02-21 10:32:02 -08:00
Lauryn Menard 16135fbac6 support: Clean up class names in support views.
Updates the class name used for the sponsorship form container in
the remote support views to be more specific.

Adds a shared "support-form" class for the different forms in the
realm_details template.

Use the same CSS rule for current and next plan information sections.
2024-02-21 10:28:08 -08:00
Prakhar Pratyush ee612dafac settings: Rename signup_notifications_stream realm setting.
This commit renames the realm-level setting
'signup_notifications_stream' to 'signup_announcements_stream'.

The new name reflects better what the setting does.
2024-02-21 09:04:23 -08:00
Prakhar Pratyush ab453fbe20 settings: Rename notifications_stream to new_stream_announce..._stream.
This commit renames the realm-level setting 'notifications_stream'
to 'new_stream_announcements_stream'.

The new name reflects better what the setting does.
2024-02-21 09:04:23 -08:00
shashank-23002 d6219e93a8 popover: Rename user-card-status-text. 2024-02-20 18:10:38 -08:00
shashank-23002 6caacbcd07 tooltips: Fix status-emoji tooltip for user-card popover.
This tooltip seems to have been broken when #user_info_popover was
renamed to the user card popover.
2024-02-20 18:10:38 -08:00
shashank-23002 865f886f56 tooltips: Add a dedicated tooltip for status-emoji.
Fixes: #26772
2024-02-20 18:10:38 -08:00
Lauryn Menard b9c4a8a811 support: Add CSS formatting for form areas on support views. 2024-02-20 15:46:55 -08:00
Lauryn Menard b6d50c158d support: Add CSS grid for confirmation objects in query results. 2024-02-20 15:46:55 -08:00
Lauryn Menard b74a8a5ff5 support: Add CSS grid for user and user realm. 2024-02-20 15:46:55 -08:00
Lauryn Menard 8c5325fc2c remote-support: Add CSS grid for remote server and remote realms. 2024-02-20 15:46:55 -08:00
Lauryn Menard 439e88e251 support: Remove relative positioning for form elements.
Prep commit for adding a grid layout for some query response data.
2024-02-20 15:46:55 -08:00
Aman Agrawal e6718369d6 css: Apply fa-chevron-down CSS to zulip-icon-chevron-down.
This was missed as part of #27577 migration.
2024-02-20 15:16:56 -08:00
N-Shar-ma 8002f0db8f compose: Fix bug where sometimes message draft remained post sending it.
Now whenever we initiate sending a message, we save / update its draft,
which is deleted on a successful send. Earlier, we did this only for
locally echoed messages. Hence a non locally echoed message's draft
would remain, if created in the timeframe between initiating send and
receiving the same message from the server, which can be significant
for slow connections.
2024-02-20 11:59:46 -08:00
Aman Agrawal 90e67f7d75 upgrade: Fix spacing issue for fixed plan upgrade page. 2024-02-20 11:51:32 -08:00
Aman Agrawal 949379581e billing: Add separate entry point for billing login pages.
We just exclude upgrade.ts from the imports to avoid page_params
being imported which results in an error.

s
2024-02-20 11:51:32 -08:00
shashank-23002 5803d4afec clipboard: Align click to copy button inside spoiler tag.
Fixes: #20712
2024-02-20 10:18:43 -08:00
Aman Agrawal 0c6dfd1e5e message_actions_popover: Select message being moved.
This helps keep the content of this message in the move messages
modal relevant.
2024-02-20 09:29:26 -08:00
Aman Agrawal 4d1bb762be css: Add 25px to content width on right for chevron-down icon.
This fixes chevron-down icon overlapping with content when content
occupies full width of the select element.
2024-02-20 09:29:26 -08:00
Varun Singh c91ca3eca8 message_live_update: Convert module to TypeScript. 2024-02-20 08:30:04 -08:00
Varun Singh 5fd6a819d4 message_lists: Add 'rerender_messages' function to type. 2024-02-20 08:30:04 -08:00