Commit Graph

2380 Commits

Author SHA1 Message Date
Aman Agrawal 54ac09174b recent_view_table: Add a tooltip to unread sort header. 2023-09-28 08:03:47 -07:00
Hardik Dharmani 55b0b5cb96 gear_menu: Remove href="#logout" from logout button.
Remove href="#logout" from last option of gear_menu as
logout is already handled by click handler for .logout_button.

Fixes part of #22802
2023-09-27 18:01:47 -07:00
evykassirer dec49883d4 search: Close search box when searching for an empty string.
Previously clearing the search box and pressing enter would
redirect the user to All Messages. This commit changes the
behavior so that the search bar closes with no other effects.

More discussion on this on CZO here:
https://chat.zulip.org/#narrow/stream/101-design/topic/recent.20conversations.20for.20streams/near/1621501
2023-09-27 17:33:49 -07:00
Karl Stolley b6fd9c3584 left_sidebar: Better express stream-icon vertical alignment. 2023-09-27 14:06:09 -07:00
Karl Stolley a27cfa9a84 left_sidebar: Express stream row as grid. 2023-09-27 14:06:09 -07:00
Karl Stolley bbedd0ca0d left_sidebar: Restructure stream rows to match topics. 2023-09-27 14:06:09 -07:00
Karl Stolley 874bfbfd43 left_sidebar: Remove whitespace near follow icon.
Only the icons and unreads should be treated as flex items. Not
text nodes or whitespace.

See CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/Left.20sidebar.20rows.20as.20grids/near/1645466
2023-09-27 14:06:09 -07:00
Karl Stolley e7814cbc46 left_sidebar: Display markers and controls as flex items.
This commit also resets a few styles that no longer make sense in
a flex setting for markers and controls.
2023-09-27 14:06:09 -07:00
Karl Stolley de88df5de8 left_sidebar: Establsh topic rows as a CSS grid.
This commit includes fixes to satsify vertical alignment, which is
now solely handled by CSS Grid. The commit also consolidates styles
and selectors for the sake of both necessity and readabilty.
2023-09-27 14:06:09 -07:00
Karl Stolley 7b6f078cfc left_sidebar: Explicitly register clickable topic areas.
This seems to more accurately express the current, desired behavior
in topics lists, but it is a necessity for moving the vdots into
the topic box (otherwise, vdots clicks simultaneously register on
the topic box itself).
2023-09-27 14:06:09 -07:00
Karl Stolley 951714b2d0 left_sidebar: Group topic markers and controls.
This also corrects a set of single quotes, on the href attribute in
the topic list-item template..
2023-09-27 14:06:09 -07:00
Karl Stolley c19c23e311 left_sidebar: Include vdots in topic box. 2023-09-27 14:06:09 -07:00
Karl Stolley 04e1d2c39d left_sidebar: Structure topic box as a div.
This helps clarify in the templates that the topic box is in fact
a box, and not an inline item (span).

Also, single quotes have been changed to doubles in li and new div
elements.
2023-09-27 14:06:09 -07:00
Aman Agrawal a11178310c navbar: Minor adjustments.
Use semi-transparent background color and few margin adjustments.
2023-09-27 13:07:57 -07:00
Aman Agrawal 54d2a02f7e footer: Minor adjustments. 2023-09-27 13:07:57 -07:00
Karl Stolley b70dc23a47 view_labels: Change 'Direct messages' to 'All direct messages'. 2023-09-27 12:48:06 -07:00
Karl Stolley 48424c4c8e navbar: Explicitly calculate offset from title and search.
A separate `margin-right:` declaration helps keep the calculation
and intention more readable.
2023-09-27 12:22:47 -07:00
Karl Stolley ad588e7441 navbar: Set search-container width in CSS vars. 2023-09-27 12:22:47 -07:00
Anders Kaseorg 83f696d217 util: Fix inefficient RegExp construction.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-27 11:33:13 -07:00
Anders Kaseorg 50a751cc23 bootstrap: Delete button JavaScript.
Commit 537617b46d (#23466) removed our
last use of .button(), and we have never used data-toggle="button".

(We are still very entangled with the Bootstrap button CSS, so that
remains for now.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-27 11:13:45 -07:00
Tim Abbott b3c44864fa user_profile: Move show_button_spinner to correct module.
It's only used in one place, from code that we moved to
user_profile.js in recent weeks.
2023-09-27 10:41:05 -07:00
Vector73 9e9326b5df settings_users: Add "Reactivate user" option in "manage user" panel.
Fixes: #26693.
2023-09-27 10:41:05 -07:00
Tim Abbott 5177f25353 settings: Move confirm_reactivation out of settings_users.js.
This better organization may also simplify removing import cycles in
the future.
2023-09-27 10:41:05 -07:00
Evy Kassirer aa8d3a0c6c
search: Always select search bar text when initiating search.
This reverts part of cb04ae1f95 that
nobody understands the purpose of, and fixes this case.
2023-09-27 10:24:55 -07:00
N-Shar-ma 178588e5b4 documentation: Make the markdown div take up all available height.
Changing `100vh` to `100%` makes the markdown div take up the full
height of the page, even when the page is scrolled. This fixes the bug
where the lower right corner of the page was not covered by the markdown
div and the background was visible.
2023-09-27 09:43:30 -07:00
Aman Agrawal d99a8ff180 recent_view_util: Fix return type of get_key_from_message.
Since `msg.to_user_ids` is always defined when `msg.type === "private"`,
return type is just string.
2023-09-27 09:40:57 -07:00
Hardik Dharmani 6c1f993855 user_preferences: Change option text for "Show unread counts for".
This commit updates the text for a dropdown option `Unmuted streams`
to `Unmuted streams and topics` for `Show unread counts for` user
preference settings for better clarity.
2023-09-26 15:10:51 -07:00
Sahil Batra 1de3a9f4a3 bots: Extract code for showing integration url modal in new file.
This commit creates a new file integration_url_modal.js which
now contains the code for showing integration url modal.

Since show_generate_integration_url_modal is used in multiple
places, this change helps us in avoiding import cycles.
2023-09-26 09:15:20 -07:00
Sahil Batra f3c17b8d4f users: Extract code for showing deactivation modal in new file.
This commit creates a new file user_deactivation_ui.js which
now contains the code for showing deactivation modal for user
and bots.

Since confirm_deactivation and confirm_bot_deactivation functions
are used in multiple places, this change helps us in avoiding
import cycles.
2023-09-26 09:15:20 -07:00
Sahil Batra 8852c4b7af settings_data: Rename type_id_to_string to bot_type_id_to_string.
This commit renames type_id_to_string to bot_type_id_to_string
which is a much better name and explains the use of function
in a better way.
2023-09-26 09:15:20 -07:00
Aman Agrawal ede7f62781 inbox: Call update from unread_ui.update_unread_counts.
Fixes #26687

This seems work correctly after manually testing all the events
for which inbox_ui.update was previously called.
2023-09-25 13:28:13 -07:00
Aman Agrawal 61f602ed73 inbox: Sort muted streams lower than others. 2023-09-25 13:16:25 -07:00
Aman Agrawal ffb944de8e hashchange: Call hide inbox and recent view in show_default_view.
We call show_default_view in various places which didn't use to
check if the other views are hidden. This can cause multiple views
to be visible at the same time.

For example: If inbox is the default view and you press escape
from recent topics, both recent topics and inbox will be visible.
2023-09-25 13:16:25 -07:00
Aman Agrawal e0ff125116 views: Write a common show and hide function.
Fixes #26688
2023-09-25 13:16:25 -07:00
Aman Agrawal 2f7a260f3a inbox: Hide empty inbox notice when inserting a stream. 2023-09-25 13:16:25 -07:00
Aman Agrawal 4fcc488db5 inbox: Show group pms without status icons. 2023-09-25 13:16:25 -07:00
Aman Agrawal 1bd50e60ec inbox: Amend comment to clarity placement of scrollTop. 2023-09-25 13:16:25 -07:00
Aman Agrawal 386d3e7001 inbox: Fix renamed topics not rerendered correctly.
Marking a topic as resolved and then unresolved makes removes the
topic from inbox list. This was caused by previous unresolved topic
data acting as false data for the new unresolved topic.
2023-09-25 13:16:25 -07:00
Aman Agrawal 1f0ed948b4 inbox: Match margin between mention indicator and unread count. 2023-09-25 13:16:25 -07:00
Sahil Batra c7cbdd3741 custom_fields: Extract some code in custom_profile_fields_ui.js.
This commit moves initialize_custom_pronouns_type_fields,
initialize_custom_user_type_fields, initialize_custom_date_type_fields
and append_custom_profile_fields functions to the new file
custom_profile_fields_ui.js from settings_account.js since
they are used for both showing custom profile fields in
"Profile" settings panel and "Edit user" form shown in
user profile modal. This change also helps us in avoiding
import cycles.
2023-09-25 13:14:49 -07:00
Sahil Batra 749af058a4 settings_users: Move show_edit_user_info_modal to user_profile.js.
Since the user-edit form is opened inside user profile modal,
user_profile.js is a better place for show_edit_user_info_modal
function and would help us in removing import cycles as well.
2023-09-25 13:14:49 -07:00
Sahil Batra f0a265c363 settings_bots: Move show_edit_bot_info_modal to user_profile.js.
Since the bot-edit form is opened inside user profile modal,
user_profile.js is a better place for show_edit_bot_info_modal
function and would help us in removing import cycles as well.
2023-09-25 13:14:49 -07:00
Sahil Batra 46ab3031a3 settings_bots: Move type_id_to_string to settings_data.js. 2023-09-25 13:14:49 -07:00
Prakhar Pratyush 8df42a729d message_header: Remove the widget to change the visibility policy.
This commit removes the widget to change the visibility policy
for topics in unsubscribed streams.

Earlier, users were able to change the visibility policy in an
unsubscribed stream, which can lead to confusion.

For example, a person might think that they would get notifications
about new messages in the topic of the unsubscribed stream,
which of course they wouldn't.
2023-09-25 12:39:06 -07:00
Prakhar Pratyush e1d867c05e unread_msgs: Fix the unread count in muted streams.
In the muted stream, the unreads from followed topics were not
adding up to the total unread count of the stream if both unmuted
and followed topics had unreads.

This commit fixes the incorrect behavior.
2023-09-25 11:43:21 -07:00
Anders Kaseorg 6d5a25170a help: Restore scroll target styling.
This restores the styling previously added by commit
ceec61ba10 (#25573).  The .scroll-target
class of commit b852da6eed (#25573) was
removed by commit 8dba4cbba6 (#15713,
merged later) and is unnecessary.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-25 11:42:04 -07:00
Tim Abbott 7585f87c64 css: Remove dark theme overrides for removed Bootstrap CSS. 2023-09-25 06:29:47 -07:00
Tim Abbott 872f2c6f85 bootstrap: Remove most now-unused popovers/tooltip CSS.
What remains needs to be audited as we appear to still declare some of
those classes.
2023-09-25 06:29:47 -07:00
Tim Abbott 1664b06926 bootstrap: Remove duplicate copy of popover/tooltip CSS.
The copy we've been actually using is the one in the separate
bootstrap-tooltip.css file.
2023-09-25 06:29:47 -07:00
Tim Abbott c0708a892a bootstrap: Remove tooltip/popovers JS modules.
Apparently, we had two copies -- the one in bootstrap.js being
overridden by the one in the separate module.

We can't yet remove all the CSS, since some of it appears to still be
in use in some of the popovers.
2023-09-25 06:29:47 -07:00
Tim Abbott 35bc34186e popovers: Remove tracking for Boostrap popovers.
In theory we no longer have any of these.
2023-09-25 06:29:47 -07:00
Tim Abbott 3397627a28 popovers: Move initialize logic to popover_menus.js. 2023-09-25 06:29:47 -07:00
Tim Abbott 573c77a9eb popovers: Move scroll handler to popover_menus module.
Part of cleaning out the original legacy popovers system.
2023-09-25 06:29:47 -07:00
Tim Abbott eb26dc6ecd popovers: Move keyboard UI functions to modern module. 2023-09-25 06:29:47 -07:00
Tim Abbott 8eba95e556 popovers: Move manage menu hackery to user_card_popover.
This helps localize the logic to where it's used, simplifies the main
function, and helps with fixing some import cycles.
2023-09-25 06:29:47 -07:00
Tim Abbott c379d0bad6 right_sidebar_ui: Extract new module.
This UI is not actually a popover, and so there is no need for it to
live in popovers.js.
2023-09-25 06:29:47 -07:00
Daniil Fadeev 8de397b37f user_card_popover: Migrate all user card popovers to Tippy. 2023-09-25 06:29:47 -07:00
Tim Abbott 10400f15d6 tests: Delete user_card_popover test.
This test did extensive mocking and didn't feel like it either fully
tested the module or did a good job of testing the logic; and will
break with the migration to tippy. I think it's better to remove the
test and plan to write a new one testing just
get_user_card_popover_data, the actual interesting part for node tests
of this module.
2023-09-25 06:29:47 -07:00
Daniil Fadeev c961ff2665 recent_view_ui: Change event target to avoid Tippy collision.
We can't use Tippy for both popover and tooltip on the same HTML
element. This change will prevent such issues in the future.
2023-09-25 06:29:47 -07:00
Tim Abbott 1a89d49aba people: Add direct coverage of unknown user case. 2023-09-25 06:29:47 -07:00
Tim Abbott 454b3542ec tests: Rename unknown_user in people tests. 2023-09-25 06:29:47 -07:00
Aman Agrawal bdf6b210b8 copied_tooltip: Remove tippyjs import cycle by extracting it.
Moving show_copied_confirmation to a new library breaks the
dependency cycle of popover_menus and tippyjs.
2023-09-24 15:16:27 -07:00
Tim Abbott 458a0b3f3a user_groups: Move can_edit to settings_data module.
This fixes an import cycle.
2023-09-22 17:46:45 -07:00
Tim Abbott 3edf347f89 user_group_edit: Fix a live-update import cycle. 2023-09-22 17:46:45 -07:00
Prakhar Pratyush f8f9a800e6 navbar_alerts: Improve info for users having at least 50K unreads.
This commit improves the alert message to clearly state that
"You have at least 50,000 unread messages."

In the other case, i.e., when unread_msgs_count > 500 and the user
hasn't read the messages for more than 2 days, the alert message
states,"You have {unread_msgs_count} unread messages."

Fixes #17469.
2023-09-22 17:18:49 -07:00
Tim Abbott 1c1d31deec hotspots: Move compute_placement to only module using it.
Previously, this function was used by other bootstrap popovers, but
such popovers have all been migrated to Tippy.

Hotspots uses some of that machinery but I think doesn't actually use
the Bootstrap popovers system.
2023-09-22 17:17:16 -07:00
Anders Kaseorg d6884399b2 invite: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:10:51 -07:00
Anders Kaseorg eefd7feafa global: Specialize jQuery .val() for elements with known value types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:10:51 -07:00
Anders Kaseorg 06e8d1fb16 popovers: Remove click handler for .flatpickr-calendar.
It exists to prevent the $(document) click handler from seeing the
event and closing the compose box, but we could also just not close
the compose box.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:08:17 -07:00
Anders Kaseorg 35568ec4d6 flatpickr: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 17:08:17 -07:00
Anders Kaseorg 21edae876e Revert "markdown: Fix 3+ digit marker lists retaining alignment for 2 digits."
This reverts commit d899c03da6 (#25094).
It broke the display of list items with inline formatting.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 15:23:29 -07:00
evykassirer 30c6b26f3b stream view: Show "start a conversation" for a topic with no messages.
Previously we showed "no search results".

CZO conversation:
https://chat.zulip.org/#narrow/stream/9-issues/topic/.22no.20search.20results.22.20in.20topic.20view/near/1637289
2023-09-22 11:42:24 -07:00
Sahil Batra 4fb5dee5a4 settings: Fix live-update bug when changing user names.
When changing name of users, the name was updated corectly
in the "Users", "Deactivated users" and "Bots" list but
it removed the "<a>" element, used to open the user
popover, and instead changed it to plain text.

This commit updates the code to just update the text inside
"<a>" tag so that the popover can still be opened by clicking
on the name.
2023-09-22 09:58:29 -07:00
N-Shar-ma db86a2e79b typeahead: Improve tests for multi word match's highlighting.
We refactor the tests to check if a multi word query's result is
correctly highlighted (multi word highlighting fixed in
e2c23b656e).

The test case was already present, but the setup was not correct, and
has been corrected now to safeguard against regression in the future.
2023-09-22 09:58:04 -07:00
evykassirer 356c16553e search: Move search code from message_view_header to search.js. 2023-09-22 09:55:50 -07:00
Anders Kaseorg c2c0429dd1 markdown_config: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:32:21 -07:00
Anders Kaseorg fcb212721a list_cursor: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:31:24 -07:00
Anders Kaseorg fb765bd057
stream_pill: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:30:23 -07:00
Anders Kaseorg f3fc0c8c7a recent_view_data: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:29:03 -07:00
Anders Kaseorg 1128752bd0 compose_fade_users: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:26:58 -07:00
Anders Kaseorg 6653788937 compose_fade_users: Prefix jQuery object variables with $.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:26:58 -07:00
Anders Kaseorg 0dd24ed295 compose_fade_helper: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:26:58 -07:00
Anders Kaseorg 5cc65dd3c2 types: Use TypeScript unions for message types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-22 09:26:58 -07:00
Hemant Umre f731602024 org_settings: Add frontend support for `realm_jitsi_server_url`.
This commit adds a dropdown and custom input element to set the
`realm_jitsi_server_url` when the video call provider is Jitsi. This
allows organization administrators to add a custom Jitsi server as the
organization's video call provider.

Fixes #17914.

Co-authored-by: Gaurav Pandey <gauravguitarrocks@gmail.com>
2023-09-21 17:39:10 -07:00
Hemant Umre cb0aaa5197 settings_org: Move video chat provider from update_dependent_subsettings.
Since `settings_org.update_dependent_subsettings` handles settings whose
value and state depend on other elements and video chat provider settings
is an independent setting moving it out of update_dependent_subsettings.
2023-09-21 17:39:10 -07:00
Hemant Umre 8b92999d69 compose: Refactor the condition to show the audio call button.
Added `page_params.jitsi_server_url`: since we allow the Jitsi Meet
server URL to be set as `None`.
2023-09-21 17:39:10 -07:00
Tim Abbott 12dd6c44a2 puppeteer: Remove flaky default streams test.
This test has been flaking for a couple months, and it hasn't felt
worth it for anyone to debug, so we should disable or delete it.

I chose deletion, since I don't think this settings panel is a
high-value place for end-to-end testing.
2023-09-21 17:34:56 -07:00
Karl Stolley be4d4085f2 emoji: Display status emoji as flexbox in settings.
This does not adjust any of the padding from a float-based era.
It's entirely possible that the status-preview area especially
deserves some further tuning.
2023-09-21 17:18:47 -07:00
Karl Stolley 55e43b6926 settings: Display radio choice label as flexbox. 2023-09-21 17:18:47 -07:00
Karl Stolley 2c3a276753 settings: Uniformly structure username and status emoji. 2023-09-21 17:18:47 -07:00
Karl Stolley 9e2006a321 emoji: Display status emoji as flexboxes in status modal. 2023-09-21 17:18:47 -07:00
Karl Stolley 896a768038 unreads: Hide empty unread count pill. 2023-09-21 17:18:47 -07:00
Karl Stolley fbfc72cb05 emoji: Display status emoji as inline-flex in sender row.
With no existing class to reach this selector, this change
introduces a new `.inline-status-emoji` class on the Handlebars
template and in the main Zulip CSS file.

Because of the inline styling in the message sender row, this
specific instance of a status emoji needs to be presented as
an inline flex: that keeps the avatar image layout clean, while
also introducing the `align-self: center` vertical positioning
of the status emoji adjacent the username, which is itself a
bare text node.
2023-09-21 17:18:47 -07:00
Karl Stolley 5df7330d2c emoji: Display status emoji as flexboxes in DM list. 2023-09-21 17:18:47 -07:00
Karl Stolley b147440c43 emoji: Display status emoji as flexboxes in pills. 2023-09-21 17:18:47 -07:00
Karl Stolley cbb0cb9a73 css: Move inline emoji styles under rendered markdown.
This change paves the way to update how actual status emoji are
presented in sidebars, pills, etc., care of flexboxes, which
is previewed here by the inclusion of the `align-self` property.
2023-09-21 17:18:47 -07:00
Tim Abbott c12c2dcfd0 compose: Fix missing audio call button.
This was removed in a misresolved merge conflict in
82ca794f94.

Also added the wrapper elements from
953f026487 to ensure preview works.
2023-09-21 17:12:31 -07:00
Aman Agrawal 0e5c6ec5b9 inbox: Fix inbox scrolled to top when returning from other narrows.
This has to do with narrows and inbox view sharing the same
scrolling container.
2023-09-21 16:50:01 -07:00
Aman Agrawal 6411dbe124 inbox: Allow user to escape out of empty inbox list.
Now pressing escape would work to set focus out of inbox if inbox
is empty.
2023-09-21 16:50:01 -07:00
Aman Agrawal 274eac3313 hotkey: Fix incorrect input to inbox change focus function.
inbox_ui.change_focused_element takes only 1 input.
2023-09-21 16:50:01 -07:00
Aman Agrawal f07a032b79 inbox: Add button to open stream popover in stream header. 2023-09-21 16:50:01 -07:00
Aman Agrawal 518dcb2ad1 inbox: Make topic actions menu accessible via keyboard. 2023-09-21 16:50:01 -07:00
Aman Agrawal 97a1b91b40 inbox: Add button to open topic menu popover. 2023-09-21 16:50:01 -07:00
Aman Agrawal a904de2d6e inbox: Only scroll to focused row when using keyboard to navigate.
Fixes #26780

This prevents inbox from suddenly scrolling when inbox view is
updated.
2023-09-21 16:50:01 -07:00
Aman Agrawal 425ab4ca13 inbox: Show unread mention indicator for topics and streams.
Fixes #26747
2023-09-21 16:50:01 -07:00
Aman Agrawal 53f6041dd5 inbox: Extract function to update stream data. 2023-09-21 16:50:01 -07:00
Aman Agrawal 35f7bf68ee inbox: Calculate unread count of headers based on active filters.
Fixes #26773

Now unread count of header is a sum of non hidden topics / DMs
unread count.
2023-09-21 16:50:01 -07:00
Joelute 25841ad852 compose: Update text on warning banner when user is not allow to dm.
Previously, the text on the warning banner when the user is not allowed
to direct message is "Direct messages are disabled in this organization.".
While the text on the warning banner when the user is not allowed to
send message to stream is "You do not have permission to post in this
stream". These wording is inconsistent with each other and we should
change it to keep them consistent and aligned with each other.

Fixes: #21896.
2023-09-21 16:24:15 -07:00
Joelute f8f5196c75 compose: Allow the user to direct message bots despite of policy.
After the changes in #25572, users were no longer able to start a direct
message with bots if the organization disabled direct messages. However,
we should allow direct messages to bots regardless of the policy because
it's a useful interface for users to interact with various classes of
bots.

user_ids_string_to_ids_array was also modified to prevent cases where
the split function returned an array of [0] rather than [] when dealing
with a empty id string of "".

Fixes: #21896.
2023-09-21 16:24:15 -07:00
Aman Agrawal dc62e31d1f message_scroll: Update sticky header date more frequently.
To make the date change in recipient header more smooth, we
update it with throttled scroll event. This can cause some
performance regressions on slow computers during scrolling but
nothing I can notice even with 6x CPU slowdown on Intel i7 on mac.

This is an alternative to #25163 since implementing it seems harder
than expected. The date changing animation cannot be made smooth without
serious structural changes to how messages are rendered.
2023-09-21 16:17:47 -07:00
Zixuan James Li d3e4456562 linkifiers: Use only the handle for dragging.
So that the user can still select and copy text from the body of the
linkifier rows. It might be helpful if we extend this behavior to other
draggable rows, like those for custom profile fields settings.

Fixes #26798
2023-09-21 15:27:16 -07:00
Daniil Fadeev 472ef3d890 user_card_popover: Remove redundant `userlist_placement` variable. 2023-09-21 11:25:18 -07:00
Daniil Fadeev f609bc1f21 user_card_popover: Move sidebar popover logic to its own function. 2023-09-21 11:25:18 -07:00
Daniil Fadeev dcb3db37ce user_card_popover: Stop exporting functions that shouldn't be.
These functions aren't used outside the user_card_popover module, so
we shouldn't export them.
2023-09-21 11:25:18 -07:00
N-Shar-ma c1741e94d2 typeahead: Allow highlighting across multiple words for user names.
`make_query_highlighter` called `highlight_with_escaping_and_regex`
once for each word in the phrase, due to which only 1 word searches
could be highlighted. For example searching for `two wo` resulted
in no highlighting at all in `two words`.

One call per word in the phrase was also redundant since the called
function can handle a multi word query. So now the entire phrase is
passed to the called function just once.
2023-09-21 11:24:13 -07:00
N-Shar-ma c3c8bad0de typeahead: Highlight only matching word prefixes in search suggestions.
Earlier mid word parts matching with the search query were also
highlighted (made bold), but since actual matching for showing search
suggestions is based on prefix matching, this highlighting logic is
now made to be in sync with the search suggestions matching logic.
2023-09-21 11:24:13 -07:00
N-Shar-ma d899c03da6 markdown: Fix 3+ digit marker lists retaining alignment for 2 digits.
Until now, lists with 3+ digit markers would have their beginnings cut
off to align with 2 digit markers. We fix that by having custom styling
for markers where we align markers only up to 2 digits, and let larger
numbers take up more space pushing the list item content forward as
required to fit the marker. Works for multiline and nested list items too.
2023-09-21 10:51:22 -07:00
evykassirer ebdcbc28f6 search: Wrap long search suggestions.
CZO conversation: https://chat.zulip.org/#narrow/stream/101-design/topic/long.20search.20suggestions

This commit also changes some styling for the pills,
to ensure that they are properly aligned when search
results wrap.
2023-09-21 08:58:31 -07:00
evykassirer da72c9069c search: Rename class to search-input to avoid bootstrap.
The class `search-query` is a bootstrap classname, and using
a name unique from that both lets us rely on bootstrap less
and also not have to override some boostrap styles.
2023-09-21 08:58:31 -07:00
evykassirer 3e089c7ac6 search: Remove extra filter check before closing search.
Existing callsites to `close_search_bar_and_open_narrow_description`
already do this filter check, so this is extra and unnecessary.
Doing the check always before calling this function probably
makes more sense given the name of the function sounding like
it always takes action.
2023-09-21 08:58:31 -07:00
YashRE42 cb04ae1f95 search: Redesign search box.
Fixes #21798.
2023-09-21 08:58:31 -07:00
evykassirer ea619ff75f message basics e2e: Add expect_home in two places to match other tests. 2023-09-21 08:58:31 -07:00
evykassirer 62b31e8b01 search: Close search bar when typeahead closes with no search input.
Currently the search bar doesn't close when you e.g. click outside
of the search input field. In the new design we do we want the search
bar to close on most blur events. Instead of setting up a new blur
handler, this commit checks if the search bar should be unexpanded
any time the typeahead is hidden (which does usually happen on blur).
2023-09-21 08:58:31 -07:00
evykassirer 63c424c5bc typeahead: Ignore blurs that change focus within the `parentElement`. 2023-09-21 08:58:31 -07:00
evykassirer c4ff1a1158 typeahead: Add option for tab to not have enter functionality. 2023-09-21 08:58:31 -07:00
evykassirer b5b671c360 typeahead: Add closeInputFieldOnHide callback from hide().
This commit adds a function to make it easier to close
the search bar consistently in any siuation where the
typeahead closes, to avoid being in broken middle states.
2023-09-21 08:58:31 -07:00
evykassirer d43d8ba127 typeahead: Add openInputFieldOnKeyUp option. 2023-09-21 08:58:31 -07:00
Philip Durbin 47288c7d79
settings: link to list of emoticon translations.
Under "Emoji" under "Preferences", we link to the rules explaining
what emoticons exist, e.g., :) translates to 😄, etc.

These docs: https://zulip.com/help/configure-emoticon-translations

Fixes #18147.
2023-09-21 08:46:29 -07:00
Daniil Fadeev bb58fecf28 user_card_popover: Fix keyboard navigation opening manage menu.
`focus_first_popover_item` was executed right after the click handler
 had asked to open the popover, but before the popover was mounted to
 the DOM, causing the popover to not work correctly when opened via
 the keyboard.
2023-09-21 00:29:43 -07:00
Daniil Fadeev 0ab788c9c9 user_card_popover: Migrate "Manage menu" popover to Tippy.
Fixes part of #23632.
2023-09-21 00:29:43 -07:00
Daniil Fadeev 732a1403e1 user_card_popover: Create an API for `user_card_popover` module.
This API will serve as the primary entry point for the
`user_card_popover` module. It will help to control and check the
state of all the popovers in this module.
2023-09-21 00:29:43 -07:00
Daniil Fadeev cda95b0485 user_card_popover: Fix "Manage Menu" popover focus on the second item. 2023-09-21 00:29:43 -07:00
Daniil Fadeev f3938acc71 user_card_popover: Fix blueslip error messages. 2023-09-21 00:29:43 -07:00
Anders Kaseorg 487d61caf5 tests: Fix direct mutation of ES modules again.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-20 22:08:20 -07:00
Satyam Bansal 9cde3abd4d bot-settings: Add modal to generate Integration URL.
Fixes part of #25976.
2023-09-20 17:49:51 -07:00
Sahil Batra bd631c4424 group_settings: Sort groups list by name. 2023-09-20 15:40:11 -07:00
Sahil Batra 00424748f4 settings: Disable submit button when no input is changed.
We now disable the submit button if no input is changed
in modals used for editing name and descriptions of
stream and user groups. The button is enabled if any
value is changed.
2023-09-20 15:40:11 -07:00
Sahil Batra a37c91e5f9 group_settings: Use tippy-zulip-delayed-tooltip for buttons.
This fixes an issue where the "Change group info" and "Delete group"
buttons would display a tooltip immediately upon closing the modal
opened by clicking on them.
2023-09-20 15:40:11 -07:00
Sahil Batra 107ebc140b group_settings: Show "not-allowed" cursor when not allowed to add users.
This commit adds code to show the "not-allowed" cursor when hovering over
pill input in "Add members" section if a user is not allowed to add members
to the group like we do for "Add subscribers" section in stream settings.
Previously the "not-allowed" cursor was show only when hovering over "Add"
button.
2023-09-20 15:40:11 -07:00
Sahil Batra f6d3b2667f user_group_creation: Add simplebar to user group creation form.
This commit adds simplebar to user group creation form and makes
it consistent with stream creation form.

This also fixes transparency issue in footer of group creation
form dark theme.

Fixes #24443.
2023-09-20 15:40:11 -07:00
Sahil Batra 5a6a8a63e1 group_settings: Fix placeholder in pill input for members.
This commit fixes placeholder text in the pill input for user
group members UI in "#groups" overlay to mention members instead
of subscribers. For this we add a new template instead of using
add_subscribers_form.hbs and thus this commit also updates
the class names used in javascript code accordingly.
2023-09-20 15:40:11 -07:00
Sahil Batra c4ba7699bd groups_settings: Fix placeholder in search input for members list.
This commit updates placeholder for search input in user group
members list to be "Filter members" instead of "Filter subscribers".
2023-09-20 15:40:11 -07:00
Sahil Batra 8dba149364 group_settings: Fix messages shown when adding users to a group.
This commit fixes the messages shown when adding users to a group
to use "add" instead of "subscribe".

Fixes part of #24443.
2023-09-20 15:40:11 -07:00
Sahil Batra a3124ddcb3 settings: Rename search-container class.
This commit renames search-container class used in stream and
user group settings overlay to list-toggler-container since
the element does not contain search UI and instead contains
the toggler for "Subscribed" and "All streams" and similarly
for "Your groups" and "All groups".
2023-09-20 15:40:11 -07:00
Sahil Batra 5518a0073e group_settings: Show loading spinner in group edit modal.
This commit adds code to show loading spinner on clicking
submit such that modal does not closes before the request
succeeds and error, if any, is shown inside the modal.

And as a result we remove the saving indicator and "Saved"
message which was shown on request completing successfully
but it should be fine as we already have this behavior for
stream settings.
2023-09-20 15:35:26 -07:00
Karl Stolley 301e1c07b8 left_sidebar: Hold hoverable area to + icon.
This shifts the 8px of margin to the wrapper, preserving the space
to the right of the + icon, but no longer allowing it to shift the
hover state or trigger the tooltip when clicking actually activates
the search filter.

Fixes #11494 (at least the one fixable part; the rest should be
closed as wontfix)
2023-09-20 15:31:41 -07:00
Karl Stolley 6d0c2c6a57 message_feed: Alot controls-column space to forms in edit/source view.
See CZO discussion:
https://chat.zulip.org/#narrow/stream/101-design/topic/adjusting.20the.20message-edit.20form/near/1643675
2023-09-20 15:29:57 -07:00
Karl Stolley 75293feefb message_feed: Size mobile controls to icon widths.
This causes no visual changes, but it makes the grid definitions
more precise, while also reflecting that only two hover icons are
ever shown at mobile scales.
2023-09-20 15:29:57 -07:00
Karl Stolley adec143680 message_feed: Prevent blowouts on mobile message grids. 2023-09-20 15:29:57 -07:00
Karl Stolley 81c31e40b8 message_feed: Remove duplicate and unnecssary controls styles. 2023-09-20 15:29:57 -07:00
Karl Stolley d3a4fb7d3d message_feed: Remove padding from message controls.
The use of grid and flexbox precludes the need for padding these
controls. Further, removing the padding corrects a sneaky grid
discrepancy between controls on messages with and without a
sender.
2023-09-20 15:29:57 -07:00
Aman Agrawal 696287b0eb left_sidebar: Remove dev environment check for inbox. 2023-09-18 21:31:58 -07:00
m-e-l-u-h-a-n 8a6d649ef9 user groups: Fix right panel display for new user group on small screen.
Opening create user group from `+` button on left panel did not
open the create user group form properly on small viewports.

This was due to show_right_section not being called which is
resposible to handle this.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n e42fa42b0c user groups: Reset active_group_id at initial build of groups overlay.
We maintain active_group_id as a module level variable to keep
track of the group that is being edited in the right panel of
the overlay. This variable could store the value of group id for
which settings were open when the groups overlay was open previously.

While this caused no bugs but it was not inline with the idea of
the variable holding id of group for which settings were open
and undefined in case right panel was empty or group creation
form was open.

To make this variable consistent with this idea we reset the
value of this variable while building up the ui for groups
overlay as initially groups overlay is opened with empty right
panel.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 350802a510 user groups: Remove redundant DOM operations on user group add event.
Settings DOM for newly created group were unnecessarily appended
in the right panel during live update. This was not needed as
these HTML elements are any way created for the window in which
the group was created and this was extra work for a window that
had groups overlay open but the group was not created in that window.

These changes also solved a minor bug where an extra delete button
appeared after the extra HTML elements were appended in the right
panel.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 4a8271e854 user groups: Optimize DOM operations while showing groups overlay.
Groups overlay during initial build up created groups rows for
all the groups in the realm and then based on the section/(active tab)
it updated the list data in the group_list_widget that again caused
repeated removing and rebuilding of several group rows.

We optimize here by initially building the overlay with empty group
list and later on update the group list based on section/(active tab).

Changes in this commit only affect (reduce) the number of DOM
operations we do while showing groups overlay and have no visual
changes.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 4f6f619d20 user groups: Correctly decide the display of group list on left panel.
All groups were listed on the left panel by default, irrespective
of which tab was active.
This caused a mismatched ui where list of groups displayed was not
according to the active tab.
We fix this by redrawing left panel based on active tab.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 1a7eb17450 user groups: Fix buggy display of edit button on group membership event.
The display of edit button was not correctly toggled on membership
update events during first render of user group user group settings.

This was due to toggling of display for incorrect html element.

We fix that by toggling display for correct node.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 74318c9b7e user groups: Update left panel correctly on membership update event.
Live update code for user group membership update events did not cover
following updates that are covered in this commit.
* Updating list of groups to be displayed on left panel based on
  updated membership and selected tab.
* Updating the presence of checkmark on the group row for which
  membership was updated.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 74bcfa5a9f user groups: Update handling of user group add event.
Group list data in group_list_widget was not updated correctly,
on user group event as a result the group items shown on the
left panel were some times not according to the filters and selected
tab.
We make changes to appropriately update group list data of
group_list_widget on group add event and show group settings for
newly created group even in cases when the newely created group row
is not present in the left panel due to search filter or tab toggles.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 5cb99ad8a4 user groups: Update handling of user group remove event.
Groups list in group_list_widget data was not propoerly updated
on group remove event as a result the group list on left panel
gave errors during search/(tab switches) redraws.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 0261be5993 user groups: Fix how we decide if a group is being edited.
We earlier used URL for checking if a group was being
edited in the right pane of #groups overlay. This is
hacky in cases where the URL might be changed by the
user by toggling between all-groups and your-groups.

As the information about the group being edited is
reliably maintianed by user_group_settings_ui module
we use that while checking if the group is being edited.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 5b7e04773a user groups: Hide correct right panels on #groups overlay change.
`show_user_group_settings_pane` for user groups ui used made hide()
calls to incorrect panels. This however had no effect on the UI
but affected the readability of code for those functions.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n c147aafbe3 user groups: Preserve active group state during left panel updates.
The active group information that was provided by
`user_groups_settings_ui.get_active_data` became
inconsistent as the group list ui on left panel
updated due to tab toggle between Your/All groups
or due to search inputs.
To address this we maintain a module level variable
`active_group_id` that is updated during switches
in the right pane so that information about the
active_group_id is maintained and updated correctly.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n e92aa2293d user groups: Add tabs for your/all groups in #groups overlay.
We add tabs to make distinction between the groups the user
is a member of and all groups in the realm. This is a preliminary
commit and there would be following immediate follow-ups to this:
* Persisting the active state of selected group in the left panel
  as the list updates with search and thorugh tab toggles.
* Updating the display of group in the left panel list on membership
  update events.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n 4b8856b5d6 user groups: Fix tooltip for new user group button on #groups overlay.
The tooltip for new user group button (+) icon button on #groups
overlay was not mounted correctly on the target element as a
result its content was not able to render properly.

This mounting problem was due to its sibling element (search bar)
being inserted dynamically after handlebar got rendered.

To address this we append the tooltip element to the body itself
with target as the + button.
2023-09-18 16:09:31 -07:00
m-e-l-u-h-a-n f494daba95 user groups: Miscellaneous fixes to new user groups settings overlay.
We address few of the minor required change mentioned in
https://github.com/zulip/zulip/issues/24443.

* Sort user group list alphabetically by name on left panel.
* Fix actions column items on member list on right panel.
* Add tooltip to trash icon on right panel.
2023-09-18 16:09:31 -07:00
Vector73 40a8ca2ced message_edit_form: Remove question mark icon after edit-timer-text.
Fixes: #26759
2023-09-18 15:31:55 -07:00
Lauryn Menard 31daef7f79 response: Remove "result: partially_completed" for success responses.
In feature levels 153 and 154, a new value of "partially_completed"
for `result` in a success (HTTP status code 200) was added for two
endpoints that process messages in batches: /api/delete-topic and
/api/mark-all-as-read.

Prior to these changes, `result` was either "success" or "error" for
all responses, which was a useful API invariant to have for clients.

So, here we remove "partially_completed" as a potential value for
"result" in a response. And instead, for the two endpoints noted
above, we return a boolean field "complete" to indicate if the
response successfully deleted/marked as read all the targeted
messages (complete: true) or if only some of the targeted messages
were processed (complete: false).

The "code" field for an error string that was also returned as part
of a partially completed response is removed in these changes as
well.

The web app does not currently use the /api/mark-all-as-read
endpoint, but it does use the /api/delete-topic endpoint, so these
changes update that to check the `complete` boolean instead of the
string value for `result`.
2023-09-18 13:18:24 -07:00
Prakhar Pratyush 8d29ad7325 toggle_resolve_topic: Display spinner while request is in progress.
We replace the check icon for "Mark as resolved/unresolved" with
a spinner while the request is still ongoing.

This helps to prevent double-clicking and reduce possible
race conditions.

Fixes #26190.
2023-09-18 13:17:10 -07:00
Prakhar Pratyush 72b3a53864 inline_topic_edit: Fix spinner not visible in the dark mode.
A spinner is shown when the request is in progress
for inline topic edit.

Earlier, the spinner was not visible in the dark theme.

This commit makes it visible by setting a different fill color
in the dark theme.
2023-09-18 13:17:10 -07:00
Aman Agrawal 8ebb64c622 inbox: Reduce width of rows. 2023-09-18 12:17:51 -07:00
Aman Agrawal 01959d49fc inbox: Use a non transparent background color.
Since the search box header is sticky, we need the background to
be non transparent.
2023-09-18 12:17:51 -07:00
Aman Agrawal 7e11f95716 inbox: Add inbox as default view.
Fixes #26736
2023-09-18 12:17:49 -07:00
Aman Agrawal 9ac4ad2292 inbox: Let hotkey handle the escape keypress if we don't.
We were forcefully navigating user to default view, which was not
correct as hotkey handles that case while taking into account
user settings.
2023-09-18 12:11:23 -07:00
Aman Agrawal d14d6db6af narrow: Show "Inbox" in tab title when in inbox view. 2023-09-18 12:11:23 -07:00
Karl Stolley e5f7f1701f vdots: Simplify colors on right sidebar.
This now presents uniform vdots colors and styles across both the
left and now right sidebars.
2023-09-18 09:06:33 -07:00
Karl Stolley b168d4911c popovers: Use sidebar-menu-icon utility class. 2023-09-18 09:06:33 -07:00
Karl Stolley fd01ebdc5d vdots: Simplify colors in streamlined selectors on left sidebar.
This expresses the colors for vdots icons in just three variations,
all as CSS variables. The colors are all derived from the existing
design, and the dots colors in the streams/topics area was used as
as reference. The only visual change here, then, is to the global
filters area, whose vdots were the outliers prior to this change.

The three variations are:

1. hint: for touchscreens where a :hover state is not available
2. visible: for all screens when a parent element is highlighted
3. hover: for when the vdots themselves are hovered

The selectors have been streamlined to use the .sidebar-menu-icon
utility class, and the hover-within-a-hover color on vdots is
expressed more directly, eliminating the need for
selector-specificity busting via !important.

Fixes: #20600
2023-09-18 09:06:33 -07:00
Karl Stolley 5a476d06c3 sidebars: Add sidebar-menu-icon util class. 2023-09-18 09:06:33 -07:00
Karl Stolley a764c15bcb icons: Express global filter icons as colors. 2023-09-18 09:06:33 -07:00
Aman Agrawal b845ef5091 recent_view: Show empty text after rerenders too.
Fixes #26746

There was a bug which caused empty text to not appear after
rerender since tbody didn't have the `required-text` class on
rerenders as it was not part of the handlebars template.
2023-09-18 08:01:58 -07:00
Aman Agrawal 19056db88b inbox: Show text if inbox is empty. 2023-09-18 08:01:58 -07:00
Aman Agrawal 4791e9f2fa inbox: Remove unused variable. 2023-09-18 08:01:58 -07:00
Aman Agrawal 05e133156e inbox: Make borders span full height. 2023-09-18 08:01:58 -07:00
Anders Kaseorg 88e9320fa5 list_widget: Rename unsafe modifier parameter to modifier_html.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-15 18:11:50 -07:00
Anders Kaseorg 500e6bfdef user_card_popover: Add missing $ prefix for jQuery object variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-15 14:14:50 -07:00
Anders Kaseorg c6b60f6490 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-15 14:09:49 -07:00
Daniil Fadeev 91d2b5ed81 user_group_popover: Migrate popover to Tippy.
Fixes part of #23632.
2023-09-15 13:40:53 -07:00
Daniil Fadeev e52188bd41 user_group_popover: Fix blueslip error messages. 2023-09-15 13:40:53 -07:00
Daniil Fadeev a678aee467 popovers: Apply styles for `hr` tag not just when nested under `.nav`.
We've got `hr` elements not just under `ul.nav`, like in
`user_group_info_popover`, so we need to apply styles there too.
2023-09-15 13:40:53 -07:00
Prakhar Pratyush fa063e4afc typeahead: Suggest only the first matching wildcard mention.
We suggest only the first matching wildcard mention,
irrespective of how many equivalent wildcard mentions match.

This helps to avoid suggesting multiple wildcard mentions at
the same time that do the same thing but have different names.

Fixes #25613.
2023-09-15 13:22:35 -07:00
Aman Agrawal fe2d6c07fb recent_view: Reduce width of unread header. 2023-09-15 13:20:45 -07:00
Karl Stolley c49ab123b2 icons: Remove unused move and source icons.
These were early candidates in the hover-controls work, but were
superseded by their "alt" counterparts.
2023-09-15 13:17:22 -07:00
Karl Stolley 3fe6cc18ff icons: Remove last vestiges of ellipsis-v-solid.
The deleted CSS around the `.zulip-icon-ellipsis-v-solid` class
has no impact on the hover controls, as flexbox and grid are
handling baseline alignment, not this one-off line-height.
2023-09-15 13:17:22 -07:00
Hardik Dharmani 3c89fe222a refactor: Rename `private_message` to `direct_message`.
This commit renames all uses of `private_message` in `unread.js` to
`direct_message`. Renamed `private_message_count` to
`direct_message_count` and `right_sidebar_private_message_count` to
`right_sidebar_direct_message_count`.
2023-09-15 12:37:09 -07:00
Hardik Dharmani b8d84abc47 unread: Fix double counting of mentions in direct messages.
Created a new set `direct_message_with_mention_count` which stores direct
messages containing mentions. In `new_message_count`, direct messages
with mention were added twice, once by res.mentioned_message_count
and once by res.private_message_count so subtracting intersection of
both `direct_message_with_mention_count` now gives accurate count.

Fixes #25453
2023-09-15 12:37:09 -07:00
Aman Agrawal 3c05bd94a4 inbox: Don't search if there is no change in text. 2023-09-15 12:34:59 -07:00
Aman Agrawal a0e3f66dc1 inbox: Center focused element if off screen when using keyboard. 2023-09-15 12:34:59 -07:00
Aman Agrawal 7bce78694e inbox: Move scrolling container to `html`. 2023-09-15 12:34:59 -07:00
Aman Agrawal c8f363fd45 inbox: Add additional element around rows to apply border-radius. 2023-09-15 12:34:59 -07:00
Aman Agrawal 55eb0e4e07 inbox: Use blue box to indicate focus. 2023-09-15 12:34:59 -07:00
Aman Agrawal f16273c488 hotkey: Change inbox hotkey from `shift + t` to `shift + i`.
Also, add that as a tippy tooltip in left sidebar.
2023-09-15 12:34:59 -07:00
Daniil Fadeev d96110590b playground_links: Migrate popover to Tippy.
Fixes part of #23632.
2023-09-15 12:25:26 -07:00
Daniil Fadeev 79e050b81b playground_links: Fix disappearing reference when popover is active. 2023-09-15 12:25:26 -07:00
Daniil Fadeev 79c6ff91d7 playground_links: Add popover keyboard handling. 2023-09-15 12:25:26 -07:00
Daniil Fadeev 76891ec9ee playground_links: Add `is_open` function. 2023-09-15 12:25:26 -07:00
Daniil Fadeev d27448dcec popovers: Rename playground links popover hiding function. 2023-09-15 12:25:24 -07:00
Daniil Fadeev 1782fb6866 popovers: Rename `toggle_playground_link_popover` function. 2023-09-15 12:25:12 -07:00
Daniil Fadeev 4d41d8bd02 popovers: Extract `playground_links_popover` into separate module. 2023-09-15 12:25:11 -07:00
Daniil Fadeev 3773f17933 popovers: Remove unused `clear_for_testing` function. 2023-09-15 12:24:34 -07:00
Daniil Fadeev f421ea5e0b user_card_popover: Fix comments that describe a block of functions. 2023-09-15 12:24:00 -07:00
Daniil Fadeev d2bc1f1bcf user_card_popover: Rename `focus_user_info_popover_item`function. 2023-09-15 12:24:00 -07:00
Daniil Fadeev e66eeb4444 user_card_popover: Rename item getter functions.
Renamed functions:
`get_user_info_popover_items` -> `get_user_card_popover_items`
`get_user_info_popover_for_message_items` ->
`get_user_card_popover_for_message_items`
`get_user_info_popover_manage_menu_items` ->
`get_user_card_popover_manage_menu_items`
2023-09-15 12:24:00 -07:00
Daniil Fadeev 27eb545af2 user_card_popover: Rename hiding functions.
Renamed functions:
`hide_message_info_popover` -> `hide_message_user_card_popover`
`hide_all_user_info_popovers` -> `hide_all_user_card_popovers`
`hide_user_info_popover` -> `hide_user_card_popover`
`hide_user_info_popover_manage_menu` ->
`hide_user_card_popover_manage_menu`
2023-09-15 12:24:00 -07:00
Daniil Fadeev 626127451b user_card_popover: Rename toggling and rendering functions.
Renamed functions:
`toggle_user_info_popover` -> `toggle_user_card_popover`
`toggle_user_info_popover_for_message` ->
`toggle_user_card_popover_for_message`
`toggle_user_info_popover_manage_menu` ->
`toggle_user_card_popover_manage_menu`
`render_user_info_popover` -> `render_user_card_popover`
2023-09-15 12:24:00 -07:00
Daniil Fadeev c579e5fffa user_card_popover: Rename popover elements.
Renamed elements:
`$current_user_info_popover_elem` -> `$current_user_card_popover_elem`
`$current_message_info_popover_elem` ->
`$current_message_user_card_popover_elem`
`$current_user_info_popover_manage_menu` ->
`$current_user_card_popover_manage_menu`
2023-09-15 12:24:00 -07:00
Daniil Fadeev 7b1abd108b user_card_popover: Rename keyboard handling functions.
Renamed functions:
`user_info_popover_handle_keyboard` ->
`user_card_popover_handle_keyboard`
`user_info_popover_manage_menu_handle_keyboard` ->
`user_card_popover_manage_menu_handle_keyboard`
`user_info_popover_for_message_handle_keyboard` ->
`user_card_popover_for_message_handle_keyboard`
2023-09-15 12:24:00 -07:00
Daniil Fadeev 4531386e99 user_card_popover: Rename "*_popped" functions.
Renamed functions:
`user_info_popped` -> `is_user_card_open`
`message_info_popped` -> `is_message_user_card_open`
`user_info_manage_menu_popped` -> `is_user_card_manage_menu_open`
2023-09-15 12:24:00 -07:00
Daniil Fadeev e0a5d8dc49 user_card_popover: Rename `user_info_popover_manage_menu` class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev 8949ed41b7 user_card_popover_content: Fix template description. 2023-09-15 12:24:00 -07:00
Daniil Fadeev 228a4eb8a2 user_card_popover: Rename `user_info_popover` class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev b9e1537ee6 user_card_popover: Rename `user_info_status_text` class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev d5f731f0bd user_card_popover: Rename `user-info-popover` class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev ff892925ce user_card_popover: Rename `info_popover_actions` class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev 7c3f79df0d user_card_popover: Rename `user_info_popover_manage_menu_btn` class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev a8bce8e178 user_card_popover: Rename `user_info_popover_action_buttons` class. 2023-09-15 12:24:00 -07:00
Daniil Fadeev 7ce1ee784c user_card_popover: Rename for_user_info_popover template variable. 2023-09-15 12:24:00 -07:00
Daniil Fadeev d89cd1e241 user_card_popover: Rename Handlebars templates.
List of renamed templates:
`user_info_popover_content` -> `user_card_popover_content`
`user_info_popover_manage_menu` -> `user_card_popover_manage_menu`
`user_info_popover_title` -> `user_card_popover_title`
2023-09-15 12:24:00 -07:00
N-Shar-ma 54b399ce96 compose: Disable unneeded control buttons in preview mode while editing.
This is a follow up to #26728, which disables buttons in preview mode
for any message being edited.

Care is taken to pass the correct preview state (compose vs the message
row being edited) to the popover menu so the buttons in it too can be
disabled as needed.
2023-09-14 17:15:40 -07:00
Karl Stolley 89ce2c112c vdots: Place new more-vertical icon in compose box. 2023-09-14 17:13:58 -07:00
Karl Stolley b86b7ab067 vdots: Place new more-vertical icon on user card. 2023-09-14 17:13:58 -07:00
Karl Stolley 679f95214c vdots: Place new more-vertical icon in sidebars. 2023-09-14 17:13:58 -07:00
Aman Agrawal 9098648d95 inbox_ui: Take into account unmuted topics when filtering topics. 2023-09-14 13:57:27 -07:00
Aman Agrawal fa4f9c7eff unread: Remove the TODO statement with an explanation. 2023-09-14 13:57:27 -07:00
Karl Stolley 5737c558cb message_edit: Display GIF button when Giphy is enabled.
CZO discussion:
https://chat.zulip.org/#narrow/stream/9-issues/topic/no.20GIF.20button.20when.20editing/near/1639551
2023-09-14 13:41:02 -07:00
Daniil Fadeev 72fa8b568c timerender: Change relative_time_string_from_date signature. 2023-09-14 11:56:53 -07:00
Daniil Fadeev 84c1a7dc2e recent_view_util: Convert module to Typescript. 2023-09-14 11:56:53 -07:00
Daniil Fadeev c33328abef recent_view: Remove unreachable code path.
The Message type can only be "private" or "stream," so there's no need
 to handle exceptions in this case.
2023-09-14 11:56:53 -07:00
Shashank Singh b62f21e876
tooltips: Add a tippy tooltip to display name of status-emoji.
Inspired by #19821. The original proposal in #19821 got bogged down with
issues around multiple overlapping tooltips, but this seems like a useful step 
forward.
2023-09-14 10:41:53 -07:00
Karl Stolley 5708b57acd compose: Present banners with intrinsic layout.
By implementing a careful flexbox declaration on a new banner-
element container, this presents banners accessibly across the full
range of possible viewports--and relies only on a single, small
media query to do so.

Fixes: #25847

Co-Authored-By: Hardik Dharmani <Ddharmani99@gmail.com>
2023-09-14 10:13:29 -07:00
Lalit 0e73b5547c user_settings: Add new user setting to show/hide unread counts on streams.
Added a show_unread_counts personal user setting to the
Settings > Display settings > Advanced section which
lets user choose whether he/she wants to see unread messages
count on the left sidebar for streams.

This setting have three options,
"All Streams" - This will show unread messages count for all
streams.
"Unmuted Stream" - This will be default option and it will
only show unread messages count for unmuted streams.
"No Stream" - This option will not show unread messages count
on any stream.

Fixes #24149
2023-09-13 18:45:45 -07:00
Lalit fb165f1901 ui_util: Use `.show` and `.hide` classes for unread counts visibility.
This is a prep commit for introducing new "Show unread counts for" user
display setting. We should use css classes like `.hide` to hide the unread
count from the DOM as opposed to using `$unread_count_span.hide()` because
this injects inline styles and hence we won't be able to change the `display`
style on hovering for unread counts.
2023-09-13 18:45:45 -07:00
Lalit f36c9c255b stream_list: Add new class `stream-expanded` besides `active-filter`.
This is a prep commit for the new setting `stream_unreads_display`.
Before when a stream was active i.e. once you are viewing topics in
the stream we had a `active-filter` class applied to the stream `li`
but if we were viewing a topic then the `active-filter` was removed
even though the stream was still expanded.

Added a new class `stream-expanded` which persists even when we are
in a topic view, this is useful for knowing whether a stream is
expanded or not within css.
2023-09-13 18:45:45 -07:00
palashb01 574a87b87d search: Update search bar to display title when used sender:.
This commit introduces a new behavior for the search bar. Now, if
the search keyword is 'sender:', it displays the title of the user/me.
for example: sender:me
title: Messages sent by you

sender: Palash
title: Messages sent by Palash

for the implementation, we already have the check for 'dm:', which is
similar to this so just added a new if check for 'sender:' and return
the title accordingly.

Fixes: #18690
2023-09-13 18:17:07 -07:00
palashb01 3a4cb692fb filter: Create helper function that checks basic filter terms.
Currently, `is_common_narrow` relies on `calc_can_mark_messages_read`
to check a number of filters that are "common narrows" (which means
they have a special message header title and different behavior when
exiting a search view).

Creates a helper function,
`single_term_type_returns_all_messages_of_conversation`, that is
used in both the above functions.

The check for an empty array of term types is unnecessary for
`is_common_narrow` because the "All messages" view has an undefined
filter and the "in-home" term type used in the "zhome" message list
is covered. So that empty array check is not moved to the helper
function, and instead stays only in `calc_can_mark_messages_read`.

The helper function checks for a single term type (except in the case
of topic, which is checked in combination with stream) that will return
all the messages of a conversation.

To ensure consistency in the function, split the combined if
condition of in-home and in-all, further improved the comments, and
deleted the unnecessary ones.
2023-09-13 18:17:07 -07:00
yogesh sirsat 953f026487 compose: Disable unneeded control buttons in preview mode.
Buttons which change the content in the compose textarea were so far
enabled even in preview mode, and would work, but those changes would
not be reflected in the visible preview. This is extremely confusing,
and can lead to the possibility of a user accidentally changing the
content of the compose textarea while previewing, and sending that.

Now we disable those buttons in preview mode, both when composing a new
message and when editing an existing one. We still show the tooltips,
but grey them out and make them unclickable.

Fixes: #20962
2023-09-13 15:09:16 -07:00
Aman Agrawal aaf3369d39 recent_view: Add table header to sort by unread count.
Fixes: #22790
2023-09-13 14:58:13 -07:00
Vector73 5a88e4f6cb notifications: Remove realm-default-sound-audio initialization.
This commit removes the code to initialize
"realm-default-notification-sound-audio" element from
"notifications.initialize", because we do not need this
now as the previous commit added code to initialize it
in "settings_realm_user_settings_default.set_up".

This change works because the realm default notification sound
can only be played from the settings UI and so it is fine to
initialize it only when opening the default user settings panel.
2023-09-13 13:07:10 -07:00
Vector73 f384eb67a9 default-user-settings: Fix play button not playing selected sound.
Fixes #26598.
2023-09-13 13:07:10 -07:00
Aman Agrawal 0723c56246 emoji_picker: Improve rendering time of emoji picker by ~30%.
Fixes #25744

By rendering the emojis after initializing the simplebar container,
the rendering time is decreased by ~30% as observed at 6x CPU
cooldown on mac i7.
2023-09-13 12:39:13 -07:00
Daniil Fadeev 2f1561e3b8 giphy: Fix giphy popover rendering on narrow screens.
We should render the giphy popover as a centered overlay for
mobile-sized screens.
2023-09-13 12:20:35 -07:00
Daniil Fadeev b7c2570933 giphy: Refactor the giphy popover to use toggle_popover_menu.
This change is needed so we can use the `use_as_overlay` option on
mobile screens.
2023-09-13 12:20:35 -07:00
Daniil Fadeev 5b0e74c940 user_card_popover: Rename `show_*` functions to `toggle_*`.
This naming more accurately reflects the functionality of these types
of functions. They are not only responsible for displaying the
popovers but also for toggling them off.
2023-09-13 11:49:12 -07:00
Daniil Fadeev e5da3d9900 user_card_popover: Extract user card popover data into a new function.
The purpose of this change is to simplify the
`render_user_card_popover` function, so it has the single
responsibility of just rendering.
2023-09-13 11:49:12 -07:00
Daniil Fadeev c5f6c00a81 popovers: Extract user info popovers into their own module.
The intent behind this commit is to tidy up how we handle user info
popovers. The first step is to move everything related to them into
its own module. This commit should not have any functional changes.
2023-09-13 11:49:08 -07:00
Daniil Fadeev 64f77b1dee popovers: Stop exporting `toggle_playground_link_popover` function.
This function is only used in the `popovers.js` module, so there's no
need to export it.
2023-09-13 11:48:31 -07:00
Daniil Fadeev 7bcb868f9a popovers: Use a special function to check if the popover is open. 2023-09-13 11:48:31 -07:00
Daniil Fadeev 257c327f39 user_profile: Move event registration to the correct place.
The event callback that was moved is part of `user_info_popover` and
should be registered along with the other actions of this popover.
2023-09-13 11:48:31 -07:00
Daniil Fadeev 523b5a0877 popovers: Remove unused functions from `popovers.js` module. 2023-09-13 11:48:31 -07:00
Daniil Fadeev 0a11a4b983 notifications: Extract notification title retrieval.
This commit aims to extract all logic related to obtaining
notification title from the `process_notification` function into
a separate `get_notification_title` function.
2023-09-13 11:18:35 -07:00
Daniil Fadeev fe5d680f27 notifications: Refactor `process_notification` function.
Turned multiple if statements into a switch/case and rearranged
variable declarations.
2023-09-13 10:55:59 -07:00
Daniil Fadeev 8b8f95b6f5 notifications: Extract sender name removal from recipients list. 2023-09-13 10:55:59 -07:00
Daniil Fadeev 53ef273665 notifications: Extract notification key retrieval.
This commit aims to extract all logic related to obtaining
notification key from the `process_notification` function into a
separate `get_notification_key` function.
2023-09-13 10:55:59 -07:00
Daniil Fadeev fdac13ba24 notifications: Extract `notification_source` debugging logic.
This commit aims to extract all logic related to debugging the value
of `notification_source` from the `process_notification` function into
 a separate `debug_notification_source_value` function.
2023-09-13 10:55:59 -07:00
Daniil Fadeev a11dedd393 notifications: Extract notification content retrieval.
This commit aims to extract all logic related to obtaining
notification content from the `process_notification` function into a
separate `get_notification_content` function.
2023-09-13 10:55:59 -07:00
Daniil Fadeev 8d0a70b6b9 notifications: Simplify if statement.
Since `pm_content_in_desktop_notifications` is a boolean, there's no
need to check if it's undefined.
2023-09-13 10:55:59 -07:00
Tim Abbott ba22433dd9 stream_popover: Inline register_stream_handlers.
Also register these click handlers just on the popover itself directly
in the onMount helper, like we do with all the other popover_menus.js
functions.
2023-09-13 10:55:40 -07:00
Daniil Fadeev 08aec5ac41 stream_popover: Migrate from Bootstrap to Tippy. 2023-09-13 10:55:40 -07:00
Daniil Fadeev f2f0462e09 stream_popover: Rename stream_popped to is_open.
stream_popover.is_open() much more accurately describes what this
does, and in particular the fact that the function applies to all
places the stream popover might be.
2023-09-13 10:55:40 -07:00
Daniil Fadeev 35d97160bc stream_popover: Use currentTarget as reference to the stream popover.
Using currentTarget as a reference element guarantees us that the
relative placement will be the same every time.
2023-09-13 10:55:40 -07:00
Daniil Fadeev e0f72de75c stream_popover: Update the comment that describes the module. 2023-09-13 10:55:40 -07:00
Daniil Fadeev 71de1c2a66 popovers: Use `media_breakpoint_num` instead of a constant value. 2023-09-13 10:55:40 -07:00
Aman Agrawal a8e1c22687 inbox: Add support for vim keys. 2023-09-12 09:20:33 -07:00
Aman Agrawal 6c179bcc48 inbox: Show focus underline for non-dm rows. 2023-09-12 09:20:33 -07:00
Aman Agrawal 58c5701e5e css: Assign a variable to focus underline color of recent view. 2023-09-12 09:20:33 -07:00
Aman Agrawal f12fe219d9 inbox: Sort pinned streams at the top. 2023-09-12 09:20:33 -07:00
Aman Agrawal 4559a9fbf3 inbox: Save collapsed state of streams in localstorage. 2023-09-12 09:20:33 -07:00
Aman Agrawal 6ef0753a51 inbox: Add new narrow. 2023-09-12 09:20:33 -07:00
Anders Kaseorg 3d7b9e622d web: Avoid several unchecked TypeScript casts.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-11 18:04:55 -07:00
Anders Kaseorg 4650b789ce browser_history: Delay user_settings.default_view evaluation.
Commit 61f7ede43c (#25759) introduced a
bug: browser_history tried to access user_settings.default_view at top
level as soon as it was imported, before
user_settings.initialize_user_settings has been called, so
browser_history.state.spectator_old_hash was always initialized to
"#undefined".

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-11 18:04:55 -07:00
Prakhar Pratyush 20886b80d9 topic_list: Update the order of "Followed" topics in the muted stream.
For sorting topics in the left sidebar topics list, the "Followed"
topics are treated the same as "Unmuted" topics.

In a muted stream and not zoomed state:
* followed/unmuted topics at the top.

In an unmuted stream or zoomed state in a muted stream:
* normal recency sorting

The reason is that the "Followed" topics have a tier of interest
above being unmuted, so they shouldn't lie below the "Unmuted" topics
in the list.
2023-09-11 17:55:37 -07:00
Prakhar Pratyush 5d069b7d7a topic_list: Add an icon and update the color for "Followed" topics.
This commit adds the follow icon to the right end
(before the three-dot menu icon) of the topic list item
for followed topics.

The icon replaces '@' instead of showing both the '@' and "Follow"
icons in the case of unread mentions, as users don't care if they
are following a topic if they've got unread mentions there.

In a muted stream, the text color of followed topics in the topic list
is set to be similar to that of unmuted topics.

The reason is that the followed topic has a tier of interest above
being unmuted, so it shouldn't stay faded in the topic list.
2023-09-11 17:55:35 -07:00
Prakhar Pratyush 07fd2aa344 topic_list: Add a CSS variable for the unmuted topic's color.
This commit adds the CSS variable '--color-unmuted-topic-list-item'
for the unmuted topic's color in the topic list.

The color for both the light and dark themes is defined in
'zulip.css' and used in 'left_sidebar.css'.

This approach helps to remove the use of the selector 'unmuted_topic'
only for color definition in 'dark_theme.css'.
2023-09-11 17:12:21 -07:00
Lalit Kumar Singh 5f74b9051e ts: Migrate `user_topics.js` to typescript. 2023-09-11 10:57:38 -07:00
Lalit Kumar Singh dc142ab1d1 fold_dict: Use `IterableIterator` instead of `Iterator`.
The type `Iterator` does not allow us to loop over the iterator in a `for`
loop. but `IterableIterator` does.
2023-09-11 10:57:38 -07:00
Lalit Kumar Singh d82b3625f1 user_topics: Pop `user_topics` from `page_params`.
This avoids accessing the global page_params directly.
2023-09-11 10:57:38 -07:00
Daniil Fadeev a2b4db07f6 emoji_picker: Move module event registration to initialization. 2023-09-11 10:42:18 -07:00
Tim Abbott b0007bf5ca settings: Navigate to profile to edit self in users panel.
We don't have a "Manage user" tab in your own profile, so it would
throw an exception to do the default thing here, and the mechanism for
editing your own settings should be the main "your profile" panel,
which is a bit bigger and more user-friendly.

I'm not totally convinced that the extra logic for not having a
"Manage user" tab is worth it; the alternative of figuring out a
non-confusing label would not be terrible here. But this version is
non-broken, and it'll be easy to change later if we change our mind.
2023-09-11 10:39:00 -07:00
Tim Abbott 0174902b73 user_profile: Centralize footer logic. 2023-09-11 10:39:00 -07:00
palashb01 db47f675f0 user_profile: Add tippy tooltips to edit pencil button.
This commit adds Tippy tooltips to the edit pencil button
in the user profile. Now, when a user opens another user's
profile, they will see the tooltip 'Manage user', and when
they open their own user profile, they will see the tooltip
'Edit profile'.
2023-09-11 10:39:00 -07:00
palashb01 1c049ab5f4 user_profile: Replace the id with class for pencil button.
This commit replaces the id attribute with class attribute for the
edit pencil button in user profile modal.
2023-09-11 10:39:00 -07:00
palashb01 135518435a user_profile: Align the title header of the modal and fix edit button.
This commit unsets the padding of the bot icon and, as the anchor
tag has been replaced with the i tag, we have also set the color
and pointer. This is done so that when the user hovers over the
icon, it will appear as a clickable button.
2023-09-11 10:39:00 -07:00
palashb01 f9dd2db3e4 user_profile: Move bot icon to the left of the name.
This commit moves the bot icon to the left of the name in the user
profile and adds a margin-left and margin-right to the name to ensure
there is enough space between the icon, name, and edit pencil.
2023-09-11 10:39:00 -07:00
palashb01 c6bb7b9169 user_profile: Redirect edit pencil to manage user tab.
This commit redirects the edit pencil in the user profile modal to
the 'manage user' tab whenever a user with permission to manage
other users via the user profile opens another user's profile.
However, we still want to redirect the edit pencil to
'settings/profile' if the user opens their own profile. The user
management permission is granted if the user is an admin or the
owner of the bot. However, we do not want system bots to have
access to the edit pencil or the 'manage user' tab. Therefore,
a new variable called 'can_manage_profile' has been introduced
to manage all these permissions, and the CSS has been updated
accordingly.

To redirect to the manage user tab without opening another modal,
I have extracted the toggler. This toggler will store the
component, and if the edit pencil button is clicked, we can use
the goto function to redirect to a different tab.

Changed the id names of both the edit pencil icons to explain
better of what they do.
2023-09-11 10:39:00 -07:00
palashb01 e1322faae0 user_profile: Fix the gap between labels and input.
This commit increases the gap between the labels and input/select
of the user profile manage user/bot tab for clearer visibility.
It also reduces the gap between the 'deactivate user' button and
the last input to make it look better.
2023-09-11 10:39:00 -07:00
palashb01 6323bb1e39 user_profile: Disable deactivate user button if the admin is only user.
This commit disables the "Deactivate User" button inside the
"manage user" tab in the user profile modal. Additionally, a
tooltip is applied to the button by wrapping it inside a div
with the tooltip applied.
2023-09-11 10:39:00 -07:00
palashb01 c2f878638b user_profile: Fix inconsistent height of user profile switching tabs.
This commit fixes the inconsistent height of the user profile when
switching tabs. We now have four tabs in the user profile:
"Profile," "Streams," "User Groups," and "Manage User." However,
the "Manage User" tab has footer buttons that need to remain
sticky at the bottom without changing the overall height of
the modal.

To achieve this, we wrapped the footer inside a div element and
assigned it a class called "manage-profile-tab-footer." The main
body of the user profile is given a height of 60vh. However, for
the "Manage User" tab, we decreased this height to 52vh and
allocated the remaining 8vh height to the div element to
accommodate the footer buttons. This ensures that the user
profile maintains consistent height when switching between tabs.

However, we have a 1px border in the footer, so to ensure that
the height is consistent, we reduce the height of the modal
content by 1px, making it calc(52vh - 1px).

To implement this, CSS code was added to the "popover.css" file
and accessed through the class specified in the "user_profile.js"
file.

The default padding of the buttons inside footer is 20px, but
with the above solution on large screens the buttons are not
aligned properly, so removed the padding top and bottom
and instead applied the flex box and property to align the buttons.
2023-09-11 10:39:00 -07:00
palashb01 66bf87062e settings_users: Combine "handle_human_form" and "handle_bot_form".
To remove duplicated code this commit will combine two functions.
2023-09-11 10:39:00 -07:00
palashb01 61948d273b settings_bots: Migrate manage bot to user profile modal.
This commit migrates the "Manage Bot" modal to the user profile modal,
with the same explanation as in the "Manage User" modal commit.
However, in this commit, we changed the permission of the "Manage User"
tab so that non-admin users can also see the "Manage Bot" tab if they
have created the bot. Additionally, since we can't make changes to
system bots, we check if the bot is a system bot and hide the
"Manage Bot" tab accordingly.

Fixes: #21806
2023-09-11 10:39:00 -07:00
palashb01 5d8e6b5f92 settings_users: Make element variable name more descriptive. 2023-09-11 10:39:00 -07:00
palashb01 218bde443a profile_modal: Migrate manage user footer buttons to user profile.
This commit migrates the "Manage User" footer buttons to the user
profile modal. We made this change because we don't want the buttons
to scroll with the content; instead, we want them to be sticky at
the bottom at all times. Therefore, we moved the buttons to the user
profile modal.
2023-09-11 10:39:00 -07:00
palashb01 61cca84b17 settings_users: Migrate manage user modal to full profile modal.
This commit migrates the "manage user" modal to the "Full Profile"
modal. Refactored the show_edit_user_info_modal function since
earlier, we used to have a separate "Manage User" modal.
Consequently, we checked if we were coming from the
user_info_popover and then built the dialog widget accordingly.
However, with this new change, we no longer need to build the
dialog widget. Therefore, removed that part and now just pass
the container of the 'user profile modal' to get the content.

Previously, for deactivation, we used to have a separate dialog
widget. But now, since we have a dedicated function to handle
this case, refactored the deactivation code to use the
'confirm_deactivation' function.

Additionally, created two new functions to handle the loading
spinner. Since we will need these functions in the future for
the "Manage Bot" modal, we marked them as exported.

"Since we do not want to show the 'Manage User' tab to the user
looking at their own profile, in the 'can_manage_user' function
that we use to render the 'Manage User' tab, we check if the user
profile popover belongs to the same user. If it does, we set it to
'false' instead of 'true,' ensuring that the 'Manage User' tab is
not visible.

Added a new tab in the user profile modal 'manage user'.

Fixes: #21806
2023-09-11 10:39:00 -07:00
Daniil Fadeev a844be8825 user_group_popover: Remove unused template parameter. 2023-09-11 10:27:03 -07:00
Daniil Fadeev a3906009ae user_group_popover: Refactor and rename helper functions.
Rearranged some code to align with our current patterns and improve
readability. Renamed `show_user_group_info_popover`. No functional
changes in this commit.
2023-09-11 10:27:03 -07:00
Daniil Fadeev 7777c55b22 popovers: Extract `user_group_popover` into separate module.
This is a preparatory commit before we migrate `user_group_popover`
from Bootstrap to Tippy library.

The previous implementation was weirdly sharing the logic around
`current_message_info_popover_elem` with the user info popovers based
on a message; very likely an unfortunate latent bug caused by
copy/paste.

To address that, we need to add dedicated functions like
get_user_group_popover_items to avoid breaking keyboard navigation
with this extraction.
2023-09-11 10:26:50 -07:00
palashb01 1765ce23b0 user_profile: Adjust the stream tab headings to look good.
With the previous commits, we have now implemented the subscribe
widget with a separate heading. However, the font size and the gap
of both the heading of the widget and the streams list look bad,
so this commit fixes that.

Since the heading of both the widget and the list have the same CSS,
instead of duplicating it, we used the same class for both and
reduced the font size.
2023-09-10 11:20:15 -07:00
Aman Agrawal 6321ab54ce dropdown_widget: Show empty list text without initiating search.
Fixes #26649

If there are no items for dropdown widget to display, show empty
search result text.
2023-09-10 11:20:15 -07:00
palashb01 656494d73b user_profile: Add a reset subscribe widget function.
This commit adds a reset function for the subscribe widget so that
whenever someone subscribes to a stream from the dropdown, after
the subscription, the dropdown will return to its initial state
with no stream selected. Additionally, it will display a label with
the subscribe button disabled and a tooltip.
2023-09-10 11:20:15 -07:00
palashb01 daf3d9ee74 user_profile: Add tippy tooltip to subscribe button.
This commit adds a tippy tooltip to the subscribe button in
the user profile. We show this tooltip only when there is no
stream selected and the button is disabled. However, on any
change, we enable the button and hide the tooltip.
2023-09-10 11:20:15 -07:00
palashb01 4e786293ae user_profile: Add the subscribe widget to user profile.
This commit adds a subscription widget to the user profile,
including the logic to prevent non-admin users from seeing the
subscription widget of other users. Additionally, as it is not
possible to subscribe generic bots to streams, and the user should
not be a deactivated user, we check for these conditions before
displaying the subscription widget.

To ensure that the alert for both subscribing and unsubscribing
appears on top of the subscribe widget, changed the location of
the alert to be displayed at the top.

Additionally, considering that no stream will be initially selected,
we have made the decision to disable the subscribe button. Once the
user selects a stream, we will enable the subscribe button
accordingly.

Changed the add_user_ids_to_stream function inside subscriber_api.js
to support self subscribe also, so that we don't have to duplicate the
logic in user_profile.js

Created a separate file for the subscribe widget called
user_profile_subscribe_widget.hbs.

Fixes: #18883
2023-09-10 11:20:15 -07:00
Tim Abbott d494f5bdaa user_profile: #user-profile-modal is a singleton.
The closest($stream_row) logic is unnecessary, and worth cleaning up
because we'll be adding other calls from places that don't have a
stream row object.
2023-09-10 11:20:15 -07:00
Aman Agrawal 45491710b7 narrow: Check if coming for `All messages` narrow when deactivating.
This will work correctly as we add more narrows like recent topics.
2023-09-09 18:51:01 -07:00
Aman Agrawal a5dafa383c left_sidebar_navigation_area: Rename narrow_to_recent_topics.
narrow is a term that is intended to only apply to a message feed
view; it comes from "narrowing the set of messages you're looking
at from the All messages" so switching it to something different
makes sense.
2023-09-09 18:51:01 -07:00
Aman Agrawal f75a5483cf left_sidebar_navigation_area: Add a note to rewrite the logic. 2023-09-09 18:51:01 -07:00
Lalit Kumar Singh c47a18eb2b ts: Migrate `realm_logo` to TypeScript. 2023-09-09 18:30:43 -07:00
Lalit Kumar Singh b8e0850aa1 ts: Migrate `realm_icon` to TypeScript. 2023-09-09 18:30:43 -07:00
Anders Kaseorg 61bc10ca01 web: Add missing CSS selector escaping.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-08 15:35:50 -07:00
Lauryn Menard b4f02a336d demo-orgs: Add section on configuring email address to help article.
Adds a section to the demo organizations help center article about
configuring an email and password for demo organization owners.

For demo organization warning banners about needing to configure
an email, add a link to the new section in the help article.

Also, adds a related articles section to the help center article,
and updates the current draft text for changes in how the demo
organization feature is being implemented.
2023-09-08 15:17:23 -07:00
Lauryn Menard 3ef2c9e0cf demo-orgs: Update invite users warning to be same as auth methods.
To reduce extra work for translators, make text for warning banners
and tooltips in demo organizations when the organization owner has
not configured an email address consistent.
2023-09-08 15:17:23 -07:00
Lauryn Menard 11adc0f37d demo-organizations: Rename shortend versions of 'demo organization'.
Rename existing shortened references to demo organizations, like
`is_demo_org` or `demo-org-warning`, that have been used in the
codebase so far and replace them to be like the `models.py`
variable: `Realm.demo_organization_scheduled_deletion_date`.
2023-09-08 15:17:23 -07:00
Anders Kaseorg 4beea6c210 input_pill: Remove incorrect $ prefix from non-jQuery variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-08 15:09:39 -07:00
Anders Kaseorg 6232425618 message_overlay_ui: Prefix jQuery object variable names with $.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-08 15:09:39 -07:00
Anders Kaseorg 55e4be0939 setup: Fix wildly unsafe cast in $.fn.expectOne.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-08 14:32:26 -07:00
Lalit Kumar Singh affdffdda5 ts: Migrate `settings_emoji.js` to TypeScript. 2023-09-08 13:09:34 -07:00
Lalit Kumar Singh 88ac9eec58 settings_emoji: Put null authors at the end on sorting. 2023-09-08 13:09:34 -07:00
Lalit Kumar Singh 798778ee88 upload_widget: Remove default value for `max_file_upload_size`.
The callers of function `upload_widget.build_direct_upload_widget` always
have a defined value for the parameter `max_file_upload_size`, hence we
should just remove the default value for this parameter here.
2023-09-08 13:09:12 -07:00
Lalit Kumar Singh 5c2ba6c8fa ts: Migrate `avatar.js` module to TypeScript. 2023-09-08 13:09:12 -07:00
Lalit Kumar Singh 8d7a9162e2 jquery: Make `expectOne` helper function generic. 2023-09-08 13:09:12 -07:00
Karl Stolley df18d2768c images: Prevent default browser behavior on paste.
This introduces an early return when no files are found on the
clipboard, which is a necessary condition to safely invoke
`event.preventDefault()` without short-circuiting run-of-the-mill
pastes.

CZO discussion:
https://chat.zulip.org/#narrow/stream/191-kandra-support/topic/embedded.20links.20broken.3F/near/1635730
2023-09-08 13:04:04 -07:00
Aman Agrawal 34927a6d96 narrow: Don't call deactivate directly.
As stated in the deactivate function comments, it should be called
via `browser_history.go_to_location` so that all the correct
functions are called like recent view being hidden.

This fixes a bug where searching for nothing results in activating
all messages narrow without hiding recent view. Now, all messages
should be activated as expected.
2023-09-08 09:30:28 -07:00
Lauryn Menard 9959c48697 i18n: Fix formatting in recent_topic_row template.
Corrects formatting for translated string in handlebars template.

Fixes #26640.
2023-09-08 09:09:46 -07:00
Lauryn Menard 64929d7bd1 i18n: Simplify formatting in subscribe_to_more_streams template.
There's no need to use the multi-line `tr` block format here.
2023-09-08 09:09:46 -07:00
evykassirer 49667cdbdb recent: Rename recent_topics test file. 2023-09-08 07:36:33 -07:00
evykassirer fc2ff74ea2 recent: Rename recent_topics in some test files. 2023-09-08 07:36:33 -07:00
evykassirer d3e561dbb1 recent: Rename some variables referencing recent_topics. 2023-09-08 07:36:33 -07:00
evykassirer 54acc3fccf recent: Rename recent_topics.css. 2023-09-08 07:36:33 -07:00
evykassirer a8ba40c04e recent: Rename narrow_to_recent_topics. 2023-09-08 07:36:33 -07:00
evykassirer 3179e6bb86 recent: Rename .top_left_recent_topics. 2023-09-08 07:36:33 -07:00
evykassirer 92163ad207 hotkey: Rename open_recent_topics. 2023-09-08 07:36:33 -07:00
evykassirer 37d6f319e3 recent: Rename coming_from_recent_topics. 2023-09-08 07:36:33 -07:00
evykassirer 08112356c8 recent: Rename maybe_hide_recent_topics. 2023-09-08 07:36:33 -07:00
evykassirer 0804704a76 recent: Rename update_buttons_for_recent_topics. 2023-09-08 07:36:33 -07:00
evykassirer ee2208ff9a recent: Rename .recent_topics_participant_avatar. 2023-09-08 07:36:33 -07:00
evykassirer d40030d4ae recent: Rename .recent_topics_participants. 2023-09-08 07:36:33 -07:00
evykassirer 8896cb28cb recent: Rename .recent_topics_participant_item. 2023-09-08 07:36:33 -07:00
evykassirer 29b796db7a recent: Rename .recent_topics_focusable. 2023-09-08 07:36:33 -07:00
evykassirer 6d67723fbe recent: Rename .recent_topics_participant_overflow. 2023-09-08 07:36:33 -07:00
evykassirer 77fcedfb50 recent: Rename #recent_topics_search. 2023-09-08 07:36:33 -07:00
evykassirer e5cd59c224 recent: Rename #recent_topics_filter_buttons. 2023-09-08 07:36:33 -07:00
evykassirer f7b96b2bee recent: Rename #recent_topics_loading_messages_indicator. 2023-09-08 07:36:33 -07:00
evykassirer 11591f7169 recent: Rename #recent_topics_bottom_whitespace. 2023-09-08 07:36:33 -07:00
evykassirer f4954d3183 recent: Rename .recent_topics_container. 2023-09-08 07:36:33 -07:00
evykassirer 0e6cbf14ea recent: Rename #recent_topics_view. 2023-09-08 07:36:33 -07:00
evykassirer 131127aa30 recent: Rename #recent_topics_table. 2023-09-08 07:36:33 -07:00
evykassirer d13a16055b recent: Rename recent_topics templates. 2023-09-08 07:36:33 -07:00
evykassirer 0b1a41ad09 recent: Rename sender_info_for_recent_topics_row. 2023-09-08 07:36:33 -07:00
evykassirer f8dee6c860 recent: Rename recent_topics_filters_height. 2023-09-08 07:36:33 -07:00
evykassirer e08f64cc1c recent: Rename recent_topics_data. 2023-09-08 07:36:33 -07:00
evykassirer 3c16541eb4 recent: Rename recent_topics_util. 2023-09-08 07:36:33 -07:00
evykassirer f8db06569f recent: Rename recent_topics_ui. 2023-09-08 07:36:33 -07:00
Lalit Kumar Singh 9a6f7f0ead ts: Migrate `attachments_ui.js` to typescript. 2023-09-07 17:54:48 -07:00
Lalit Kumar Singh bcb0406f9b attachment_ui: Use `Math.trunc` instead of `Math.parseInt`.
We should use `Math.trunc` here instead of `Math.parseInt` as it is more safe.
Reference Doc: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#using_parseint_on_non-strings
2023-09-07 17:54:48 -07:00
Lalit Kumar Singh 02e0537248 attachments_ui: Avoid modifying the attachment data sent from server.
We should avoid adding extra fields directly on the server data because
it makes it hard to infer the types for the functions such as
`format_attachment_data`.
2023-09-07 17:54:48 -07:00
Daniil Fadeev c99c8f4640 i18n: Mark info overlay usage_html for translation. 2023-09-07 17:38:35 -07:00
Palash Baderia 1e85683570 user_profile: Sort the stream list on update.
This commit fixes the issue of reordering the stream list when the
user unsubscribes from a stream. The issue was caused because, on
rendering, we sorted the list by name but did not sort it while
updating the stream list on any update.
2023-09-07 16:55:47 -07:00
Prakhar Pratyush 59cf305053 compose_banner: Remove the warning for messages in FOLLOWED topics.
Earlier, when a message was sent in a followed topic in
a muted stream, a compose banner warning with a suggestion
to UNMUTE the topic for receiving notifications about new messages
was shown.

This commit fixes the incorrect behavior. No warning is shown
in the case mentioned above because a user, in general, already
receives notifications for messages in FOLLOWED topics.
2023-09-07 16:54:06 -07:00
Daniil Fadeev 0a424f0c5e message_reactions: Clean up the aria attributes for reaction_button. 2023-09-07 14:44:18 -07:00
Daniil Fadeev dc49c52b95 message_reactions: Fix the emoji icon that has a strange outline. 2023-09-07 14:44:18 -07:00
Daniil Fadeev 96d070143a emoji: Rename `reaction_button_visible`.
This commit renames the `reaction_button_visible` class to
`active-emoji-picker-reference` to clearly document what it's for.
2023-09-07 14:44:18 -07:00
Daniil Fadeev 08279820fb emoji: Rename `emoji-info-popover` to `emoji-picker-popover`. 2023-09-07 14:44:18 -07:00
Daniil Fadeev 6d3d9165b1 emoji_picker: Rename reactions_popped to is_open.
emoji_picker.is_open() much more accurately describes what this does,
and in particular the fact that the function applies to all places the
emoji picker might be.
2023-09-07 14:44:18 -07:00
Daniil Fadeev 82ca794f94 emoji: Migrate popover from Bootstrap to Tippy.
Fixes part of #23632.
2023-09-07 14:44:18 -07:00
Daniil Fadeev 8fc4d99e33 emoji: Make the emoji popover toggling process simpler.
After this change we add the "reaction_button_visible" class to every
reference element of the emoji popover. There's no need to handle the
user status picker case since the reference element should always be
visible. That's why we're reducing some complexity, even though it
means adding a class to the user status picker reference.
2023-09-07 14:44:18 -07:00
Daniil Fadeev 42bea85666 popovers: Ignore `data-reference-hidden` attribute for mobile popovers.
By default, Tippys with the `data-reference-hidden` attribute aren't
displayed. But when we render them as centered overlays on mobile and
use `getReferenceClientRect` for a virtual reference, Tippy slaps this
 hidden attribute on our element, making it invisible. We want to
 bypass this in scenarios where we're centering popovers on mobile
 screens.
2023-09-07 14:44:18 -07:00
Daniil Fadeev c33dac8ab3 popover_menus: Fix the API for popover centering.
The offset modifier is tricky and its calculations is related to the
placement of the popover. So, to prevent inconsistency, we should fix
the placement to some value.
2023-09-07 14:44:18 -07:00
Daniil Fadeev e5b8731e83 popover_menus: Fix the error that happens when the props are missing.
When `onMount` or `onHidden` methods aren't provided at the original
point of popover creation, an execution error occurred.
2023-09-07 14:44:18 -07:00
Tim Abbott 6c83bbcbdb settings: Disallow everyone group for new setting.
This is important because the "guests" value isn't one that we'd
expect anyone to pick intentionally, and in particular isn't an
available option for the similar/adjacent "email invitations" setting.
2023-09-07 14:21:01 -07:00
Ujjawal Modi 5e31a6b1c0 invites: Make it possible for non-admins to revoke multiuse invites.
This commit makes changes to allow non-admins to revoke multiuse
invitations created by them.
2023-09-07 14:21:01 -07:00
Ujjawal Modi 9a96d19315 invites: Frontend changes for adding the new realm setting.
This commit does the changes in frontend required
for adding the new setting `Who can create multiuse invite link.`

Fixes #15159.
2023-09-07 14:21:01 -07:00
Ujjawal Modi 21b1298c1d frontend: Initialize user_group module before right_sidebar module.
This commit initializes the user_group module before right_sidebar
module. This was needed to check whether user is member of user_group
whose members are allowed to create invite links.
2023-09-07 14:21:01 -07:00
Ujjawal Modi ec49c3acc8 invites: Rename `can_invite_others_to_realm` local variables.
This commit rename the existing setting `Who can invite users to this
organization` to `Who can send email invitations to new users` and
also renames all the variables related to this setting that do not
require a change to the API.

This was done for better code readability as a new setting
`Who can create invite links` will be added in future commits.
2023-09-07 14:21:01 -07:00
Ujjawal Modi 77c67464ba invites: Live update option to create new invitations.
Earlier option to create new invitations in right_sidebar,
gear_menu and invitations panel does not get live update
when the setting `who can invite others to realm` is changed.

This commit make changes to do live update.
2023-09-07 14:21:01 -07:00
Ujjawal Modi 54c7cbaf1c docs: Change `Create an invitation link` heading.
This commit changes the `Create an invitation link` heading
in help docs to `Create a reusable invitation link`.
2023-09-07 14:21:01 -07:00
evykassirer 1e9bb82068 recent view: Rename topics to conversations in code comments. 2023-09-07 10:35:06 -07:00
Anders Kaseorg 48a3588cdb docs: Fix typos caught by ‘typos’.
https://github.com/crate-ci/typos

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-06 18:59:05 -07:00
Lauryn Menard 91b40a45fe demo-orgs: Add email and password process for demo organization owners.
Creates process for demo organization owners to add an email address
and password to their account.

Uses the same flow as changing an email (via user settings) at the
beginning, but then sends a different email template to the user
for the email confirmation process.

We also encourage users to set their full name field in the modal for
adding an email in a demo organization. We disable the submit button
on the form if either input is empty, email or full name.

When the user clicks the 'confirm and set password' button in the
email sent to confirm the email address sent via the form, their
email is updated via confirm_email_change, but the user is redirected
to the reset password page for their account (instead of the page for
confirming an email change has happened).

Once the user successfully sets a password, then they will be
prompted to log in with their newly configured email and password.
2023-08-31 15:02:16 -07:00
Lauryn Menard 2e00ca4197 demo-orgs: Disable invite_user_modal if email not configured.
Because demo organization owners do not initially have an email
set, some of the personal and organization settings in the web-app
UI should be disabled/hidden until the owner configures an email
address for their account.

Disables the form input elements in the invite user modal if the
user's email is not configured. Also displays a tip at the top of
the modal to let the user know why the form is disabled.
2023-08-31 15:02:16 -07:00
Lauryn Menard 19b8217e49 demo-orgs: Disable changing user's email visibility until email set.
Because demo organization owners do not initially have an email
set, some of the personal and organization settings in the web-app
UI should be disabled/hidden until the owner configures an email
address for their account.

Disables the dropdown for changing the user's email address visibility
in the account & security tab of the personal settings overlay until
the user configures an email address.
2023-08-31 15:02:16 -07:00
Lauryn Menard b0bc66a8ba demo-orgs: Disable admin of authentication methods until email set.
Because demo organization owners do not initially have an email
set, some of the personal and organization settings in the web-app
UI should be disabled/hidden until the owner configures an email
address for their account.

Disables configuring organization authentication methods in the
organization settings overlay until the user has configured an email
address. Adds a tip at the top of the authentication methods tab to
indicate why the authentication method checkboxes are disabled.
2023-08-31 15:02:16 -07:00
Lauryn Menard 665deac7c0 demo-orgs: Disable show/change API key if email not configured.
Because demo organization owners do not initially have an email
set, some of the personal and organization settings in the web-app
UI should be disabled/hidden until the owner configures an email
address for their account.

Disables the show/change API key button in the account & security
tab of the personal settings overlay if the user's email address
is not configured. A tooltip is shown when hovering over the disabled
button explaining why the feature is disabled.
2023-08-31 15:02:16 -07:00
Lauryn Menard 6a36340ac7 demo-orgs: Hide change password field if email not configured.
Because demo organization owners do not initially have an email
set, some of the personal and organization settings in the web-app
UI should be disabled/hidden until the owner configures an email
address for their account.

Updates showing the password change field in the account & privacy
tab of the personal settings overlay to check if the user's email
being configured (to cover the demo organization case) and if the
organization has enabled password authorization.
2023-08-31 15:02:16 -07:00
Lauryn Menard fd45350532 settings-data: Add `user_email_not_configured` check.
Since an email address is not required to create a demo organization,
we need to disable some parts of the web-app UI until the owner of
the demo organization configures an email address for their account.

Addd `user_email_not_configured` check to `settings_data.ts` so
that we can check in various modules if the user is a demo
organization owner who has not configured an email address yet.

This adds `delivery_email` to `page_params.ts`. Also, adjusts the
`muted_users` in the list of page params so that the list is sorted
alphabetically.
2023-08-31 15:02:16 -07:00
Anders Kaseorg dacb5c89af remind_me_popover_content: Remove unused template.
It’s unused since commit eb45925b1a
(#23665), and the entire reminder feature was removed in commit
f40855bad2 (#25318).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-31 14:59:39 -07:00
Anders Kaseorg eaffbeaf35 non_editable_user_groups: Remove unused template.
It was added by commit c53458c9c0
(#8806) and never used.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-31 14:59:39 -07:00
Anders Kaseorg 6758d8ad12 settings/dropdown_list: Remove unused template.
It’s unused since commit 875d564f2d
(#26291).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-31 14:59:39 -07:00
Anders Kaseorg de7af60e29 actions_popover_template: Remove unused template.
It’s unused since commit eb45925b1a
(#23665).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-31 14:59:39 -07:00
Anders Kaseorg 38e7a85e90 colorspace: Remove unused module.
It’s unused since commit 7e473003a6
(#23782).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-31 14:59:39 -07:00
Lalit Kumar Singh cfe2ddb091 ui_report: Reuse `channel.xhr_error_message` function in `error` method.
We should reuse the `channel.xhr_error_message` in `ui_report` to reduce
code duplication.

Also, I changed the type of `message` parameter to `string` instead of
`string | null` so that we do not need to alter the types of the functions
that depends on the return value of `xhr_error_message`.
2023-08-31 13:47:16 -07:00
Karl Stolley 2e07c03968 settings: Align notification play button in a flex layout.
This allows the select to flex, keeping the buttons position on
screen even at mobile-scale viewports.

While other most other controls are currently not so responsive,
this might provide some direction (along with a TODO) on how to
go about moving controls in that direction.

Fixes: #26563
2023-08-31 12:06:32 -07:00
Karl Stolley 8b81f2c92c settings: Match notification sound for attribute to ID. 2023-08-31 12:06:32 -07:00
Prakhar Pratyush 43009f7885 icons: Fix the 'Unmute' topic icon.
Earlier, the icon had an unwanted line visible in a few browsers.

Replaced it with a new SVG.
2023-08-31 12:02:07 -07:00
David Rosa 8e2820406e widgets: Rename confusing identifier in `tabbed_instructions.ts`.
Renames misleading identifier using `codeSection` to refer to both
language toggles in API docs and app toggles in help center docs.
2023-08-31 11:55:28 -07:00
David Rosa 4b8c99b01a widgets: Rename confusing attribute name in `tabbed_sections.py`.
Renames misleading attribute in HTML template using `code-section`
to refer to both language toggles in API docs and app toggles in
help center docs.
2023-08-31 11:55:28 -07:00
David Rosa 6e647f12bd widgets: Rename confusing variable/function names in `help.js`.
Renames misleading variable and function names using `code_section`
to refer to both language toggles in API docs and app toggles in
help center docs.
2023-08-31 11:55:28 -07:00
Signior-X 3392be5688 user docs: Convert browser scrollbar overflow from .markdown to html.
Remove overflow: hidden from the body and overflow: auto from the
.markdown element. Adjust the scroll-margin-top on the heading
elements so that using the hash, the page opens at perfect
location. Add position: fixed to .sidebar so that it does not scroll
with the content.

For the mobile view, change the .sidebar right from 100vw to 100%.

Also change how the hamburger menu changes its position: use right
instead of left as that works better than translate combined with
left.
2023-08-30 15:34:34 -07:00
Signior-X f63c1fa639 user docs: Remove right SimpleBar from help and API documentation.
Remove the SimpleBar from the content on /help, /api, and /policies in
favor of the default browser scrollbar.

Fixes #10732.
2023-08-30 15:34:34 -07:00
Karl Stolley 50d8e789cb compose: Prevent undesired link-pasting behavior.
This commit checks for two edge cases where the paste-URL logic
should not apply:

1. On text selections likely already in or adjacent to Markdown
   link syntax
2. Over top of existing links
2023-08-30 15:33:28 -07:00
Karl Stolley a1a8afa2f7 css_grid: Defensively prevent blowouts by using minmax().
This improves upon a change introduced in #26279. But rather than
setting an `overflow` value, this uses `minmax()` with a 0 minimum
value--pushing back against the default grid minimum column value
of `auto`. The `auto` value will always try to fit the content
into the grid, even if that means wreaking havoc on the grid as
defined.
2023-08-30 15:30:40 -07:00
Daniil Fadeev 198ef43ced left_sidebar: Fix the layout for filter names that are long. 2023-08-29 17:28:05 -07:00
Karl Stolley efa3c4a2c6 scroll: Correct element checks before activation. 2023-08-29 17:25:41 -07:00
Danny Su 66b9c06de6 compose: Add support for Zoom audio call
This PR implements the audio call feature for Zoom. This is done by explicitly
telling Zoom to create a meeting where the host's video and participants' video
are off by default.

Another key change is that when creating a video call, the host's and
participants' video will be on by default. The old code doesn't specify that
setting, so meetings actually start with video being off. This new behavior has
less work for users to do. They don't have to turn on video when joining a call
advertised as "video call". It still respects users' preferences because they
can still configure their own personal setting that overrides the meeting
defaults.

The Zoom API documentation can be found at
https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingCreate

Fixes #26549.
2023-08-28 18:32:20 -07:00
David 75a654b9ab
help: Update links to "Edit a message" and "Delete a message".
The series including 0349152f0f split
this page into two smaller pages.
2023-08-28 18:09:41 -07:00
Lalit Kumar Singh 4f3a971e64 ts: Migrate `channel.js` module to TypeScript. 2023-08-28 09:19:07 -07:00
Yogesh Sirsat f3830a3e1e settings_streams: Delete redundant uses of "update_choice_delete_btn".
It is unnecessory to make use of `update_choice_delete_btn` since
we disable the dialog submit button in case no default streams
selected in Org settings > Default streams > Add stream.

This commit is a follow-up to PR: #22903
2023-08-28 08:52:43 -07:00
Yogesh Sirsat a729c95ada custom_profile_fields: Fix empty field choices issue of select field.
While editing select type profile field, if we submit empty or zero
choices it fails silently, current implementation for this issue does
not work for some cases, and this commit will fix that.

This will disable dialog submit button in case of empty field choices.

Also removing code of all calls making to `update_choice_delete_btn`
as that function have no more use-case for empty field choices, still
keeping the function because it gets used in `settings_streams.js`.

Co-authored-by: Palash Baderia <palash.baderia@outlook.com>
2023-08-28 08:52:43 -07:00
Daniil Fadeev 53e081ae29 popover_menus: Create an API to render popovers as a centered overlay.
This commit lets us render popovers centered on the screen with a
background overlay. It's the same thing we did with Bootstrap
popovers, but optimized for use with Tippy.
2023-08-25 12:29:36 -07:00
Daniil Fadeev 32d8ae16d2 popover_menus: Extract toggle_popover_menu. 2023-08-25 12:29:36 -07:00
Daniil Fadeev f3641b8369 popovers: Move color style declaration to a better place. 2023-08-25 12:29:36 -07:00
Karl Stolley 51e3ed0262 compose: Render Mac-specific Cmd, Return at compose bottom. 2023-08-25 10:52:05 -07:00
Daniil Fadeev 54c01ac46e emoji: Remove unnecessary style declaration.
The `.emoji-popover` element is a div and thus has display: block by
default.
2023-08-24 17:54:13 -07:00
Daniil Fadeev 190b25878e emoji: Remove parameter from the emoji popover template.
Only one value was ever used.
2023-08-24 17:54:13 -07:00
Zixuan James Li 2b2a3b41be settings: Remove lock icon when the user can add bots.
Being able to add bots at the admin bot settings page, the lock icon is
unintuitive.

Fixes #24154

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-08-24 16:57:17 -07:00
Zixuan James Li a4963df6ad settings: Remove "add a new bot button" from admin page.
Instead, we show a message with links that either opens a modal for
creating a new bot or navigates to the bot settings page. The
"add a new bot" link only show up when the user has enough permission
to create new bots, and the "manage your bots" link only shows up when
the user has at least one bot if they don't have the permission to
create one. Otherwise, the message does not show up at all.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-08-24 16:57:17 -07:00
palashb01 5df5f6c125 help: Update message edit history documentation.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2023-08-24 16:28:06 -07:00
palashb01 ad70838cff keyboard_shortcuts: Add Shift+H to open message edit history dialog.
This commit introduces a new keyboard shortcut to open the message
edit history dialog for the selected message by using Shift+H.
2023-08-24 16:28:06 -07:00
Palash Baderia 92d1c6e390 message_feed: Remove the view edit history from the three-dot menu.
This commit removes the 'View Edit History' option from the three-dot
menu since we have already implemented this feature through the
edited/moved label in the message. Therefore, we no longer need this
option in the three-dot menu. This commit aims to simplify the
three-dot message menu.

Fixes: #23077
2023-08-24 16:28:06 -07:00
Karl Stolley c7adc5ee74 actions: Show an arrow and render a tooltip on @ indicator. 2023-08-24 14:30:46 -07:00
Karl Stolley 9709e1b4ed actions: Show pointer on bell icon. 2023-08-24 14:30:46 -07:00
Satyam Bansal cc8c159e0a compose: Add support for Jitsi audio calls.
Fixes #12207.
2023-08-24 10:52:34 -07:00
Satyam Bansal 4c501e4321 compose: Extract video call link creation logic to a generic function.
This extraction has been done to make sure that creation of audio call
links can happen in the same function only.

A change in test was also required as the whole logic of finding the
textarea where the link should be inserted happens a bit later now.
2023-08-24 10:52:34 -07:00
Anders Kaseorg 03c24bc459 lightbox: Fix + and - zoom shortcuts to be inverses of each other.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-24 10:45:25 -07:00
Karl Stolley 207a0d789f message_time: Lighten font-weight to 350.
The tabular figures in Source Sans 3 place a foot on the 1, and
overall just feel visually a little heavier than their proportional
counterparts.

To compensate for that, this takes advantage of the variable-font
properties of Source Sans 3 to subtly drop the weight to keep the
timestamp readable but not in fierce competition with the message
area.
2023-08-24 10:44:39 -07:00
Lauryn Menard 80ee255f2b stats: Add stats page_params to `webpack.assets.json`.
In commit 640de3ad29, a separate
`page_params.ts` was added for the stats/analytics page, but adding
it to the `web/webpack.assets.json` for "stats" was missed, so we
add that here.
2023-08-24 10:43:38 -07:00
Samuel 3ce7b77092 typing: Add typing constants to the post register api response.
Adds typing notification constants to the response given by
`POST /register`. Until now, these were hardcoded by clients
based on the documentation for implementing typing notifications
in the main endpoint description for `api/set-typing-status`.

This change also reflects updating the web-app frontend code
to use the new constants from the register response.

Co-authored-by: Samuel Kabuya <samuel.mwangikabuya@kibo.school>
Co-authored-by: Wilhelmina Asante <wilhelmina.asante@kibo.school>
2023-08-23 16:36:44 -07:00
evykassirer 0289beb784 emoji: Match emoji sequences in markdown.
Fixes #11767.

Previously multi-character emoji sequences weren't matched in the
emoji regex, so we'd convert the characters to separate images,
breaking the intended display.

This change allows us to match the full emoji sequence, and
therefore show the correct image.
2023-08-23 16:18:15 -07:00
evykassirer 78f0dca269 narrow: Save blue box position and restore on navigation.
This saves the blue box position as state on the location
in brower history, with `history.replaceState`.

The position is restored when a narrow is activated.

Fixes #20066.
2023-08-23 13:40:26 -07:00
Karl Stolley 3de007d9cd actions: Make uniform horizontal alignment. 2023-08-22 16:21:27 -07:00
Karl Stolley a17c7dfe0b controls: Present bell icon as a block.
This gives better positioning control over this icon, while not
inviting the side-effects and headaches of introducing another
flexbox.
2023-08-22 16:21:27 -07:00
Karl Stolley f07fb4fd58 time: Revert to Source Sans lnum, tnum defaults.
Source Sans 3 defaults to lining (lnum), tabular (tnum) figures,
the latter of which is necessary to have times like 11:11 and 11:18
line up in short, adjacent messages.

CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1629117
2023-08-22 16:19:54 -07:00
palashb01 eee7d18d03 user_profile: update the streams list row dynamically.
Previously, there was no mechanism in place to replace the data.
Therefore, we had to manually delete the stream row when
unsubscribing. However, with the introduction of this new function,
there is no need for manual deletion. The server events code path
already handles the case when any stream is unsubscribed, so we
can simply remove this code.
2023-08-22 11:56:42 -07:00
palashb01 485d307b64 user_profile: Update the streams list dynamically.
This commit introduces a new function named
'update_user_profile_streams_list_for_users'. it will be used
to update the stream_list in the unsubscribed streams section.
Since the list_widget offers a function to replace the data, we
can invoke this function whenever there is a subscription change
in the server_events file or stream_events file.
2023-08-22 11:56:42 -07:00
palashb01 8198a04ce8 stream_data: Refactored function to return sub and can_sub streams.
This commit refactors the 'get_subscribed_streams_for_user' function
to return an object with two keys: one for the subscribed streams
and another for the streams the user can subscribe to. The node
tests have been updated accordingly.

Renamed 'get_subscribed_streams_for_user' to 'get_streams_for_user'.
2023-08-22 11:56:42 -07:00
palashb01 94fe762ea5 user_profile: Add function to return the user profile modal id if open. 2023-08-22 11:56:42 -07:00
Palash Baderia 45569539c5 stream_events: refactor the peer add/remove code path.
This commit is a prep commit for implementing the live update of
user profile streams list. Since the code for both adding and
removing peers is the same after adding or removing the peer data,
it is better to extract that code to reduce duplication in a new
function called 'process_subscriber_update'.
2023-08-22 11:56:42 -07:00
Lauryn Menard b90505699a narrow: Fix by_topic and by_recipient for stream and message ID.
In commit 846b470b99, `narrow.by_topic` was missed for getting
the stream name via the stream ID in the message data. Updates
function to get the stream name to pass in the filter terms
to `narrow.activate`.

In that same commit, `narrow.by_recipient` was updated to not
pass the message ID to `then_select_id`. Updates call to
`narrow.activate` to include that opts parameter so that the
selected message doesn't change.
2023-08-22 11:27:44 -07:00
Junyao Chen 5efe78205d bot_data: Fix `owner_id` field to allow null value.
According to zulip `/register` API doc, `realm_bots[].owner_id`
should be nullable.
Fixes commit 7140149373.
2023-08-22 11:24:40 -07:00
Anders Kaseorg 328cdde243 documentation: Remove duplicate heading IDs on server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 17:25:14 -07:00
Karl Stolley cd0ae56ad4 icons: Implement new gold star color and states.
This not only introduces a new gold color that works across light
and dark modes, but it also separates out the hover and focus-
visible styles for stars--regardless of whether a star has been
filled or not.
2023-08-21 17:13:43 -07:00
Karl Stolley adb3b24cb2 icons: Display focused icons only without default outline.
The :focus-visible selector is more appropriate here, as that
enables browsers to determine whether focus should be displayed
or not. That's generally the case with keyboard-achieved focus,
but pointers and fingers generally do not need focus to be
displayed.

By not displaying a different icon color on simple :focus, this
will also ensure that star icons behave predictably when hovered
or focused via keyboard in both starred and unstarred states.
2023-08-21 17:13:43 -07:00
Karl Stolley 2ac578537c icons: Remove :focus-within styles on hover controls.
This corrects for an issue where hover controls would remain
visible after multiple clicks on one of the hover control icons,
despite the mouse pointer leaving the area.

This does not really create a regression for keyboard focus, as
there is currently no reasonable way to get a Tab key into the
hover controls area.

However, if one clicks multiple times on the vdots icon, and uses
Tab to move back and forth, the icons still remain visible--thanks
to the mouse pointer still being in the hover area.
2023-08-21 17:13:43 -07:00
Karl Stolley 14e9f65349 grid: Apply mobile-style grid when middle column is small.
This introduces a new breakpoint. In the future, this kind of
round-about sizing will be made unncessary by container queries,
but while those ship in all modern browsers, their availability
is quite recent:

https://developer.mozilla.org/en-US/docs/Web/CSS/@container
2023-08-21 17:13:43 -07:00
Karl Stolley 60aa58dfb9 icons: Test out second alternate vdots icon.
See CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1626845

TODO: If this alternate version moves forward, there are still styles
in this PR referring to the other vdots version. So be sure to clean
those up.
2023-08-21 17:13:43 -07:00
Karl Stolley 68ac18a338 time: Increase font-size to 13px.
This is an effort to better unify the size of the timestamp text
with the redesigned hover controls.

CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1621756
2023-08-21 17:13:43 -07:00
Karl Stolley 5d293c82cd icons: Size vdots icon for greater prominence. 2023-08-21 17:13:43 -07:00
Karl Stolley 152722cbed popovers: Use new Zulip icons in actions popover. 2023-08-21 17:13:43 -07:00
Karl Stolley 6380184973 time: Align :hover color with message controls. 2023-08-21 17:13:43 -07:00
Karl Stolley 59e9849a7f icons: Improve hover, focus states and target areas. 2023-08-21 17:13:43 -07:00
Karl Stolley 3c729b60b4 icons: Display alternate move and source icons. 2023-08-21 17:13:43 -07:00
Karl Stolley b0c428edf1 icons: Add microlayout for new icons.
This, along with the preceding commits, fixes #25903.
2023-08-21 17:13:43 -07:00
Karl Stolley b05f76c29e icons: Implement monochrome colors and scaled active state. 2023-08-21 17:13:43 -07:00
Karl Stolley 2a8f14e40a icons: Add icon-independent .message-actions-menu-button class.
Behavior shouldn't depend on the specific names of icon classes.
2023-08-21 17:13:43 -07:00
Karl Stolley 735a42d037 icons: Reference new icons from templates and JS. 2023-08-21 17:13:43 -07:00
Karl Stolley bf7cdc8f7a icons: Add new custom icons for message hover buttons.
Files are those posted with #25903.
2023-08-21 17:13:43 -07:00
Karl Stolley 058d21c4e2 css: Rename .message_table to .message-list. 2023-08-21 15:17:45 -07:00
Karl Stolley c741c43800 css: Rename .focused_table to .focused-message-list. 2023-08-21 15:17:45 -07:00
Karl Stolley e68af8a48d css: Rename .message_list to .message-feed. 2023-08-21 15:17:45 -07:00
evykassirer 37ce223b91 drafts: Use stream_id instead of stream names.
This should cause no functional changes.

This is part of a multi-step effort to move away
from using stream names to reference streams, now
that it's impossible for a user to write a message
with an invalid stream name (since switching to
the dropdown).
2023-08-21 15:10:17 -07:00
evykassirer 846b470b99 messages: Use stream_id instead of stream name.
This should cause no functional changes.

This is part of a multi-step effort to move away
from using stream names to reference streams, now
that it's impossible for a user to write a message
with an invalid stream name (since switching to
the dropdown).
2023-08-21 15:10:17 -07:00
evykassirer 45af8a9406 stream_data: Get is_invite_only by stream_id instead of name. 2023-08-21 15:10:17 -07:00
evykassirer 8e33b7a3a7 recent topics: Use stream_name instead of stream for clarity. 2023-08-21 15:10:17 -07:00
Sahil Batra 882663394a settings: Reduce width of "Actions" column in tables.
This commit reduces the width of "Actions" column in tables so
that they do not take any unnecessary space.
2023-08-21 15:00:39 -07:00
Sahil Batra 75126c96a4 settings: Make custom profile fields table similar to other tables.
This commit updates the admin custom profile fields table to be
similar to other tables in settings page. After this change,
the table will be horizontally scrollable for narrow screens
and the buttons in actions column will not wrap to multiple lines.

This increases the width of "Actions" column and it takes some
unnecessary space, but this will be handled in the next commit
which will adjust "Actions" column in all the tables.
2023-08-21 15:00:39 -07:00
Sahil Batra ebdd63f327 settings: Fix heading borders for striped tables.
The bottom border of heading row in striped (and not bordered)
tables was thicker than needed due to two borders being present -
one from the bottom border for heading element and one from top
border for the first row in the table.

This commit changes the CSS to remove the top border of the first
row.
2023-08-21 15:00:39 -07:00
Sahil Batra 16bf9e7600 templates: Remove table-condensed class for <table> elements.
The table-condensed class was used by bootstrap to add padding
to the table cells. But since we want padding in cells for all
tables, we added the padding CSS to the other existing CSS for
tables while removing the bootstrap CSS for tables and
"table-condensed" is not required anymore.
2023-08-21 15:00:39 -07:00
Sahil Batra 154f4f16b5 css: Remove unnecessary CSS defined using table-condensed class.
This commit removes unnecessary CSS defined for tables using
table-condensed class.

The vertical-align property for "td" elements is not needed
since by default the vertical-align property for "td" elements
is inherited and is set to "middle".

The margin properties set for the tables in informational
overlay is also not needed since we have set the width
to 100% and setting the margin to auto does not result in
anything different.
2023-08-21 15:00:39 -07:00
Anders Kaseorg 4b87a79a7e help: Apply noscroll class on server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Anders Kaseorg 1244c066ad help: Highlight current article on the server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Anders Kaseorg 8dba4cbba6 help: Stop pretending to be a single page application.
The API and user documentation pages gain nothing from being a single
page application other than a bunch of random errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Karl Stolley 13311ef91d reactions: Present alt-code emoji like other reaction emoji. 2023-08-21 11:38:39 -07:00
Karl Stolley 65466cec44 reactions: Let emoji and count act as simple flex items.
This commit uses a `gap` property on the containing reactions
flexbox to recreate space previously set by margins.
2023-08-21 11:38:39 -07:00
Karl Stolley 69413fe887 reactions: Mirror reaction_button styles with message_reaction. 2023-08-21 11:38:39 -07:00
Karl Stolley c0c62e477c reactions: Use a flex layout for reactions. 2023-08-21 11:38:39 -07:00
Karl Stolley 34928407cf grid: Remove message content from document flow when editing.
This effectively reverts a change introduced in #26260 that used
the original message to maintain the basline grid. With more
robust control over first-row line-heights, it is now safe to
fullyl hide the message again.

This also fixes a regression where messages with images would have
additional whitespace beneath the message edit box; see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/message.20edit.20form.20height/near/1621758
2023-08-21 11:29:00 -07:00
Karl Stolley c25da457e5 grid: Allow message toggles to occupy message area. 2023-08-21 11:29:00 -07:00
Karl Stolley 72119d161b grid: Use message_time to maintain baseline group. 2023-08-21 11:29:00 -07:00
Karl Stolley ce7f5ba785 message_edit: Hide length controller when editing. 2023-08-21 11:29:00 -07:00
Daniil Fadeev d4ef28bc8d unread_count: Remove letter spacing for better horizontal alignment. 2023-08-21 11:23:35 -07:00
Aman Agrawal f7b0282a0d navbar: Hide right arrow displayed by Safari on summary elements. 2023-08-20 23:15:18 -07:00
evykassirer 76d9b1d9d0 message scroll: Check message feed visibility instead of recent topics.
This is functionally the same, but semantically more relevant.
It will also be helpful if some day in the future these two
function calls are no longer perfect opposites of each other.
2023-08-17 15:48:53 -07:00
Prakhar Pratyush f8f2af5ebe recent_topics_ui: Add support to follow topic via recent conversations.
This commit replaces the mute/unmute topic button in the recent
conversations UI with a button that allows the user to set the
visibility_policy of the topic to muted, unmuted, followed or inherit.

The button in the recent conversations UI has an icon corresponding to
the current visibility policy of the topic.

In a muted stream:
A click on the button opens a popover with 'Mute', 'Default', 'Unmute,
and 'Follow' options.

In a not muted stream:
A click on the button opens a popover with 'Mute', 'Default', and
'Follow' option. 'Unmute' option is available only when the
visibility_policy is set to 'Unmute'.

The current visibility_policy of the topic is highlighted
in the popover.

Fixes #25915.
2023-08-17 13:30:24 -07:00
Prakhar Pratyush 41697f2663 message_header: Add support to follow topic from the message header bar.
This commit replaces the mute/unmute topic button in the message
header bar with a button that allows the user to set the
visibility_policy of the topic to muted, unmuted, followed or inherit.

The button in the message header bar has an icon corresponding to the
current visibility policy of the topic.

In a muted stream:
A click on the button opens a popover with 'Mute', 'Default', 'Unmute',
and 'Follow' options.

In a not muted stream:
A click on the button opens a popover with 'Mute', 'Default', and
'Follow' options. 'Unmute' option is available only when the
visibility_policy is set to 'Unmute'.

The current visibility_policy of the topic is highlighted in the
popover.
2023-08-17 13:30:24 -07:00
Prakhar Pratyush 07186e8de1 topic_popover: Fix the 'Mute' topic icon.
Earlier, the icon was half-filled instead of being transparent.
2023-08-17 13:30:24 -07:00
Junyao Chen d8c6311e33 bot_data: Eliminate owner field.
`owner` is a legacy key in one of bot data field. We would like to
remove this field as it's not used in the codebase. `owner_id` is
the identifier to find the owner of a bot.

CZO discussion: https://chat.zulip.org/#narrow/stream/6-frontend/topic/Can.20we.20mark.20.60owner.60.20field.20in.20bot.20data.20optional.3F/near/1625968
2023-08-17 11:53:34 -07:00
Junyao Chen 983c6b74ab ts: Migrate `user_group_create_members_data.js` to TypeScript. 2023-08-17 11:38:13 -07:00
Junyao Chen 6178a245b0 ts: Migrate `stream_create_subscribers_data.js` to TypeScript.
While `user_id` from `page_params` is marked as `number | undefined`,
when fuctions in this file are called, `page_params.user_id` will
never be undefined. Verifying from all of callers of
`initialize_with_current_user`, this is because when user is able
to create and initialize a stream, this user is authenticated and
thus a `user_id` is always available. Therefore, adding an assertion
when undefined user id is detected to handle a confirmed error.
2023-08-17 11:38:13 -07:00
Junyao Chen 80d0813dea people: Narrow the return type of `get_users_from_ids` function
`get_users_from_ids` is a function that map an array of user ids to
`User` object. According to `get_by_user_id` for mapping, every
id should be mapped to a valid `User` object. Thus removed
`undefined` annotation in this commit.
2023-08-17 11:38:13 -07:00
Junyao Chen 59aa62a36f stats: Add `zod` validation to server data and misc data.
Data retrieved from the backend using `get_chart_data` is validated
in the expected form for frontend usage. Used `zod` schemas to
validate data.
2023-08-17 11:35:00 -07:00
Junyao Chen a2669d146b ts: Migrate `stats.js` to TypeScript.
Add primitive types and promise types to variables, function
parameters and return values.

Apply type conversion functions to some objects so that the type
unification afterwards will succeed, such as converting int to
string.

Add custom types that for helper methods.

Add non-null assertions for trivial statements from code base context.
2023-08-17 11:35:00 -07:00
Junyao Chen 4ff3b8f04a stats: Fix improper function parameter passing.
Second parameter (boolean) is not supported by the function definition
in the scope. Removed in this commit.

Previous commit that made this happen:
fa9d79e203
2023-08-17 11:35:00 -07:00
Junyao Chen 0815d0473b stat: Add comments specifying the compoenents that the methods refer to.
Added one line comment for each `populate_*` methods specifying the
corresponding component that the method rendering for on the webpage.
Comments make the cross-checking experience easier.
2023-08-17 11:35:00 -07:00
Junyao Chen 1e1122282a stats: Remove unsupported sort property.
According to
https://github.com/plotly/plotly.js/blob/master/src/traces/bar/attributes.js,
plotly does not have `sort` available for bar plots. This was missed in
e01f80bf93.
2023-08-17 11:35:00 -07:00
Junyao Chen 6757c5a9f8 stats: Install @types/plotly.js for type check.
This is a prep commit for typescript migration for `stats.js`,
which used a third party module `plotly.js` that doesn't come
with types.
2023-08-17 11:35:00 -07:00
Junyao Chen 640de3ad29 page_params: Add `web/src/stats/page_params.ts` for stat module
`stat.js` has its page params different from all other modules.
2023-08-17 11:35:00 -07:00
Brijmohan Siyag 4e7bf3c4fb upload: Support drag and dropping files anywhere on message viewport.
While Zulip has supported drag/drop into the compose box for some
time, if you drag/drop the file onto other parts of the message
viewport, it would just do the default browswer behavior of replacing
the Zulip app with that file opened in a new tab, which nobody wants.

The inline comments document the set of rules for how we choose
whether to drop the upload into the compose box or an edit widget, and
also how to open the compose box in different situations.

Fixes #14579.
2023-08-16 17:06:45 -07:00
Sahil Batra 1b9fb037a1 settings: Update confirmation modal shown when reactivating a bot.
If the owner of the bot is deactivated while reactivating the bot,
we mention in the reactivation modal that the bot owner will be
changed and the bot may be unsubscribed from some private streams.
2023-08-16 15:37:37 -07:00
Lalit Kumar Singh 38250ccb83 ts: Migrate `presence.js` module to typescript. 2023-08-16 11:46:40 -07:00
Aman Agrawal 0988751d6c widgets: Remove box-shadow and use background-color to show focus.
The box-shadows cuts off on left and overlaps with button on right.
We instead change background-color in dark theme and border color in
white theme to show focus.
2023-08-16 10:06:40 -07:00
Aman Agrawal 8c4efb4f2e css: Rename variable name.
This will be used in other widgets too.
2023-08-16 10:06:40 -07:00
Aman Agrawal eda91378ec portico_signin: Fix back to login button alignment. 2023-08-16 10:05:15 -07:00
Satyam Bansal eefa124351 dialog_widget: Add horizontal padding to the modal content.
Previously, the modal content bottom border sometimes got hidden
due to subpixel rounding.
2023-08-16 10:38:42 -05:00
Tim Abbott 0e2bce3bcb recent_topics: Move is_in_focus to UI module.
This better fits how this function is used, and cuts unnecessary
dependencies from recent_topics_util.js.
2023-08-15 18:17:02 -07:00
Kunal Sharma c3173b979e docs: Avoid exceptions in scrollToHash() in Safari.
In Safari (and Google's crawler), this would throw an exception trying
to create a jquery element for certain unusual hashes like
`#:~:text=something`.

Fixes #26249.
2023-08-15 17:59:56 -07:00
Junyao Chen 446aea41b3 ts: Migrate `settings_ui.js` to TypeScript. 2023-08-15 17:17:40 -07:00
Karl Stolley ac7cf01cfa alerts: Show Copied! Tippy alert in About Zulip modal.
Fixes #23210.
2023-08-15 12:20:35 -07:00
Karl Stolley d73ae26e4b alerts: Remove unused .alert-msg elements. 2023-08-15 12:20:35 -07:00
Karl Stolley 0c9aec24fd alerts: Show Copied! Tippy alerts in message area.
This commit properly displays Tippy Copied! alerts in two cases:

1) On the clipboard icon when copying message source.
2) On the hover controls when copying the link to a message.

Fixes #21036.
2023-08-15 12:20:35 -07:00
Karl Stolley b75b53d465 tippy: Add callback, timeout args to copied confirmation. 2023-08-15 12:20:35 -07:00
Joelute 2b9e36ab48 navbar_alerts: Update text on "Complete your organization profile" banner.
Previously, the reason to complete the organization profile on the banner
wasn't clear and at times confusing. With the updated wording, it clears
up the confusion and improves the explaination of "why" as well.

Fixes: #24122.
2023-08-15 10:46:33 -07:00
Joelute eb78264162 navbar_alerts: Delay showing "Complete the organization profile" banner.
Currently, we are displaying the "Complete the organization profile"
banner immediately after the organization was created. It's important to
strongly encourage orgs to configure their profile, so we should delay
showing the banner if the profile has not been configured after 15 days.
Thus also allows the users to check out Zulip and see how it works before
configuring the organization settings.

Fixes: #24122.
2023-08-15 10:46:33 -07:00
Zixuan James Li 255e382750 linkifiers: Disable dragging when a filter is applied.
Dragging while a filter is applied can be confusing because the
reordering request won't succeed if the complete list of linkifiers is
not provided.
2023-08-15 10:21:22 -07:00
Zixuan James Li b8a770d9c6 list_widget: Pass filter_value to modifier.
The information can be useful when we want to determine if a filter
has been applied.
2023-08-15 10:21:22 -07:00
Prakhar Pratyush 71244f4a94 topic_popover: Add a 'Default' option and Show 'Unmute' conditionally.
The 'Unmute' option is available in not-muted streams only when
it is the current value.

Add a 'Default' option. Available in both muted and not-muted
streams. 'Default' corresponds to the 'INHERIT' visibility policy.

Summary:
* In muted streams:
  Four options: Mute, Default, Unmute, and Follow.

* In not-muted streams:
  Three options: Mute, Default, and Follow.
  The fourth option, 'Unmute' is available only when it is the
  current value.

Reason for conditional availability of 'Unmute' option:
In a not-muted stream, 'Unmute' has no special significance.
We only show 'Default' because both 'Default' and 'Unmute' has the
same behaviour in the not-muted stream.

This avoids the big design downside of showing this fourth
nearly-identical option to users who are just in the normal
default state of a normal topic within a normal stream

We only show the 'Unmute' option in the not-muted stream to users.
if they have followed a sequence of steps that led them to
'Unmute' state in a not-muted stream. 
For example:
Mute a stream > Unmute a topic > Unmute the stream

By doing so, we avoid destroying information. The user, when
mutes the stream again, the topic will retain the 'Unmute' state.

New icons for Mute, Default, Unmute, and Follow.
2023-08-15 10:02:03 -07:00
Prakhar Pratyush 87bd7b0b7d topic_popover: Update 'data-tippy-content' and 'aria-label'.
Update the 'data-tippy-content' and 'aria-label' from
* 'Mute topic' to 'Mute'
* 'Unmute topic' to 'Unmute'
* 'Follow topic' to 'Follow'
in the left-sidebar topic-popover UI to toggle visibility policies.

As we plan to add a 'Default' option, 'Default topic' doesn't sound
good (if we stay consistent with the earlier texts).

Instead, 'Mute', 'Default', 'Unmute', and 'Follow' sound good, and
it is obvious that we are performing action on the topic itself
(as it is a topic popover). There is no need to add an extra 'topic'
keyword.
2023-08-15 10:02:03 -07:00
Lalit Kumar Singh a0cb034731 ts: Migrate `spectators.js` to typescript. 2023-08-15 09:58:17 -07:00
Lalit Kumar Singh cd16176c10 ts: Migrate `browser_history.js` module to TypeScript. 2023-08-15 09:58:17 -07:00
Lalit Kumar Singh 9b01872e8c ts: Migrate `hash_util.js` module to TypeScript. 2023-08-15 09:58:17 -07:00
Lalit b2400d2688 stream_data: Refactor `create_sub_from_server_data` function.
We should just accept `subscribed` and `previously_subscribed` fields as
arguments to this function to avoid adding them on the `attrs` object
itself to simplify the type for `ApiGenericStreamSubscription`.
2023-08-14 16:10:16 -07:00
Lalit Singh 64f59d8daf stream_data: Consistent return values for is_* family of functions.
We should always return `boolean` type instead of `boolean | undefined`
type for functions `is_subscribed_by_name`, `is_subscribed`,
`is_web_public` to stay consistent with other similar functions which
have the type of `boolean` like `is_invite_only_by_stream_name` and
`is_web_public_by_stream_name`.
2023-08-14 16:10:16 -07:00
Lalit 69cdf6cf2f ts: Migrate `stream_data` to typescript. 2023-08-14 16:10:11 -07:00
Lalit Singh 5d109fc670 stream_data: Use `Map` instead of `FoldDict` for `BinaryDict` class.
After commit e52a3bc662, `BinaryDict`
class currently only deals with numeric stream ids so there is no
benefit to use case-insensitive `FoldDict` here anymore.
2023-08-14 16:08:25 -07:00
Lalit Singh dcbf62f492 babel: Include "transform-optional-chaining" in presets.
We need to include this "transform-optional-chaining" for babel presets
to prevent an error related to optional chaining syntax when we convert
this module to typescript. This error is a bug which is present in the
unmaintained `babel-plugin-rewire-ts` plugin.
2023-08-14 16:07:16 -07:00
Lalit 980c74e8da sub_store: Add seperate types for api stream objects.
I refined types for Subscription objects and Stream objects which were
already present `sub_store`. I took reference for the types from the
`zerver/lib/types.py` file.
2023-08-14 16:07:16 -07:00
Lalit c3292660d6 stream_data: Refactor `sub` objects when creating subs in stream data.
This commit refactors the `sub` object we were creating in
`create_sub_from_server_data` function, there were some fields which
didn't need to have a default set like `name`, `description` etc. so we
can remove those fields from here.

Also I set the color field in the object field itself to avoid making an
incomplete type object with not having `color` propertie initially.
2023-08-14 16:07:15 -07:00
Lalit 5dc599e07c stream_data: Make new object instead of modifying `sub`.
We should make a new object called `attrs` instead of adding new fields
directly to `sub` in `populate_subscriptions` method because these
additional properties which are being added does not staisfy the type
definition for the data we are getting from the server.

Because of this when we will type this function we will get type errors
saying that these additional field does not exist. So we should make a
seperate object with the correct types.
2023-08-14 16:07:15 -07:00
Junyao Chen 7140149373 ts: Migrate `bot_data.js` to TypeScript.
Add type annotations. Create custom types for Bot and Service.
Add zod data validation for incoming bot data from server.
Based on `zerver/openapi/zulip.yaml` description, `add` operation
(`op`) carries data that follows `Bot` structure. So taking
reference from `bot` structure, I create `ServerAddBotData` zod
schema and infer its type. Similarly, `update` operation carries
data that follows `BasicBot`, so I create `ServerUpdateBotData`.
Note that `Bot` inherits from `BasicBot`.

`zerver/openapi/zulip.yaml` describes that `services` in `BasicBot`
can be one of two objects, one with `{base_url, token, interface}`,
another with `{service_name, config_data}`. Therefore, I create
two corresponding schema and infer their types.

Fix two test cases `bot_data.test.js` and `settings_bots.test.js`
whose synthetic objects should have had followed the schema.
2023-08-14 16:06:15 -07:00
Junyao Chen 208438634c ts: Convert `signup.js` to TypeScript.
Added type annotations for function parameters and return values.
Added non-null assertions or type narrowing to some variables to
enforce type safety.
In `global.d.ts`, I added a namespace `JQueryValidation` which is
neccessary for type annotations inovolved in `jquery-validation`
plugin.
2023-08-14 16:00:20 -07:00
Junyao Chen 113a791532 signup: Use `querySelector` instead of accessing document property.
Previous line written in that way assumes `email_form` will appear
in the `document`. A modernly standard way is to use `querySelector`
selecting by id. Another advantage is easy for enforcing typecheck.

The commit related to this line of change is linked below:
9cb682cada
2023-08-14 16:00:20 -07:00
Junyao Chen c008ba1172 common: Fix parameter type of `autofocus` function.
Throughout the codebase there is currently one usage of `autofocus`
excepts in test files. The only one usage is in `signup.js` and was
supposed to pass a `JQuery` selector to `autofocus` rather than a
string. Passing a selector is more convenient in this case: The
selector accessed in `signup.js` is ready to `trigger` the `focus`
function, while getting a attirubte string from the selector and then
passing to `autofocus` and then accessing the selector by attribute
cost extra layers of work. Therefore writing this commit to simplify
the type for easy usage.

Fixes the test case(s) accordingly.
2023-08-14 16:00:20 -07:00
Zixuan James Li 5301060954 linkifiers: Support dragging and reordering linkifiers.
This also removes sorting on the pattern and the URL template, because
it does not make sense anymore as we make linkifiers draggable.

Fixes #23716
2023-08-14 15:21:48 -07:00
Zixuan James Li 31b7003d61 settings: Rename movable-profile-field-row.
So that we can reuse it for other movable rows in places like
.admin_linkifiers_table.
2023-08-14 15:21:48 -07:00
Zixuan James Li 112a6e445e linkifiers: Support multiple linkifiers in puppeteer tests.
Select the linkifier with `:nth-child` assuming the possibility of other
linkifiers in the realm. This prepares for a later change that requires
us to populate the test database with linkifiers.
2023-08-14 15:21:48 -07:00
David Rosa d205850d54 docs: Update .html links pointing to "Upgrade Zulip" or "Modify Zulip".
Follow-up to #24089.
2023-08-11 16:49:32 -07:00
evykassirer 4c2995c613 stream settings: Warn users before locking them out of a stream.
Organization owners can make streams private even if they're not
subscribed to them, but cannot access private streams they're not
subscribed to. This means they're able to lock themself out of streams.

This change warns users of this and give them a chance to subscribe.

Fixes #26437.
2023-08-11 16:46:41 -07:00
Satyam Bansal fe39f28497 drafts: Rename class name to provide more context. 2023-08-11 15:54:17 -07:00
Satyam Bansal ee0d45d13c drafts: Increase tippy delay for "Delete Drafts" icon.
Previously, the tippy delay was too short, resulting in
the tippy being flashed for an instant, which could lead
to confusion for the users.
2023-08-11 15:54:17 -07:00
Julia Bichler fed866449d drafts: Add functionality to bulk delete drafts.
Fixes #19360.

Co-authored-by: Satyam Bansal <sbansal1999@gmail.com>
2023-08-11 15:54:17 -07:00
Satyam Bansal e4048de0a9 app_components: Convert "overlay_message_controls" div to flexbox.
Previously, the icons were spaced by hardcoded values of margins
and would require changes everytime a new icon is added.
2023-08-11 15:54:17 -07:00
Satyam Bansal b4be3f6266 drafts: Remove unused CSS styles. 2023-08-11 15:54:17 -07:00
Satyam Bansal 0f0c52e096 drafts: Remove classes that had the same effect.
In commit 5edc8fc, abstract classes were added to the
drafts overlay, but the classes that were already there
were not removed. This resulted in the same styles being
applied twice.
2023-08-11 15:54:17 -07:00