Commit Graph

14882 Commits

Author SHA1 Message Date
Zixuan James Li 53aa3f6c71 typeahead: Add typescript type definitions for typeahead.
This allows us to import typeahead from people.ts with types. This is
possible since #22586 was merged.

And since "sort_emojis" is always supposed to be called with valid emoji
objects that have "reaction_type" with an optional "emoji_code", we add
a check before we see if the emoji is popular to avoid poking
popular_set with an undefined value.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
Zixuan James Li 9808bdf1d3 typeahead: Ensure presence of is_realm_emoji.
The implementation of the emoji sorter relies on the presence of the
"is_realm_emoji" property. We want to be consistent with this
assumption.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
Zixuan James Li 6e9079f876 typeahead: Remove is_unicode_emoji.
This avoids the type narrowing problem when we call "is_unicode_emoji"
on an emoji object and access "emoji.emoji_code", which might be
"undefined".

In places where these helpers are accessed, we expect that
"reaction_type" is always present so that we can later correctly type
narrow Emoji into UnicodeEmoji. This updates the test cases to
respect that.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
Zixuan James Li 45fdfcd6d4 typeahead: Remove default value for triage.
"get_item"'s default value is not type-safe as we require its return
value to always be a "string". Note that since the mobile app does not
rely on this function directly, it is sufficient to only refactor the web
app for this transition.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-02-09 16:51:40 -08:00
evykassirer d91d3146ce compose banners: Lighten banner text in dark mode. 2023-02-09 15:45:10 -08:00
Anders Kaseorg 7eb2cffcb4 templates: Update comments referencing Mustache to Handlebars.
(We switched to Handlebars very early in commit
4793cee888431b41f0aaf5341e2d8c77a155e8b8.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-09 14:12:54 -08:00
Sahil Singh 4c4491cdcf design: Remove misaligned loading text on smaller devices.
The loading message that occurs at the top of the narrow when first
loading the Zulip app (posted to the right of the centered Z spinner)
looked misaligned on smaller screen devices.

We fix this by just removing the 'Loading...' message, since the text
was unnecessary to communicate the idea that we're loading content.

(The text was also missing translation tags).
2023-02-09 10:13:19 -08:00
Aman Agrawal 7dacbc934f recipient_bar: Add box shadow at top.
We add a box shadow at top of the recipient bar to hide message
text that are partially visible above the recipient bar. At 100%
zoom, this issue is not visible but it has been reported by a user
at 150% zoom.

Following this change we don't need to do change any of our JS
calculations since `y` position of header remains the same
and when determining if a header `is_sticky` that is the only
thing we verify.
2023-02-09 10:05:42 -08:00
Anders Kaseorg 9efbfa22f2 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-08 17:05:58 -08:00
Tim Abbott b9fc5da350 tooltips: Fix hotkey-hint CSS class reuse.
The "hotkey-hint" class name used internally in
d66f2d900f conflicted with the
preexisting class name for hotkey hints into popovers, introduced in
80ff3d8da5.

Given that the new class is for a styling of hotkey hints designed for
use in tooltips, it was a bad name anyway, so just rename it to
tooltip-hotkey-hint. We rename the related cluster of variable names
to match this.
2023-02-08 13:13:35 -08:00
N-Shar-ma d2ea65da10 compose: Clean code to fix `up` hotkey to edit previous message.
This is a follow up to 875ad8e implementing a better approach. We call
`cursor_at_start_of_whitespace_in_compose` from `focus_in_empty_compose`
itself if and when needed.
2023-02-08 12:51:38 -08:00
Sahil Batra 34fa712220 settings: Clarify message-delete-time-limit setting rule.
This commit adds note to the message-delete-time-limit
setting label that the time limit does not apply to
administrators.
2023-02-08 12:46:05 -08:00
Sahil Batra 2fcaf88305 message_edit: Add code to live-update inline-topic edit icon.
This commit adds code to live-update the inline-topic edit
icon on changing move_messages_within_stream_limit_seconds
or edit_topic_policy. We simply rerender the message list
as it becomes difficult to check for each recipient row
and update it because topic edit permission depends on
when the message was sent.

This also live-updates the resolve topic icon as it depends
on topic edit permission only.
2023-02-08 12:46:05 -08:00
Sahil Batra 2eb204f699 settings: Add move_messages_between_streams_limit_seconds element in UI.
This commit adds dropdown for move_messages_between_streams_limit_seconds
setting which is used to control for how long the user is allowed to
edit stream.
2023-02-08 12:46:05 -08:00
Sahil Batra 4378b1639d settings: Add move_messages_within_stream_limit_seconds element in UI.
This commit adds dropdown for move_messages_within_stream_limit_seconds
setting which is used to control for how long the user is allowed to
edit topic.
2023-02-08 12:46:05 -08:00
Sahil Batra 03df1c16f1 message_edit: Use move_messages_between_streams_limit_seconds in webapp.
This commit adds code to check time limit as per recently added
move_messages_between_streams_limit_seconds setting when moving
messages between streams in webapp. There is no time limit for
admins and moderators.

We add a new function "is_stream_editable" (similar to already
existing is_topic_editable function) to check whether user is
allowed to move message between streams.
2023-02-08 12:46:05 -08:00
Sahil Batra d514f2455f message_edit: Use move_messages_within_stream_limit_seconds in webapp.
We now use realm_move_messages_within_stream_limit_seconds setting in
webapp to check topic edit permission replacing the 3-day limit.
As was the case previously, there is no limit for admins and
moderators.
2023-02-08 12:46:05 -08:00
Sahil Batra ebafe541dc settings: Add live-update code for move_messages_between_streams_policy.
This commit adds code to update move_messages_between_streams_policy
in page_params dict and also call sync_realm_settings which updates
the setting element in UI.
2023-02-08 10:59:28 -08:00
Aman Agrawal 4dfe3d36e0 floating_recipient_bar: Replace with sticky header. 2023-02-07 16:25:39 -08:00
Aman Agrawal 00be770d38 css: Use variables for changed header height in smaller widths.
In addition to the benefit of using variables, this change makes
it more noticeable that the header has a different height on smaller
widths.
2023-02-07 16:25:39 -08:00
Aman Agrawal b7ea924876 css: Combine box-shadows for selected message.
There are no visual changes since we are replacing 4 single borders
with a single box.
2023-02-07 16:25:39 -08:00
Aman Agrawal 2be3cbc00e message_list_view: Remove wrong `$` prefix in message_viewport variable.
Since `message_viewport` library is not jQuery object, it should
not have `$` prefix before it.
2023-02-07 16:25:39 -08:00
Pranav2612000 c58f38dae3 compose: Show resolve topic banner only once per narrow.
Previously, when sending a message to a resolved topic, if you disissed
the 'You are sending a message to a resolved topic' banner, it would
reappear as soon as the user enters another character.

Fix this by showing the banner at most once per narrow. It does not
reappear if the user closes the banner and continues typing.  It will
only be shown again if the user closes compose, changes stream/topic,
sends a message or otherwise clears the compose box state.

We also remove the existing check for whether this banner is already
visible; this is essentially a more precise version of the same logic.

Fixes #24245.
2023-02-07 15:53:25 -08:00
N-Shar-ma 0e55b2aed9 unread: Show unread count for only 1:1 human PMs for right sidebar icon.
Uptil now, the right sidebar user list unread count included bot and group
PMs which sometimes resulted in the confusing state of the user list icon
indicating unread messages but on expanding the user list, no username
had a counter beside it, since the list only has individual human users.

Now this right sidebar unread count too excludes bots and groups, so the
unread count and the user list are consistent, without any ghost counts.
2023-02-07 15:38:32 -08:00
SameepAher 8efa3965fd css: Fix long name overflow in user profile modal.
Set width of the heading tag displaying user profile name heading, which
doesn't let the edit button get pushed off the user profile modal.

Ellipsis property is applied to user profile name on text overflow.

Fixes: #23781.
2023-02-07 15:36:51 -08:00
Palash Baderia 0ca5d11670 settings: Improve column widths in settings > uploaded files.
Changed the width of the file column to show the names properly,
while making sure that the table UI remains consistent in different
languages too (checked the same for Russian language).

Drop the file size column if the viewport is less than 992px (lg_min)
to ensure that the size word doesn't break when there are no uploaded files.
Discussed on CZO thread.

Changed the position of the Date uploaded arrow to stay visible
in all view ports and added word-break to prevent spill over of Mentioned-in
and date uploaded.

Fixes: #23738
2023-02-07 15:15:40 -08:00
m-e-l-u-h-a-n 8f29f81539 user groups: Fix incorrect checking for open groups overlay.
Overlays.js incorrectly checked for whether `#groups` overlay
was open, so it re-assigned the global `open_overlay_name`
variable. As a consequence unwanted bluslip errors were thrown
when closing the groups overlay after any group event was
received while the `#groups` overlay was open.
2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n 9d6cc8142b user groups: Add support for add_member and remove member events. 2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n 1f03042a48 user groups: Add support for removing user groups.
The new `#groups` overlay had no way for user groups to be deleted.
This commit adds UI support for removing user groups along with
adding support for live update of `#groups` overlay on remove
event for user groups.
2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n c0cd6f7f04 user groups: Add support for user group update event. 2023-02-07 15:12:56 -08:00
m-e-l-u-h-a-n 6147f2bd7a user groups: Add live update support for user_group add event.
We add live update support for user group events as part of
https://github.com/zulip/zulip/issues/19526.
This however has a few TODOs:
1. Deciding on how we want to sort the group list on left of
   #groups overlay.
2. How we highlight the newly created groups after it is added
   to the list.
These will be covered as we add support for more groups events.
2023-02-07 15:12:56 -08:00
Purushottam Tiwari fdd9f018ad user groups: Add `+` button to navigate to create user group. 2023-02-07 15:12:56 -08:00
Purushottam Tiwari 637bbf638e user groups: Enable remove button for user creating the user group. 2023-02-07 15:12:56 -08:00
Purushottam Tiwari 4a91bf8f5b user groups: Add margins to user group create alert info.
Since we do not currently have live update on newly
created ui for user group management, alert shown
after successful creation of user group apeared across
full width of right panel of #groups overlay. Which
made it look a bit awkward, so we add margins to that
alert info.
2023-02-07 15:12:56 -08:00
Aman Agrawal 7a8ddf90cd css: Remove focus outline on simplebar wrapper elements.
This removes the focus outline on `simplebar-content-wrapper` in
the left sidebar and other places in the app when focused since
it doesn't look visually nice.
2023-02-07 11:06:13 -08:00
Sahil Batra db4bae8050 portico: Fix cursor set to pointer incorrectly for input elements.
This commit fixes the code which incorrectly set the cursor
property to "pointer" for input and textarea elements where
only select elements should have it. The code causing this bug
was added in d708bc338.
2023-02-07 11:05:06 -08:00
sayamsamal 059f64dcd9 tooltips: Fix tooltip content alignment for message inline images.
This commit fixes the issue where the "Click to view or download" comes
to the right of the image title. We add a parent division in this commit
that leads to the break tag being applied successfully, shifting the
secondary tooltip content ("Click to view or download") to next line.
2023-02-06 18:41:31 -08:00
sayamsamal e9d53b6bb4 tooltips: Fix line height for non-English characters.
Some non-English characters overflow when the line height is reduced
for the tooltip text. This commit increases the line height of the
tooltips to accommodate these non-English characters and fixes the
hotkey hint margins for the same.
2023-02-06 18:41:31 -08:00
sayamsamal c15c2157f7 tooltips: Set font-feature-settings to "ss01" for stylistic variant of "I".
This commit enables the stylistic set "ss01" in Source Sans 3
font family which contains stylistic variant of the upper-case
character "I", which contains two bars, one each on the top and
bottom of the letter. This provides a uniform look across all
the characters when used in the hotkey hints of the tooltips.
2023-02-06 18:41:31 -08:00
sayamsamal 9b1d4ca81e tooltips: Add italics styling to description of multi-line tooltips.
The second line of a multi-line tooltip generally desctribes the
additional information which helps the major text, i.e. the first
line of the multi-line tooltip, hence it would be a good idea to
add italics styling, to differentiate it from the main title. We
describe a simple ".italic" class for the same.

We also add a shorter line height to this description using the
".tooltip-inner-content" class.
2023-02-06 18:41:31 -08:00
sayamsamal 0f213f13ff tooltips: Add support for modifier key conversion for mac-syle keyboards.
We scan a tooltip for any required windows-to-mac hotkey conversions
from the list of attributes supplied to the hotkey_hints helper.

If we find any, we add/modify the hotkyes in the hotkey hints list to
match the mac-style key combinations and then return back the modified
list of hotkey hints to be displayed in the tooltip.

We also rename the "adjust_mac_shortcuts" function, used for the
keyboard shortcuts menu and help center documnets, to
"adjust_mac_kbd_tags" to avoid any ambiguity with the
adjust_mac_tooltip_keys funtion which is used for tooltip hotkeys.
2023-02-06 18:41:31 -08:00
sayamsamal df04063bf4 tooltips: Add hotkey hints support to filter streams in sidebar. 2023-02-06 18:41:31 -08:00
sayamsamal 78ae5e9526 tooltips: Add hotkey hints support to search people filter in sidebar. 2023-02-06 18:41:31 -08:00
sayamsamal 59bc9715e3 tooltips: Add hotkey hints support to keyboard shortcuts button.
This commits adds hotkey hints to the keyboard shortcuts button
located in the right sidebar, bellow the user list view.
2023-02-06 18:41:31 -08:00
sayamsamal 26fc108e16 tooltips: Add hotkey hints support to compose related buttons.
This commit adds the hotkey hints support to "Cancel compose",
"Cancel compose and save draft", "Scroll to bottom" and "Drafts"
button.
2023-02-06 18:41:31 -08:00
sayamsamal 4a7ad5325a tooltips: Add hotkey hints support to narrow to compose option. 2023-02-06 18:41:31 -08:00
sayamsamal fc6b4775be tooltips: Add hotkey hints support to recipient row. 2023-02-06 18:41:31 -08:00
sayamsamal 4bf16ca9cc tooltips: Add hotkey hints support to message controls. 2023-02-06 18:41:31 -08:00
sayamsamal d66f2d900f tooltips: Add hotkey hints support for tooltips.
We add the support for hotkey hints for the tippyjs tooltips through
the hotkey_hints handlebar helper.

The hotkey_hints helper takes space seperated string arguments and
returns a span containing all the hotkeys with the required classes
for styling.

We also add a simple node test for the hotkey_hints handlebar helper.

Part of #21753
2023-02-06 18:41:31 -08:00
sayamsamal 8e1d537430 tooltips: Change tooltips arrow size to small.
We scale the tippy arrows to the same size as used by the tippyjs
documentation for the small arrow size example.

Part of #21753
2023-02-06 18:41:31 -08:00
sayamsamal 7d5d151b99 tooltips: Change tooltips styling to incorporate the redesign.
We use hsla(0, 0%, 20%, 1) for the light theme background color and
hsla(0, 0%, 0%, 1) for the dark theme. The text inside the tooltips
should be white in color, 14px in size and have a line height of 15px.

With one line of text, we want the height of the tooltips to be 25px,
i.e, line height (15px) + padding (5px + 5px = 10px).

Part of #21753
2023-02-06 18:41:31 -08:00
sayamsamal a93b95f158 tooltips: Move tooltips styling to a dedicated .css file.
We want to seperate the tooltips styling into a dedicated .css file for
general readability and decluttering of the zulip.css file.
2023-02-06 18:41:31 -08:00
evykassirer 0d373e574b compose: Remove remaining instances of compose-send-status.
All banners that used to be rendered here are now in #compose_banners.
2023-02-06 16:01:51 -08:00
Ujjawal Modi 836b9e483e settings: Improve permissions banners on Invitations panel.
Fixes #24158
2023-02-06 15:04:56 -08:00
Aman Agrawal e0f9332280 recent_topics_ui: Adjust filter classes once they are displayed.
Updating filters before rendering recent conversations leads to
bugs if the filters changed or recent topics was not the first
view that was loaded.
2023-02-06 14:57:18 -08:00
Aman Agrawal a9befc207b recent_conversations: Only load filters during page load.
Instead of using localstorage to set the filters every time we
render recent topics, we only do it during initial page load and
then use the locally present `filters` variable to set the
filters.

This avoids multiple Zulip tabs of having a live impact on the
filters used in recent conversations.
2023-02-06 14:50:16 -08:00
Tim Abbott b36b04e385 user profile: Use stream_data.can_unsubscribe_others.
This is necessary to offer the "Unsubscribe" button in full user
profiles when the current user has the necessary permissions for a
given stream.

We remove settings_data.user_can_unsubscribe_other_users, since we've
changed its only caller and it is no longer a useful abstraction.
2023-02-05 14:46:36 -08:00
Sahil Batra 89f39a8aed stream: Add UI to set can_remove_subscribers_group when creating stream.
This commit adds dropdown-list-widget element in create stream UI
to set can_remove_subscribers_group setting when creating stream.
For now only role-based system groups are shown as options.
2023-02-05 14:46:36 -08:00
Sahil Batra 255dc759b1 stream_settings: Add live update code for can-remove-subscribers-group.
This commit adds code to live update the UI element for
can_remove_subscribers_group setting.
2023-02-05 14:46:36 -08:00
Sahil Batra b9801073bd stream_settings: Add UI element for can-remove-subscribers-group setting.
This commit adds dropdown-list-widget element in "General" section of
stream settings for can-remove-subscribers-group setting. For now we
only show role-based system groups as the options.
2023-02-05 14:46:36 -08:00
Sahil Batra 37964b1ccc user_groups: Add helper functions to get options for group-based setting.
This commit adds get_realm_user_groups_for_dropdown_list_widget function
which returns the list of objects containing the display name and id
of system user groups and adds tests for this function.
2023-02-05 14:46:36 -08:00
Sahil Batra 73a378d23f stream_settings: Use can_remove_subscribers_group setting in webapp.
This commit updates the frontend to show or hide the "Unsubscribe"
button in subscribers list in stream settings as per the
can_remove_subscribers_group setting for the stream.
2023-02-05 14:46:36 -08:00
Tim Abbott 6fa0a83d6b user profile: Fix height issues with remove-subscription-button.
Previously, subscription rows with a remove-subscription-button were
much taller than those without. This will be problematic when the new
permissions setting makes it possible for the current user to have
permission to unsubscribe the target user from some streams but not
others.

Fix this by both making the button a bit less tall and setting a
minimum height for the rows. Probably a nicer CSS solution is
possible, but this is enough to unblock merging a much larger project.
2023-02-05 14:46:36 -08:00
Tim Abbott 8bd881c83f message_list: Reorder and document properties of key classes.
This should help considerably in the readability of this part of the
codebase; meanwhile, I also took the opportunity to note various TODOs
where we might have something simple we can do to simplify these data
structures or improve their interfaces.
2023-02-05 10:58:07 -08:00
Tim Abbott 0f155b597f Revert "click_handlers: Don't treat dropdown menuitem clicks the same as links."
This reverts commit 202c04988f.

See https://github.com/zulip/zulip/pull/24133#issuecomment-1416921919.
2023-02-05 10:03:38 -08:00
evykassirer 9881760796 upload: Rename upload.js get_item keys to reflect upload banner.
Previously the banner was displayed through send_status, but
that is no longer an accurate name for identifying parts of
the upload HTML.
2023-02-04 19:50:52 -08:00
evykassirer 97d355fa72 compose: Migrate upload banner to new banner styling.
Fixes #22524.

This affects both the banner in the main compose box and the banner
in the message edit compose box. The use of ProgressBar has been
replaced with a more simple CSS (with light Javascript) solution.

The classnames are changing because the upload banner is now a
template rendered and remove()-ed from a banner container
(#compose_banners in the composebox, and a new div for banners in the
message edit view). It used to be in the send_status container so
there are a lot of class renames across the codebase.
2023-02-04 19:50:52 -08:00
evykassirer b01ac3623f upload: Remove and reduce timeouts for closing upload bar.
This timeout was introduced in this commit: 02c3223985

The UI should close immediately when the user clicks cancel,
and the rest of the canceling code can run behind the scenes.

We want to keep a short timeout for upload completion
so that the user sees the 100% complete upload bar.
2023-02-04 19:50:52 -08:00
evykassirer 202c04988f click_handlers: Don't treat dropdown menuitem clicks the same as links.
This is a prep commit for adding a new dropdown for stream selection.
2023-02-04 19:08:13 -08:00
evykassirer 5f59ea0036 compose banner: Consolidate two functions that clear success banners.
Previously notifications.clear_compose_notifications was used accross
the codebase. Since introducing the new
compose_banner.clear_message_sent_banners function, the two functions
are similar enough that we can just use clear_message_sent_banners
everywhere. This commit also moves scroll_to_message_banner_message_id
to compose_banner.
2023-02-04 18:53:35 -08:00
evykassirer ea9c4682a8 compose: Migrate out-of-view-notification to new banner style. 2023-02-04 18:53:35 -08:00
evykassirer 3a264c37b5 compose: Rename message_sent_banner template variables.
This is a prep commit for redesigning this banner. The
change from `note` to `banner_text` is more consistent
with `compose_banner`. `link_class` is renamed to classname
and will be used for the banner a whole and not the link
class anymore, which is why the check for displaying a link
now looks to see if `link_text` is defined instead.
2023-02-04 18:53:35 -08:00
Joelute 2c94d2b22f popovers: Fix missing top border for avatar in user profile.
The top border on the avatar wasn't showing up since there wasn't
enough space provided. Added top margin to fix the issue.

Fixes #24210.
2023-02-04 17:44:37 -08:00
Tim Abbott 3099487bc3 stream_popover: Remove useless old_topic_name check.
This has been present since this modal was first introduced in
b9098a42d4, but as far as I can tell, it
has never been correct. We know `old_topic_name` is not
null/undefined, since we do a check with it trimmed earlier in the
function, and there is no product reason why we would would to
silently fail to move a topic because its name was the empty string.
2023-02-03 18:20:39 -08:00
Prakhar Pratyush 62437e6930 topic_edit: Fix resolve topic notification.
When 'resolve|unresolve' and 'change topic' actions occurs in
the same api call using 'topic sidebar icon', only 'topic_moved'
notification is sent.

Both 'topic moved' and 'topic resolved' notification should be generated.

Currently, 'select_stream_id' is not set to 'undefined',
even if we only change 'topic name' and/or 'resolve|unresolve' topic.
Resulting in no 'resolved_topic' notification.

This commit sets 'select_stream_id' to 'undefined' to fix the issue.
2023-02-03 18:20:39 -08:00
Prakhar Pratyush 01961b4282 stream_popover: Fix confirm button not disabled bug.
On updating the stream from the dropdown menu in the move-messages popover,
the confirm button is enabled. On changing the stream back to the initial
value, doesn't disable the confirm button. It can result in the
creation of infinite notifications.

On stream update, 'update_submit_button_disabled_state()' doesn't receive
'stream_id' as a parameter, resulting in 'undefined' stream_id,
'button.disabled' is always set to false after the first update.
2023-02-03 18:20:39 -08:00
Tim Abbott a8ce7df649 notifications: Avoid misleading href on scroll to bottom notice. 2023-02-03 15:45:06 -08:00
evykassirer dd95f79ab7 notifications: Hide out-of-view notification once user scrolls to message.
The banner telling the user to scroll down to the message previously
didn't disappear when the user scrolled past it manually, which is
not ideal.

Keep track of which message is associated with this notification,
and clear the banner when the message scrolls above the bottom of
the viewport.
2023-02-03 15:45:06 -08:00
evykassirer e789e7aa4f compose: Leave scroll-to-message banner open until explicitly closed.
Previously the message would disappear after 300ms, but it can be
annoying for a useful link to disappear so quickly like that.

This commit removes that logic. Now the banner is closed only when
the user explicitly closes it or clicks on the link.

Note that the banner doesn't go away if the user manually scrolls
down. I still think this change is overall better, but if there's
an easy way to add that as well we should do it!

Fixes part of #19857.
2023-02-03 15:45:06 -08:00
evykassirer fbad0b273b compose: Add url to 'scroll down' sent banner.
This notification ("scroll down to view your message" with a link
for the user to click to scroll down) was added in e2c388c and
removed in 657e1f1 in a commit almost immediately afterwards.

Later the notification was added again, but there was notably no
link to scroll, just the message to scroll down. 372cb20

The link to scroll down was "added" in 1a63c2d when it was fixing
a similar link in another notification. But the implementation
didn't actually use the link (because there was no classname passed
through).

This commit adds a classname so that the link is clickable by
the user.

Fixes part of #19857.
2023-02-03 15:45:06 -08:00
Sahil Singh dd85e8b4f5 settings: Fix emoji image preview with wide images.
The image preview in the 'upload_widget' would scale images that are
wider than the intended square shape for custom emoji; this resulted
in a misleading preview, because the server will instead crop such
images to take their leftmost square.

Fix this using 'object-fit: cover', to have the browser do something
similar.
2023-02-03 11:47:19 -08:00
Sahil Singh 0870ad5d14 settings: Preview bot avatar in bot editing/creation forms.
Previews of the current bot avatar and the uploaded bot avatar were not
displayed during bot creation or editing.

We address this by extending The 'upload_widget' component with with
'preview_text' and 'preview_image' parameters to provide a preview of
the image that will be used as the bot's avatar during bot creation or
editing.

Fixes #23023.
2023-02-03 11:47:19 -08:00
evykassirer aaa8b90271 compose: Increase click target area around banner close button.
Using padding instead of margin allows a wider area around
the button where the user can click from to still functionally
click the button.
2023-02-02 17:21:24 -08:00
Ganesh Pawar b7335d0dec custom_emoji: Convert inline form to modal.
Fixes part of #21298.
2023-02-02 10:59:57 -08:00
SameepAher bbf5b3d6ce popovers: Link subscribed users to user cards.
This links users or bots in Stream settings -> Subscribed users, to
their respective user profile card.

Also, changes were made to close any active overlay, on clicking any of
the PM buttons in the user profile card. This help us avoid writing
separate conditions for multiple overlays, like settings overlay or
stream settings overlay.

Fixes part of #18880.
2023-02-01 16:07:03 -08:00
N-Shar-ma db7d2169b3 left_sidebar: Space PM / topic / stream names from icons on right by 3px.
Due to some quirks of CSS specificity, a rule for 0 `right-padding` was
overriding a rule for 2px `right-padding` for topic names.

This is now corrected, and the padding increased to 3px for a less
cramped look, for PMs, topics and streams. Repetition of CSS has also
been removed.
2023-02-01 16:04:33 -08:00
Sahil Batra 4ea64cfede settings: Remove 'bootstrap-focus-style' from div element.
This commit fixes the code to add 'bootstrap-focus-style'
class to select element instead of div.

This was introduced in af36e9f823.
2023-02-01 14:50:30 -08:00
Prashant Vithani a791c817c7
css: Fix erroneous `bootstrap-focus-style` ID.
The commit af36e9f added a bug that breaks new user invite.
The CSS class ` bootstrap-focus-style` was added to `id`,
hence breaking the value extraction.

Fixes: #24249
2023-02-01 14:49:55 -08:00
Sahil Batra a2315422e7 settings: Override bottom margin for inputs.
We override the bottom margin added by bootstrap for
url type custom profile input in user profile page
and all the inputs in edit-user form. Previously, this
was handled by form-horizontal class which was removed
in #24057.

For most of the other text-type inputs, it is overridden
in app_components.css and for checkbox-type inputs, it is
overridden by other bootstrap CSS itself. But that only
handles text-type and checkbox-type inputs inside
".new-style" element and not url type inputs.
Some other inputs already have specific CSS to override the
bootstrap CSS.

For the same reason, there is no need to override bottom
margin for inputs in organization profile as there is no
url type inputs in that page and this commit removes the
CSS for it.
2023-02-01 14:48:48 -08:00
Lauryn Menard e6bfdc7d34 settings: Create shared class for tooltips on disabled settings.
Creates a shared `disabled_setting_tooltip` class that can be
reused in cases where a personal or organization setting button
or input is disabled and a tooltip is added to give information
about why the user cannot change/access the setting.
2023-02-01 14:46:02 -08:00
Lauryn Menard d8b8b34ecd profile-settings: Change `name-input` class to a more specific id.
Changes `name-input` class, that was only being used in a div
wrapper for the input element for changing a user's full name,
to be a more specific id name: `full_name_input_container`.

This id is used to set or remove the disabled setting tooltip
when name changes are disabled by the organization.

There are no CSS rules set with this class/id.
2023-02-01 14:46:02 -08:00
Lauryn Menard 264a34d543 settings-css: Combine rules for disabled button `pointer-events`. 2023-02-01 14:46:02 -08:00
Aman Agrawal c64c00d916 portico_signin: Wrap long email names to next line.
Along with wrapping long emails to next line, set the max-width of
the email confirmation box to the alert box.
2023-02-01 13:14:08 -08:00
Tim Abbott 875ad8ed5b compose: Fix using Up when editing messages.
This fixes a very noticable regression in
92788a52bb, where using Up/PageUp/Home
when focus was in anything other than the compose box would
incorrectly be treated as message feed navigation.

Fix this by adding a new check, but this now has some fairly
duplicated code that queries the DOM for the same thing 3 times in a
row; added a TODO comment explaining a likely better approach.
2023-01-31 17:24:50 -08:00
N-Shar-ma 431cd8b10a typeahead: Don't show default emojis if overridden by a realm emoji.
When a realm emoji overrides a default emoji, `:emoji_name:` now renders
as the realm emoji. Still, the typeahead menu would misleadingly show
the now overridden default emoji for the same name. Selecting it would
render as the realm emoji, which is very confusing user experience.

Now when selecting the emojis to suggest in the typeahead, the overridden
default emojis are excluded.

Fixes part of #24120.
2023-01-31 15:52:08 -08:00
N-Shar-ma 8a5b71fdbd emoji_settings: Only allow admins to override default emoji.
Uptil now, any user could add a custom emoji with the same name as a
default emoji, thus overriding it (with a confirmation after warning).

To create more friction for this action, now only admins are allowed to
add custom emojis that override default ones. All users can still add
custom emojis with other names.

Fixes part of #24120.
2023-01-31 15:50:13 -08:00
N-Shar-ma a4e477bf02 emoji_settings: Reword modal to confirm overriding default emoji.
Better explain what exact effects overriding a default emoji name has.
2023-01-31 15:46:13 -08:00
N-Shar-ma c519c31bda emoji: Fix checks for whether custom emoji may override default. 2023-01-31 15:46:04 -08:00
Tim Abbott 970071e3bd Revert "message_row: Allow time row to expand if it needs more width."
This reverts commit 2bf47c7d4b.

This appears to have resulted in the message controls being misplaced.
2023-01-31 15:39:52 -08:00
Aman Agrawal b8f91b6513 message_body: Keep the sender name padding as a different element.
This helps us align the tooltip on sender name at the center of it
while still having a tooltip in the gap between avatar and sender
name.
2023-01-31 15:35:46 -08:00
Aman Agrawal dbef64426b message: Convert `view user card` to a tippy tooltip. 2023-01-31 15:35:46 -08:00
Aman Agrawal 65f9dbc5f3 tippy: Directly use `content` property to set content. 2023-01-31 15:35:46 -08:00
Aman Agrawal 00752f8059 message: Keep user card tooltip limited to user name and avatar.
We accidentally added tooltip to open user card to a much larger
area than intended as a regression from moving the message to
use grid.

In this, we keep it limited to user name and avatar by adding
the tooltip directly to them.
2023-01-31 15:35:45 -08:00
Zixuan James Li b21f533af3 settings_users: Show all bots in organization settings.
We intended to show all the bots in the bots organization settings for
non-admin users as well. This switches from bot_data.all_user_ids() to
people.get_bot_ids() to get a full set of ids for all the bots in the
organization.

Because the source of data changes, "realm_user" instead of "realm_bot"
triggers the update of the bots list.

The code example (example4) is updated since we incorporate a side
effect into "realm_user"'s "add" op.

Note that while "realm_user" does not have a "delete" op, we still stop
redrawing bots on "relam_bot"'s "delete" op, because "delete" was only
triggered when the bot owner changes, the bot does not disappear from
the list of all bots.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-01-31 15:16:48 -08:00
Zixuan James Li 5ecd0cecf4 people: Implement get_bot_ids.
This provides a way to access all the bot users, no matter if they are
owned or admined by the current user or not.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-01-31 15:16:48 -08:00
Aman Agrawal 2bf47c7d4b message_row: Allow time row to expand if it needs more width.
While setting a min-width according to the current width, we allow
the time column to expand if the translated `AM/PM` time needs
more width.
2023-01-31 14:47:40 -08:00
Palash Baderia 92f085c571 recent_topics: Clear search box on show.
Fixes: #20956.

Recent topics and all messages have empty search query, so it is
important to clear the search query when switching to them, otherwise
search text from previous query is displayed.
2023-01-30 16:49:08 -08:00
N-Shar-ma 9def249af1 typeahead: Fix bug where typeahead showed momentarily on shift + tab.
Break on `keyup` for case of `shift` key, instead of letting it trigger
the typeahead.

Fixes: #24152.
2023-01-30 14:38:25 -08:00
N-Shar-ma e2e39acbc4 widgets: Make the todo and poll widgets look consistent / similar.
Earlier the todo and poll widgets' UI differed a lot, especially in the
font size and weight, and the color and shape of the checkbox and vote
count box.

Now the font weights and sizes are consistent in both the widgets and
the todo widget's checkboxes and poll widget's vote count boxes are
styled similarly.

This is the rebased and cleaned version of #21006, and is visually near
identical.

Fixes: #20283.
2023-01-30 11:51:33 -08:00
N-Shar-ma abb3881bdb refactor: Convert any instances of `pt` to `px` in `widgets.css`. 2023-01-30 11:51:33 -08:00
N-Shar-ma 92788a52bb compose: Handle hotkey triggers depending on whitespace in composebox.
The `focus_in_empty_compose` function used for hotkeys, now checks if
the compose box is truly empty by considering it's untrimmed value. If
there are just spaces in the focused compose box, `focus_in_empty_compose`
returns false now.

This fixes the bug where using the left key among just spaces did not move
back the cursor as expected, and may unexpectedly trigger edit state for
the last sent message.

For `up` hotkeys, message navigation is also triggered if the cursor is
at the start of the composebox with just whitespace. A new helper
function is added for this check.
2023-01-30 11:32:37 -08:00
Sahil Batra 6b7e588a68 css: Remove some unnecessary CSS.
This commit removes the margin-bottom CSS added for
select elements to override the margin added by bootstrap.
Since we have removed the bootstrap CSS rules for
select elements in previous commits, we can remove
the overridden CSS in this commit.

This commit also removes margin-bottom CSS for input
element in one case, because CSS in app_components.css
already overrides the current bootstrap CSS for input
element.
2023-01-26 12:36:31 -08:00
Sahil Batra 03668a4272 subscriptions: Remove unused CSS.
Since, we have removed bootstrap CSS rules for select elements
in previous commit, we do not need to set this rule since
default value of margin is 0.
2023-01-26 12:36:31 -08:00
Sahil Batra 0cf169be71 bootstrap: Remove CSS rules for select elements from bootstrap.css.
This commit removes the bootstrap CSS rules for select elements in
bootstrap.css. The requried rules are already added to specific
elements in previous commits to keep the existing design.

Fixes part of #23635.
2023-01-26 12:36:31 -08:00
Sahil Batra af36e9f823 css: Add "bootstrap-focus-style" class to select elements.
This commit adds "bootstrap-focus-style" class to the select
elements such that we can add CSS rule for focusing a select
element at single place only using this class.
2023-01-26 12:36:31 -08:00
Sahil Batra 0d4839d900 modal: Add bootstrap CSS rules for select elements in modal.
This commit adds bootstrap CSS rules used for select elements
used in different modals in modal.css.

This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.

This commit also changes the CSS for propagate mode select
element in "Move messages" modal to use ID as selector
instead of class such that the width property can be
overridden correctly.
2023-01-26 12:36:31 -08:00
Sahil Batra 45fcd9ee45 settings: Add bootstrap CSS rules for select elements.
This commit adds bootstrap CSS rules used for select
elements in settings page in settings.css.

This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.

Due to this change, a couple of settings have lesser
margin at the bottom than before, but they look fine
with lesser margins and anyways had unnecessarily
larger margin before.

We also update the selector used to set width of
desktop-icon-count-display setting such that the
default of 220px is correctly overridden by the
specific CSS for this element.
2023-01-26 12:36:31 -08:00
Sahil Batra a3a3f7796a stream_settings: Add bootstrap rules for select elements.
This commit adds bootstrap CSS rules used for select
elements in stream settings to existing CSS in
subscriptions.css.

This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.
2023-01-26 12:36:31 -08:00
Sahil Batra bbcca49a5e invite: Add bootstrap CSS rules for select elements in invite modal.
This commit adds bootstrap CSS rules used for select elements in
invite UI in zulip.css.

This change is done so we can safely remove select CSS rules from
bootstrap.css as a part of our process to remove bootstrap.

This commit also adds class to a couple of select elements in invite
UI such that we can use those class to write CSS as using IDs would
lead to the dark-theme background not being applied correctly.
2023-01-26 12:36:31 -08:00
Sahil Batra 275da6b300 activity: Add bootstrap CSS rules for select elements in support page.
This commit adds bootstrap CSS rules used for select elements in
activity support page in activity.css.

This change is done so we can safely remove select CSS rules from
bootstrap.css as a part of our process to remove bootstrap.
2023-01-26 12:36:31 -08:00
Sahil Batra 4be60fa1ba upgrade: Add bootstrap CSS rules for org type select element.
This commit adds bootstrap CSS rules used for org type select
element in sponsorship page in billing.css.

This change is done so we can safely remove select CSS rules
from bootstrap.css as a part of our process to remove bootstrap.

We also remove inline style for this element and instead add
it with other CSS in billing.css.
2023-01-26 12:36:31 -08:00
Sahil Batra 6de03c415c integrations_dev_panel: Add bootstrap CSS rules for select elements.
This commit adds bootstrap CSS rules used for select elements in
devtools integrations panel in integerations_dev_panel.css.

This change is done so we can safely remove select CSS rules from
bootstrap.css as a part of our process to remove bootstrap.
2023-01-26 12:36:31 -08:00
Sahil Batra d708bc338c register: Add bootstrap CSS rules for select elements.
This commit adds bootstrap CSS rules used for select
elements in realm creation form to the existing CSS
in portico_signin.css.

This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.
2023-01-26 12:36:31 -08:00
Sahil Batra 72b528e22b development: Add bootstrap CSS rules for select in dev login form.
This commit adds bootstrap CSS rules used for select element
in dev login form in portico_signin.css.

This change is done so we can safely remove select CSS rules
from bootstrap.css as a part of our process to remove bootstrap.
2023-01-26 12:36:31 -08:00
Sahil Batra e14b1f03fa register: Refactor template for new account registration.
This commit refactors the template code for source-realm
select element to have same structure as other inputs
and select element in the page. Thus this change also
makes the styling of source-realm select element consistent
with other select element in the page.
2023-01-26 12:36:31 -08:00
Sahil Batra 970d692d69 settings: Fix upgrade-banner for narrow width screens.
The upgrade banner was being clipped for narrow width screens
and was only partially visible. This commit changes it to instead
wrap the content such that complete content is visible on the
screen.

We also decrease the right margin for icon in the banner such
that the text of the banner fits in one line for at least normal
screen size and zoom in stream settings overlay.
2023-01-26 10:31:07 -08:00
SameepAher 3fe6d0def1
streams: Use singular in feedback for a single added subscriber.
The message displayed after successfully adding users to a stream previously
used a plural even if only a single user was added.
2023-01-26 10:22:35 -08:00
David Rosa b79daa9fa3 gear menu: Drop special naming for organization settings menu item.
Removes the special naming of the organization settings gear menu
item for admins so that it lines up with how we refer to the
"Organization settings" UI itself in the help center documentation.
2023-01-26 10:17:45 -08:00
Sahil Singh d05f672132
compose: Delete drafts with attachments.
Draft messages containing attachments, polls, or other items that cannot be locally 
echoed would not be deleted after sending the message. 

The explanation is simple: We only cleared the draft associated with a message in the 
`reify_message_id` local echo code path.

Fixes #24063.
2023-01-25 14:17:51 -08:00
Lauryn Menard 019fa7e122 organization-profile: Update deactivate organization section.
Removes the info icon with the tooltip information and replaces
it with a question help link icon to the help center article on
deactivating an organization.

Also, when the button is disabled, adds a tooltip on hover that
explains only organization owners can deactivate an organization.

If the current user's owner role is changed, then the button and
tooltip are live updated.

Part of #22892.
2023-01-24 13:09:53 -08:00
Aman Agrawal 37431cf0b5 urls: Provide `email` as a GET parameter.
Since we want to use `accounts/new/send_confirm` to know how many
users actually register after visiting the register page, we
added it to Google Tag Manager, but GTM tracks every user
registration separately due <email> in the URL
making it harder to track.

To solve this, we want to pass <email> as a GET parameter which
can be easily filtered inside GTM using a RegEx and all the
registrations can be tracked as one.
2023-01-24 11:29:50 -08:00
Aman Agrawal f4e9bf269c css: Fix positioning of text elements in message row without sender.
When I changed the padding for message content in the PR which
converted the message row to a grid, I forgot to adjust
the position of edited and time elements.
2023-01-23 16:41:03 -08:00
brijsiyag f314d819aa settings: Remove unused class.
Removed class is not used for any CSS.
Also heading is not for the message retention setting.
2023-01-23 15:09:21 -08:00
brijsiyag 02450b7aa6 settings: Fix info icon in header row outside header.
This info icon was smaller than similar ones sitting in heading rows,
because the icon element was outside the `<h3>` element for the row.

Fixes #23801
2023-01-23 15:08:42 -08:00
Akarsh Jain caeeddd975 typeahead: Fix suggestion box positioning on window resize.
The suggestion box was not being repositioned correctly when the window
was resized. This commit adds a resizeHandler() function to handle
window resizing properly and reposition the suggestion box to its
current position.

Fixes: #23681.
2023-01-23 15:05:14 -08:00
m-e-l-u-h-a-n fbb475b16a streams: Fix hash redirect for deleted/invalid stream ids.
The logic for hash redirects for stream settings did not check
for deleted or non-existent streams. Thus a hash of the form
`/#streams/{invalid_stream_id}/*` gave gave a blueslip error.

This change fixes that logic to treat such hashes equivalent to
streams whose settings cannot be accessed by that user and
redirects such invalid hashes to `/#streams/subscribed/`.
2023-01-20 15:07:00 -08:00
N-Shar-ma fb81e5504c typeahead: Remove misleading comment regarding favouring popular emojis. 2023-01-20 14:41:21 -08:00
N-Shar-ma aa72b51bca emojis: Prioritise custom / realm emojis when sorting.
Fixes: #18135.
2023-01-20 14:41:21 -08:00
N-Shar-ma 249f482b06 emojis: Filter out unicode emojis with same codes from typeahead menu.
Since emojis can have multiple aliases, an emoji was often suggested
under multiple names (like `smiling devil` / `smiling imp`), crowding
typeahead suggestions redundantly, and taking up the place of other
potentially relevant emoji suggestions.

Now such duplicates are removed post the sorting of suggested emojis,
and only the most relevantly named (highest sorted) copy is retained.
2023-01-20 14:41:21 -08:00
N-Shar-ma c64726ea9a compose: Retain compose state across narrows if recipient was edited.
Uptil now, the compose box's state was retained across narrows only if
the compose box had any content in it. Else it was reset to match the
current narrow.

To not lose any changes made to the recipient fields only, the compose
box will now retain its state also if the recipient (stream, topic or
PMs) has been manually edited.

This is achieved by having a variable in `compose_state` track if the
recipient fields were changed, and checking it before resetting the
compose box on narrowing. This variable is reset when the compose box's
context is changed by clicking on a message, or when a message is sent.

Fixes: #23064.
2023-01-20 12:56:37 -08:00
Sahil Batra 3cb69b138e settings: Disable save button when value is out of range.
This commit adds code to disable save button when the value
in custom input box is too large for an integer. Note that
since the value for message edit, message delete and email
notification batching settings are in minutes in the custom
input but are sent to API in seconds, we make sure that the
seconds value should be inside the range.
2023-01-20 12:45:53 -08:00
Sahil Batra 82aacb4996 settings: Fix custom input handling of message retention setting.
This commit adds code to convert $custom_input.val() to Number
in get_message_retention_setting_value such that values like
"48aa" are treated as NaN and we correctly show save-discard
widget with save button disabled. If we not convert it to Number,
Number.parseInt will just convert "48aa" to 48.

This commit is similar to 711536f53a.
2023-01-20 12:45:53 -08:00
Sahil Batra 235bd3fb1b settings: Disable "Save changes" button for invalid values.
This commit disables the "Save changes" button when there is
an invalid value in custom input of message retention setting.

This commit includes changes for both realm and stream message
retention setting.
2023-01-20 12:45:53 -08:00
Sahil Batra ba1188db05 settings: Rename admin-realm-time-limit-input class.
This commit renames admin-realm-time-limit-input class to
time-limit-custom-input such that there is no confusion
when it is used for stream settings also.
2023-01-20 12:45:53 -08:00
Sahil Batra 565d133985 settings: Refactor code for waiting period setting.
This commit refactors code for realm waiting period setting
to be similar to other time-based inputs. We also add the
code to disable the save button when custom inputs have
invalid values.
2023-01-20 12:45:53 -08:00
Sahil Batra bc5f0e881e settings: Rename IDs of waiting-period-threshold setting elements. 2023-01-20 12:45:53 -08:00
Sahil Batra 4dd1676e96 settings_config: Add waiting_period_threshold_dropdown_values.
This list will be used in further commits in settings_org.js
code for waiting period threshold setting.
2023-01-20 12:45:53 -08:00
Sahil Batra 43898be138 settings_org: Rename custom_days option to custom_period.
This commit renames custom_days option for realm waiting
threshold setting dropdown to custom_period such that we
can reuse existing code for similar time-limit settings.
2023-01-20 12:45:53 -08:00
Tim Abbott 235768ae4c setting: Remove now unused dependant-inline-block class. 2023-01-20 12:39:28 -08:00
Ningxi Zhang 69d8101c6a settings: Move the retention days input below the dropdown.
Moved the "Retention period (days):" under the dropdown "Custom".

This is consistent with similar date window inputs elsewhere, and
conveniently just requires changing a single class.

Fixes: #23532
2023-01-20 12:38:04 -08:00