Commit Graph

1980 Commits

Author SHA1 Message Date
Karl Stolley 35e4be0b68 message_grid: Properly align elements in media-only messages. 2023-10-02 09:20:10 -07:00
Ryan Song 6a9aa54406 node tests: Add test for popover_menu_data.js. 2023-10-02 09:17:39 -07:00
palashb01 2ca1c0c63e settings: Decrease the gap between the account heading and banner.
This commit fixes the alignment of account-alert-notification-banner
by using a new classname 'account-alert-notification' for this specific
banner, removed the default margin-top and margin-left from this banner
which is set to all other banners, and Aligned the banner with
vertical-align property set to middle.

To left-align this specific banner when the email is long enough
to wrap to the next line removed the margin-left and used a new
classname 'account-settings-heading' for the accounts heading,
and gave a margin-right of 10px to ensure that the notice banner and
the heading have enough space between them, when the email is short.

If the email is long enough to wrap to multiple lines, then the gap
between the email input field and the banner is too low. To adjust
this, set the margin-bottom to 10px.
2023-10-01 17:54:22 -07:00
palashb01 89970eabeb settings: Wrap the content in the alert notification banner.
This commit fixes the issue where, if the content inside the alert
notification banner is long enough, it will wrap inside the alert
banner.

To prevent the email from spilling over in the notice,added the
'overflow-wrap' property set to 'anywhere'.

Fixes: #23653
2023-10-01 17:54:22 -07:00
Tim Abbott 4143dac95e muted_users_ui: Move functions to more appropriate modules. 2023-10-01 16:55:21 -07:00
Tim Abbott 9283da57f0 hash_util: Extract hash_parser.ts.
This allows these functions to be used by modules that need this code
and cannot import people.ts without creating import cycles.
2023-10-01 16:55:21 -07:00
Tim Abbott 1aea88fac1 spectators: Move build_login_link out of hash_util.ts. 2023-10-01 16:55:21 -07:00
Prakhar Pratyush 247d4626a0 recent_view: Show 'followed topics in muted streams' in recent view.
Earlier, followed topics in muted streams were not listed in
the 'Recent conversations' table when 'Include muted' filter is
unchecked.

They should be listed as we currently list unmuted topics.
2023-10-01 09:27:11 -07:00
Prakhar Pratyush d07d436b46 recent_view: Update the stale comment mentioning the 'hidden' field.
The 'hidden' field was removed in e8cc9da.

This commit updates the stale comment.
2023-10-01 09:27:11 -07:00
Prakhar Pratyush ef16f1cb23 recent_view: Fix the muted topic being tested in spectator view.
The "test_filter_all" includes tests for muted and not muted topics,
but the 'is_spectator' field is set to 'true'.

Logically, it is incorrect because a topic can't have a
visibility policy set in spectator view.

This commit fixes the incorrect behavior and adds a separate test
for the case 'is_spectator=true'.

The issue was introduced in d0a697f.
2023-10-01 09:27:11 -07:00
Aman Agrawal 08bf7efeb8 inbox: Don't set focus to inbox search by default.
Set focus inbox list, focus on search if list is empty.
2023-09-29 14:34:56 -07:00
Aman Agrawal c5f8a72631 inbox: Rename set_default_focus. 2023-09-29 14:34:56 -07:00
Aman Agrawal 0ad47b5d09 inbox: Focus on entire row instead of stream name on `show`. 2023-09-29 14:34:56 -07:00
Aman Agrawal c471e82e37 inbox: Make set_list_focus readable.
No change in behaviour.
2023-09-29 14:34:56 -07:00
Aman Agrawal d7451ac456 inbox: Fix left arrow navigating to unread count for inbox-row.
If you focus on inbox-header name by right arrow then down and then
left, it will focus on unread count instead of ellipsis icon.

Hard to explain how this fixes the bug here, next commit adds
explanatory comments to the function.
2023-09-29 14:34:56 -07:00
Aman Agrawal e79f5e11bd inbox: Use a variable to track left and right navigation keys. 2023-09-29 14:34:56 -07:00
Tim Abbott 1a15e07bf4 user_group_popover: Fix buggy user sort order.
This was caused by a typo and would have been naturally fixed when
moving this file to typescript.

Fixes #25963.
2023-09-29 13:04:22 -07:00
Aman Agrawal d574129a29 user_profile: Move init call to ui_init. 2023-09-29 11:59:51 -07:00
Aman Agrawal bdd991dc67 stream_popover: Move init call to ui_init. 2023-09-29 11:59:51 -07:00
Aman Agrawal 4243347db7 sidebar_ui: Move some related event handlers here. 2023-09-29 11:59:51 -07:00
Aman Agrawal 4d4a747b91 flatpickr: Fix misspelled variable name. 2023-09-29 11:59:51 -07:00
Aman Agrawal 2b8784935f popovers: Separate out sidebar visibility check from any_active.
We check popovers.any_active and visibility of popovers separately
since sidebars are not actually popovers.
2023-09-29 11:59:51 -07:00
Hardik Dharmani c12d249627 message_list_hover: Fix hover edit button visibility on new messages.
This commit resolves an issue where the edit button was not visible
during message hover for new messages. The problem occurred when a
message was sent after the hover event, resulting in the hovered
message being a local copy with the `locally_echoed` attribute set
to true. This caused the `is_message_editable_ignoring_permissions`
function to return false, subsequently causing `is_content_editable`
to return false as well. As a result, the `is_content_editable`
argument was false, leading to the edit button not being displayed.

The issue was caused due `$current_message_hover` being set to the
locally echoed version of `$message_row`. When the message was
successfully sent and the message was rerendered, the `message_hover`
function was called again on the properly sent message row.

However, the conditional check `($current_message_hover &&
rows.id($current_message_hover) === id)` returned true because
`$current_message_hover`, set to the locally echoed version, had the
same ID as the actual `$message_row`. Consequently, this condition
returned true at the start of the `message_hover` function,
preventing further execution of message_hover function and,
consequently, the updating of hover buttons.

To address this, an `else if` condition was introduced to check if
the message is locally echoed. If true, the function is terminated
to prevent `$current_message_hover` from being set to the locally
echoed version of `$message_row` until the message is sent correctly.

Once the message is sent correctly, the `message_hover` function is
executed again, setting `$current_message_row` to the properly sent
version of `$message_row`, and resulting in updating of hover buttons.

Fixes #25312
2023-09-28 18:07:26 -07:00
Hardik Dharmani bae28dfe64 message_list_hover: Extract module for hover/unhover logic.
Remove the various message-hover related functions from ui_init.js and
put them in a new module.
2023-09-28 18:07:26 -07:00
Karl Stolley ec8e6c2179 compose_banners: Explicitly target banner content, child p.
This ensures uniform display and flexing of different bits of
banner content, including:

* Banners like Sent! Scroll down to view...) that have only a
  classless `<p>` marking their content
* Banners like the unscheduled message allert, which puts a
  .banner_content class right on the paragraph
* Banners like the Your message was sent to a stream you have
  muted", which tuck a `<p>` into a div with the .banner_content
  class
2023-09-28 17:06:49 -07:00
N-Shar-ma 7ef3ce9e8b todo_widget: Use colon `:` as task and description display separator.
Uptil now, a dash `-` was used to separate the task from its (optional)
description. But a colon `:` was used in the `/todo` command syntax to
indicate where the task ends and it's description starts.

To make the separator symbol consistent for both the syntax and widget,
`:` is used for both. It was chosen over `-` as `:` is encountered less
often in normal language, and so accidental usage of it when using the
`/todo` command syntax is less likely. It is also is impossible to
confuse with the bullet list syntax which is allowed for tasks.
2023-09-28 16:03:03 -07:00
N-Shar-ma e537195a85 todo_widget: Do not sort alphabetically and by status of completion.
Earlier the tasks in a list were sorted alphabetically and on marking
one complete, it was pushed under any incomplete tasks. This behaviour
can be unexpected and confusing, so now each task is appended to the
bottom of the list on being added, and no shifting takes place on
marking it completed.

Fixes part of #20213.
2023-09-28 15:53:13 -07:00
Tim Abbott 925077c036 user_card_popover: Fix incorrect import after rebase.
4ee515a245 was rebased past this
function moving modules.
2023-09-28 15:34:03 -07:00
Hardik Dharmani 7721100378 bot_settings: Use same copy icon across the app.
The bot settings avatar row was using `fa-clipboard` icon. Changed
the icon to use `{{> copy_to_clipboard_svg }}` SVG icon that is used
everywhere else in the app as copy icon.
2023-09-28 15:15:57 -07:00
Hardik Dharmani 4ee515a245 user_profile_modal: Abbrevate long URLs of custom fields.
Abbreviated long URL for custom field in the user profile modal
and user card popover. Added a copy-to-clipboard icon at
the end of the URL. When hovering over the copy button, it displays
a tippy tooltip with the text `Copy URL`. Clicking the copy button
displays a `Copied` tippy tooltip for 1 second.

Fixes #21680
2023-09-28 15:15:57 -07:00
Hardik Dharmani f27adec02d refactor: Rename `custom_profile_fields_link` to use kebab-case.
This is a prep commit. This commit renames
`custom_profile_fields_link` to `custom-profile-fields-link`
to follow kebab-case, which is the preferred style in Zulip.
2023-09-28 15:15:57 -07:00
N-Shar-ma 57c0b597f5 typeahead: Allow automatic insertion/removal of bulleting/numbering.
When the user is typing a numbered / bulleted list in the compose box,
on pressing Enter the list syntax will be inserted automatically on
a new line, and removed if Enter is pressed after an empty line.

Fixes: #20305.
2023-09-28 15:05:34 -07:00
N-Shar-ma 836363b0f5 compose: Add button to format numbered lists.
A formatting button below the compose box can format the selected text
by numbering or unnumbering the selected (partially or completely)
lines. The behaviour is inspired by GitHub's bulleted list formatting.

Fixes part of: #20305.
2023-09-28 15:05:34 -07:00
N-Shar-ma 3c0a6d8ee3 compose: Add button to format bulleted lists.
A formatting button below the compose box can format the selected text
by bulleting or unbulleting the selected (partially or completely)
lines. The behaviour is inspired by how GitHub's bullet list format
button works.

Also adds a new breakpoint for showing vdots for formatting buttons.

Fixes part of: #20305.
2023-09-28 15:05:34 -07:00
Aman Agrawal 9232a45fc2 inbox: Move focused row to visible area on scroll.
This will also work for page up/down naturally.
2023-09-28 14:23:42 -07:00
Aman Agrawal d79a51b3f2 inbox: Extract is_element_visible. 2023-09-28 14:23:42 -07:00
Aman Agrawal 6f6e83d2e2 message: Remove ineffective `auto-select` class.
The internal design here was that we had no-select on the outer
element and auto-select on these inner elements to override it.

But, `auto-select` class seems to have no effect so we are
removing it.
2023-09-28 14:26:21 -05:00
Aman Agrawal 1d697c344b message_avatar: Don't allow direct selection.
Use can no longer copy the avatar directly unless starting from
somewhere outside the `recipient_row` like date divider.
2023-09-28 14:26:21 -05:00
Aman Agrawal 3838561b05 message_body: Allow sender name to be selected.
This also blocked /me messages from being selected.
2023-09-28 14:26:21 -05:00
Aman Agrawal e7a3a44e35 util: Implement is_valid_url more correctly, with tests. 2023-09-28 12:22:44 -07:00
Aman Agrawal 7b252572b0 navbar: Stop restricting max-width of org name at 1170px window width.
This was unnecessary as tested manually.
2023-09-28 09:51:47 -07:00
Aman Agrawal 29c8f6bd06 navbar: Darken navbar on hover.
This improves the contrast between navbar text and background.
2023-09-28 09:51:47 -07:00
Karl Stolley 938b4f012a left_sidebar: Limit privacy icon styles to streams list.
This fixes a regression introduced in #26807, where a padding
adjustment spilled over to the privacy icon display in message
headers.

This fix should prevent future spillover by isolating left-sidebar
stream icon styles to just the streams list.
2023-09-28 09:36:44 -07:00
Hardik Dharmani 71b915e09d unread: Fix logic for wildcard mentions in direct messages.
Wildcard mentions in direct messages were not being count as mentions
due to incorrect calculation of `is_unmuted_mention` variable in
`update_message_for_mention()` function in `unread.js`. Fixed this by
correcting the calculation of `is_unmuted_mention`.
2023-09-28 09:35:30 -07:00
Aman Agrawal f7b633f511 settings_org: Move is_valid_url to util. 2023-09-28 09:13:51 -07:00
Aman Agrawal de2b1adfe6 markdown: Combine regexes. 2023-09-28 09:13:29 -07:00
Aman Agrawal 08d1290912 popovers: Remove unnecessary removal of popover classes.
has_popover is not used anywhere.
has_emoji_popover is not used anywhere.
has_actions_popover is handled by actions popover itself.
2023-09-28 08:45:43 -07:00
Aman Agrawal ddb0d8d298 flatpickr: Use flatpickr instance instead of has_popover to track it. 2023-09-28 08:45:43 -07:00
Aman Agrawal b065cfa0c1 stream_popover: Move left sidebar function to sidebar_ui. 2023-09-28 08:41:03 -07:00
Aman Agrawal 820b564072 right_sidebar_ui: Rename to sidebar_ui. 2023-09-28 08:41:03 -07:00
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