Commit Graph

5728 Commits

Author SHA1 Message Date
Sayam Samal 5549e807eb rendered_markdown: Remove universal selector for embedded content.
This removes the `.message_embed > *` selector which was expensive, and
instead moves the styles to the specific elements that need them.
2024-07-29 15:08:54 -07:00
Karl Stolley 75a20f98d0 message_controls: Explicitly select .message_control_button. 2024-07-29 14:13:31 -07:00
Karl Stolley 6bc7b617d8 message_controls: Add explicit message-controls-icon class. 2024-07-29 14:13:31 -07:00
Karl Stolley aa83b1b5cd message_row: Move message_controls into proper place in row file. 2024-07-29 14:13:31 -07:00
Karl Stolley da7114918f streams_settings: Removed unused FontAwesome references. 2024-07-29 13:19:35 -07:00
Karl Stolley c8ba0f7abf rendered_markdown: Remove incorrect selector with unused color. 2024-07-29 13:18:26 -07:00
Aman Agrawal a43c0693b7 scroll-to-bottom: Fix misclicks to scroll to bottom button.
Scroll to bottom button is visible for a few ms when switching
narrow to Inbox / Recent view while scrolling in message feed.
While we can end the transition faster to completely avoid the issue
for now but this seems like a more permanent and simpler fix
than to fiddle with CSS.
2024-07-27 09:35:12 -07:00
Tim Abbott 68c4d145b0 message_reactions: Use the reactions tooltip template.
Using the existing tooltip template for the other "add emoji reaction"
element in message_controls results in the keyboard shortcut being
shown and avoids doing work to translate the string for every single
message containing emoji reactions.
2024-07-27 09:25:51 -07:00
evykassirer 12207407c9 css: Use classname for topic visibility tooltip instead of span. 2024-07-26 14:42:25 -07:00
evykassirer a243191539 settings css: Use selector for empty option text instead of span. 2024-07-26 14:42:24 -07:00
evykassirer e0b0a3638e portico css: Use classname for header text instead of span. 2024-07-26 14:41:08 -07:00
evykassirer cc6118efae integrations css: Use classname for back to list link instead of span. 2024-07-26 14:41:08 -07:00
evykassirer f7a27be0a8 settings css: Use classname for checkbox label instead of span. 2024-07-26 14:41:08 -07:00
evykassirer 5ed19d1971 landing_nav css: Use classname instead of span for realm name. 2024-07-26 14:41:08 -07:00
evykassirer 9824f76e7d css: Use a classname instead of span for overlay plus button. 2024-07-26 14:41:08 -07:00
evykassirer 952ca6ae3c css: Use color-animated-button-text instead of span selector. 2024-07-26 14:41:08 -07:00
evykassirer 1b8658670c css: Use classname for stream subheader name. 2024-07-26 14:41:08 -07:00
evykassirer 8427b6f744 css: Use classname instead of span selector for todo checkboxes. 2024-07-26 14:41:08 -07:00
evykassirer 90ab7f6287 css: Remove unused span selector in scroll to bottom container.
This rule was originally introduced with a span element in
0eafa6039b but the span has been
since removed.
2024-07-26 14:41:07 -07:00
Tim Abbott 3ffc5c339f portico: Remove unused faqs CSS.
These were styles for a component removed in
f244336271.
2024-07-25 17:31:12 -07:00
Aman Agrawal 88b54526ba message_view: Fix current narrow doesn't rerender when asked to.
Here we want to rerender the current narrow after receiving an
event which moves messages. We have mechanisms to keep using
the cached list if we are narrowing to the same narrow which
we want to avoid in this case.
2024-07-25 12:02:57 -07:00
Shubham Padia bbd9b91238 hotkey: Put focus back into edit text area after Alt + P.
Fixes
https://chat.zulip.org/#narrow/stream/101-design/topic/key.20combination.20for.20hotkey.20to.20toggle.20compose.20preview/near/1902135.
The logic to put focus back to textarea is not part of the
`clear_preview_area` function because you wouldn't expect a function
clearing the preview area to somehow put focus into the edit area.
2024-07-25 11:33:53 -07:00
roanster007 7f1396de32 lightbox: Update `canonical_url_of_media` to use URL pathname.
This reworks canonical_url_of_media to work with HTMLMediaElement,
making it possible to do cross-browser inspection of media sources.
(Firefox and Chrome disagree on whether to return the "href"
attribute as the path in the source, or a full URL).

Additionally, we ensure non-empty cache keys on media so
unexpected results from the DOM do not get cached.

Co-Authored-By: Alex Vandiver <alexmv@zulip.com>
Co-Authored-By: roanster007 <rohan.gudimetla07@gmail.com>
2024-07-25 11:21:02 -07:00
Tim Abbott f61f138b75 tooltips: Clean up aria-label for visiblity tooltips.
Using different punctuation for the aria-label from the tooltip is
silly. Additionally, we don't need to repeat the channel name in
aria-label; it essentially will never be seen and the message list
copy of getting the channel name was buggy.
2024-07-25 08:24:14 -07:00
Tim Abbott a1c8e3549a message_list_view: Don't assume stream_id is defined. 2024-07-25 08:24:14 -07:00
Tim Abbott cbca3a8080 lightbox: Don't try to use unavailable width.
We don't have a width for images without dimensions attributes, and
all such images will have used the other code path.
2024-07-24 17:44:36 -07:00
Aman Agrawal dd7a5ac4c5 recent_view_ui: Fix dm rows not updated for deleted messages.
Tested by deleting a DM and navigating to recent view. No error
is thrown and dm row is correctly placed.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-07-24 13:51:56 -07:00
Pratik Chanda 1ccf5e3ac3 tooltip: Change tooltip info for default topic menu option.
Earlier tooltip info for the default topic menu notification option
had static string to display.

This commit changes the string info and includes channel name and its
corresponding privacy icon to display in the tooltip.
2024-07-24 13:34:52 -07:00
Pratik Chanda 4ef7394df4 tooltip: Change tooltip for topic menu option.
Earlier tooltips for topic menu button had inconsistent context with
that of other tooltips. In topic menu tooltip, action was described in
first line which different from that of other tooltips.

This commit changes the tooltip context and rearranges them to match
the format of action on first line and more context on second line.
2024-07-24 13:31:24 -07:00
Sahil Batra 9aa4ce28ce css: Improve selectors used for recent topics table.
Using "*" selector is inefficient as they require checking every
element because of the browser's bottom-up matching process.
This commit instead updates the selector to use individual
classes for elements to apply the CSS rules keeping in mind
to use unique class names instead of general class names.
2024-07-24 12:31:20 -07:00
Sahil Batra b0e8096579 css: Do not use "*" selector for color_animated_button styles.
Using "*" selector is inefficient as they require checking every
element because of the browser's bottom-up matching process.
2024-07-24 12:31:20 -07:00
Kenneth Rodrigues c4c9c59a41 default_channel: Fix multiple modals opening.
Earlier, the `Add Channel` button was being focused even after the
modal was open, causing multiple modals to open on pressing enter
repeatedly.
This commit fixes the issue by removing the focus from the `Add
Channel` button after the modal is open by focusing the dropdown on the
modal.
2024-07-24 12:26:31 -07:00
Kenneth Rodrigues fe557bde77 custom_profile_fields: Fix multiple modals opening.
Earlier the focus remained on the button to open the modal,
causing multiple modals to open on pressing enter repeatedly.
This commit fixes the issue by removing the focus from the button
by focusing on the first input field of the modal.
2024-07-24 12:26:31 -07:00
Tim Abbott 55884b1338 paste_handler: Skip undo dance if formatting was a noop.
The intent had been only to do the fancy undo thing when no formatting
is present.
2024-07-24 11:11:29 -07:00
Aman Agrawal 8a82639762 message_events: Fix compose stream not updated when moving messages.
When moving message while compose box has content, stream was not
updated to the new stream if it was changed.

Tested by moving message with stream changed and with / without topic
changed.
2024-07-24 10:46:01 -07:00
Kislay Verma 3620139700 copy_and_paste: Paste text first unformatted and then formatted.
This commit makes pasting formatted text a two-step process:

- Insert unformatted text
- Insert formatting

This way, undo (Ctrl+Z) will restore the original pre-formatting
syntax.

This is the same as the approach taken with
auto-formatting in #29302.

Fixes #31061
2024-07-24 10:36:06 -07:00
Sayam Samal e6c0e096f9 user_card_popover: Remove presence circle indicator for bot users. 2024-07-24 10:27:27 -07:00
Sayam Samal eed3890be6 user_card_popover: Add bot specific terminology for mute/unmute option. 2024-07-24 10:27:27 -07:00
Sayam Samal fd638664b5 user_card_popover: Rename "Bot owner" to just "Owner". 2024-07-24 10:27:27 -07:00
Sayam Samal 9c2b60a304 user_card_popover: Fix bot owner field overflowing for long names.
This commit fixes the overflowing issue for long bot owner names in the
user card popover, and also repositions the bot owner user card popover
to align with the bot owner name on the bot user card popover.
2024-07-24 10:27:27 -07:00
Sayam Samal 9b314da0ea user_card_popover: Fix bug where owner's avatar replaces bot's avatar.
The `.popover-menu-user-avatar` selector being used to replace the small
avatar with the medium avatar was a broad selector, which also targeted
the bot's avatar when the bot owner's user card was opened. This commit
fixes this bug by scoping the selector to the current popover instance.
2024-07-24 10:27:27 -07:00
Sahil Batra 8734d34cb7 stats: Remove unnecessary CSS.
This CSS was needed when there was label along with the buttons
on the same line when this was originally added in 626c5ef55e.

But there is no label with the buttons now, so this CSS is not
needed.
2024-07-24 10:12:42 -07:00
Sahil Batra b2ca752f75 css: Remove unused css for scheduled-messages-loading class.
This class was removed in 043d54d170.
2024-07-24 10:12:42 -07:00
Tim Abbott 7c792b1f7a upload: Stop importing unused Uppy styles.
I'm not aware of us using any of these; we don't generate the class
names involved, and we're not using `uppy.use` on any of their UI
components.

I confirmed that the only use of an Uppy UI component was the progress
bar, which was stopped using in
b01ac3623f.
2024-07-24 10:12:17 -07:00
Sahil Batra 5b98bc4848 settings: Allow admins/owners to deactivate themselves from users list.
We previously did not allow users to deactivate themselves from users
list to avoid users deactivating themselves accidentally. But we now
show a confirmation modal before deactivating, so it is fine to allow
it.
2024-07-24 10:05:03 -07:00
Alex Vandiver fccddf9f0d thumbnail: Fix comment. 2024-07-24 09:57:20 -07:00
Tim Abbott 47683144ff thumbnail: Prefer 840x560 thumbnails for web app.
While this has no real effect in the message feed itself, it makes the
transition in the lightbox a lot nicer.
2024-07-24 09:21:50 -07:00
Aman Agrawal 66da0a0945 popover_menus: Fix user card moves to top left of screen.
When the user card is displayed via right sidebar, the reference
can be lost due to it being updated or hidden on window resize.

To fix it, we show user card as an overlay when we cannot find
the reference.

Another solution would have been to relocate the reference and
update it for the popover but that is not naturally supported by
tippy once the popover has been displayed.
2024-07-24 09:19:39 -07:00
Karl Stolley 829212a76a lightbox: Set payload.source on srcset.
This eliminates a flash of the smaller/blurrier preview image when
navigating to images that have already been loaded in full.
2024-07-24 09:14:36 -07:00
Alex Vandiver d448a0b271 thumbnail: Use the pre-fetched thumbnail as a temporary stand-in.
This improves the user experience by showing *something* as we fetch
the full-resolution image in the background.
2024-07-23 16:41:09 -07:00
Sayam Samal 4b121a8573 user_card_popover: Focus on menu options first when key is pressed.
As a follow-up to the commit f124ef931, which deals with the keyboard
focus when opened via the keyboard shortcut `U`, this commit ensures
that when the user card is opened via the mouse, and the first
navigational key is pressed, the focus is on the first menu option
instead of the other tabbable elements which can be distracting.
2024-07-23 16:39:05 -07:00
roanster007 c9667048b7 popovers: Skip updating url hash when clicked on "View user profile".
Previously, clicking on "view user profile" in the user card popover
would open up the profile as an overlay, changing the hash, and
closing other already opened overlays when opened.

This commit would modify it to behave as a modal rather when
an overlay is already open in the background, thus preventing
the hash change, and allowing the background overlays to exist
when it is opened.

Fixes #30481
2024-07-23 15:07:33 -07:00
Sayam Samal 1f020816c2 user_card_popover: Update text item colors to improve contrast.
This commit updates the color of the text items in the user card popover
which are mostly user related information, to use the new Zulip color
palette.

This increases the contrast of the custom profile fields and other user
related information such as the user's local time and status text to
improve readability.

Fixes part of #31027.
2024-07-23 14:56:15 -07:00
Sayam Samal ee26f16d67 css: Replace var() color arguments with static hsl() equivalent values.
The postcss-color-mix-function plugin does not support var() color
arguments since those cannot be dynamically resolved. This commit
replaces all var() color arguments with their static hsl() equivalent
values to ensure that color-mix() functions are successfully compiled
to rgb() for browser compatibility.
2024-07-23 14:56:15 -07:00
Sayam Samal 97c27374d6 css: Use `oklch` color space in `color-mix()` for Zulip color palette. 2024-07-23 14:56:15 -07:00
Shubham Padia 451a9979dd state_data: Add types to current_user_schema.
Types have been taken from user_schema for fields present in that schema
and rest have been take from zulip.yaml.
2024-07-23 14:14:15 -07:00
Shubham Padia c96e76be8b hotkey: Alt + P now toggles preview mode for message_edit.
Fixes #30851.
Since there can be multiple messages being edited at once, with a
possibility for them to be out of the DOM, we use
compose_state.get_last_focused_compose_type_input to determine which
message edit to toggle the preview mode on.

We keep the compose box preview toggle behaviour more or less the same,
where we do not check whether the compose box was last focused or not if
there are no eligible message edit boxes and the compose box is open.
This behaviour works well for compose box since there's always one
possible compose box at a time compared to multiple message edit boxes.

One thing to note behaviour wise is that if you have 1 message edit
box open and you shift the focus to compose box, and then close the
compose box, `Alt + P` will not work until the focus is brought back again to
the message edit box.
2024-07-23 14:14:15 -07:00
Shubham Padia 78bb2a4c9b message_edit: Extract clear_preview_area from click_handlers.
We want to able to use the clear_preview_area in other places than
click_handlers and that's why it has been moved to message_edit.js.
The name was chosen to be consistent with a similar function in
compose.js.
2024-07-23 14:14:15 -07:00
Shubham Padia f4704f0419 message_edit: Extract show_preview_area from click_handlers.
We want to able to use the show_preview_area in other places than
click_handlers and that's why it has been moved to message_edit.js.
2024-07-23 14:14:15 -07:00
Shubham Padia f97ffd07d2 compose: Move render_and_show_preview to compose_ui.
We want to use render_and_show_preview in message_edit, but that will
cause a dependency cycle because of message_events. In order to avoid
the dependency cycle, the function has been moved to compose_ui and
relevant types have been added.
This commit does not audit the existing function for improvements, just
moves it around and adds types.
The `msg` and `result` are same as the other files (e.g.
activity.test.js) with success responses.
2024-07-23 14:14:15 -07:00
Shubham Padia c5fc0ae4a2 state_data: Add type for full_name in current_user_schema. 2024-07-23 14:14:15 -07:00
Tim Abbott 2e252ec502 team: Count contributors with 20+ commits too.
This is a useful supplement to the number for 100+ commits.
2024-07-23 14:01:01 -07:00
Karl Stolley 9716ad9e84 search_box: Specify consistent, veritable height. 2024-07-23 14:00:32 -07:00
Karl Stolley 92fcd7cc9e search_box: Remove needless margin-right value. 2024-07-23 14:00:32 -07:00
Sayam Samal cd8aa727ce user_card_popover: Add `LONG_HOVER_DELAY` delay to user card tooltips.
This adds the `LONG_HOVER_DELAY` delay to the user card tooltips, which
prevent the tooltips from becoming distracting when the user is just
navigating the popover.
2024-07-23 13:59:02 -07:00
Sayam Samal f124ef931d user_card_popover: Focus on menu options when opened with keyboard.
When the user card is opened via the keyboard shortcut `U`, the initial
focus should be on the first popover menu option, rather than the copy
buttons or the custom profile field links which can be distracting due
to the presence of tooltips on them.

Fixes part of #31027.
2024-07-23 13:59:02 -07:00
Karl Stolley 99111a90d7 invite_modal: Simplify Administrator, Owner role labels. 2024-07-23 13:54:11 -07:00
Anders Kaseorg 94fe3f6194 rendered_markdown: Move thumbnail rewriting to postprocess_content.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-23 13:26:37 -07:00
Anders Kaseorg edf34ada63 util: Rename clean_user_content_links to postprocess_content.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-23 13:26:37 -07:00
Prakhar Pratyush f586366272
onboarding_steps: Update button text of onboarding modals to "Got it".
Changing the button text of one-time modals to introduce the recent and
inbox view to say "Got it" rather than "Continue" helps reinforce the 
vocabulary we're using "Got it" = dismiss one-time content forever.
2024-07-23 12:28:59 -07:00
Karl Stolley af441971b5 message_row: Add ellipsis to edited notices below avatar. 2024-07-23 09:44:14 -07:00
Sahil Batra b07ba1c100 css: Increase right padding for table headers.
This commit increases right padding of headers of sortable
table columns, so that there is some space between the arrow
and the hover shadow border.
2024-07-23 09:43:42 -07:00
Sahil Batra a888763141 css: Extract variable for the right padding for table headers.
This commit extracts CSS value for right padding, used in headers
of sortable columns of a table, in a variable.
2024-07-23 09:43:42 -07:00
Tim Abbott 461663c08a stream_list: Fix clicks on muted channels.
The previous logic did not properly account for the fact that in muted
channels, unmuted/followed topics are sorted above normal topics.

Rather than trying to reproduce that logic, we just call the function
for computing the topics in the left sidebar, and pull off the top
topic.
2024-07-22 22:32:47 -07:00
Aman Agrawal 9f67452155 settings_components: Keep saved button displayed a little longer. 2024-07-22 22:31:02 -07:00
Kenneth Rodrigues fccc338db5 modals: Fix focus for recent_view_ui and inbox_ui modals.
Earlier the focus was not being set to the modal when it was opened.
This was because `is_in_focus` checks if  `modals.any_active` which
checks `$(".micromodal").hasClass("modal--open")`.
But when `is_in_focus` is called
`$(".micromodal").hasClass("modal--opening")`.

This commit fixes the issue by creating a function
`is_active_or_animating` which checks if the modal has the class
`modal--open` or `modal--opening`.
2024-07-22 22:29:58 -07:00
Kenneth Rodrigues dc85478c5d user_deactivation_ui: Fix focus when modal is open.
Earlier, when the user deactivation modal was open, the focus was not
set on the modal. This commit fixes that by setting
`focus_submit_on_open` to `true` in the modal options.
2024-07-22 22:28:00 -07:00
roanster007 66a96bee71 settings: Add setting to control how animated images are played.
Previously animated images were automatically played in the
message feed of the web app.

Now that we have still thumbnails available for them, we can add a new
personal setting, "web_animate_image_previews", which controls how the
animated images would be played in the web app message feed -- always
played, on hover, or only in the image viewer.

Fixes #31016.
2024-07-22 14:53:31 -07:00
Karl Stolley ce56c51e33 compose: Adjust popover-button breakpoints for wider left sidebar. 2024-07-22 12:09:42 -07:00
Karl Stolley c7cdda08f9 app_components: Display as flex in presence of show and flex classes. 2024-07-22 11:15:16 -07:00
Sahil Batra 63e82542d9 recent-view: Fix sorting arrows in recent views table heading.
This commit increases right padding for the th elements in recent
views table to make sure that the sorting arrow is visible correctly
for various screen width and font sizes. This change is similar to
what we did for tables in settings UI.
2024-07-22 11:13:51 -07:00
Sahil Batra e0bcf72521 stream_popover: Fix message topic edit without permission to edit channel.
There was a bug when stream_id field was being passed as NaN when user
tried to edit topic of a message if the user did not had permission
to edit the channel.

This commit fixes it to not pass stream_id field in such cases because
channel cannot be changed.

Fixes #30992.
2024-07-22 10:24:37 -07:00
Shubham Padia 3631ebf3bf user_events: Update email in people_dict before updating compose state.
When a user changed an email, we updated the compose and narrow state
before updating that person's email in `people_dict`. This raised a
warning in `get_direct_message_permission_hints` when using
`emails_strings_to_user_ids_string` since that person's email wasn't
updated in `people_dict` by then.
We just changed the order of update so that the email is updated in
`people_dict` before we update compose and narrow state.
2024-07-22 10:23:24 -07:00
Aman Agrawal 1e42d60850 message_view: Ignore fetched messages if user changed view.
If user is no longer in the current message list, then the
messages fetched for it are relevant to the current narrow and can
be safely ignored.
2024-07-21 23:42:07 -07:00
Aman Agrawal cc867de2c5 search: Fix outline of clear search button.
Fixed by including the margin and padding in the
`width: 100%` calculation.
2024-07-21 22:00:49 -07:00
Aman Agrawal e6df844865 message_view: Select message without rerender if possible.
After navigating to a `near` narrow, user is likely to press back
to go back to previous selected message. To support this, we have
to select `then_select_id` without rerender, if we can.

Tested by using breakpoints with `near` links to check if the
correct code is being executed.
2024-07-21 21:03:39 -07:00
Alex Vandiver 14880b2b59 lightbox: Update caching to work with thumbnails.
This moves the cache key for parse_media_data to being the "canonical"
image URL, not the displayed `img src`.  We may not even have the `img
src`, if the thumbnail has not yet been generated.
2024-07-21 18:41:59 -07:00
Alex Vandiver 60fc9eae2f thumbnail: Swap in our preferred thumbnail format. 2024-07-21 18:41:59 -07:00
Alex Vandiver 39d6f4ce10 thumbnail: Show the right spinner based on dark/light mode. 2024-07-21 18:41:59 -07:00
Alex Vandiver b42863be4b markdown: Show thumbnails for uploaded images.
Fixes: #16210.
2024-07-21 18:41:59 -07:00
Aman Agrawal 025fba0a11 views_util: Extract common calls. 2024-07-21 12:39:23 -07:00
Aman Agrawal 2a998e98a6 inbox: Don't capture key input when navbar search is in focus. 2024-07-21 12:39:23 -07:00
Kislay Verma de430f541c search: Improve text about searching public channels.
We use different text for guest users, specifying that they can
only search in channels they can view.
The issue description suggests the same for spectators, but
we already use different text for them.

The search-operators help overlay is also updated with the same.

Fixes #30902
2024-07-20 15:42:41 -07:00
evykassirer d5883cfbb2 search: Empty input on open, and show current narrow search suggestions.
Fixes #30911
2024-07-19 16:55:09 -07:00
evykassirer 26429a81e0 search: Remove freshly-opened logic.
Reverts 991c8451cd, to be
replaced with other logic in an upcoming commit.
2024-07-19 16:55:09 -07:00
evykassirer 962667f81c search: Add function to calculate search query text. 2024-07-19 16:55:09 -07:00
Karl Stolley 707187edbf app_layout: Express calculated max-width in 14px / 1em. 2024-07-19 16:54:53 -07:00
Karl Stolley 800ae6d027 left_sidebar: Adjust left sidebar size, and account for right margin. 2024-07-19 16:54:53 -07:00
Karl Stolley 6793d5148c app_layout: Increase max-width to 1500px. 2024-07-19 16:54:53 -07:00
Karl Stolley 9534e0b5d0 left_sidebar: Size left sidebar to accomodate font, screen sizes. 2024-07-19 16:54:53 -07:00
Sayam Samal 0237ab8724 send_later_popover: Update calendar days icon.
This is a follow-up commit for 1ec5610 and e0ec522, which fixes issues
with the fill-rule of the `calendar-days.svg` icon.
2024-07-19 14:13:12 -07:00
Sayam Samal b3900656fe left_sidebar: Update eye icon to use the new Zulip custom icon. 2024-07-19 14:13:12 -07:00
Sayam Samal 6625ea53d4 left_sidebar: Update house icon to use the new Zulip custom icon. 2024-07-19 14:13:12 -07:00
Vector73 2cf06f34a0 dropdown: Fix partial highlight of list-item on hover. 2024-07-19 11:52:40 -07:00
Sahil Batra 6bc03ad996 stream_ui_updates: Pass missing parameter.
This bug was introduced in 08f35e08a4.
2024-07-19 11:26:44 -07:00
Karl Stolley a0f94d8142 search_pills: Add horizontal spacing to pills in typeahead list. 2024-07-19 09:45:41 -07:00
Karl Stolley fa7592e9a1 search_pills: Correct multi-user DM pill container height. 2024-07-19 09:45:41 -07:00
afeefuddin 92e0ad5c9e left_sidebar_navigation_area_popovers: Fix property name starred_message_counts.
The bug was introduced in 22a58c739c
2024-07-19 09:23:38 -07:00
Karl Stolley ac3ccf57a8 navbar_description: Refactor help-widget icon display. 2024-07-19 09:21:57 -07:00
Karl Stolley 325ab83edb navbar_search: Explicitly specify search input background color. 2024-07-18 16:02:02 -07:00
codewithnick b4c699db85 ui: Fix overflowing time tag in spoiler block.
When rendering a spoiler block that includes a datetime format,
the dropdown button was pushed out of view on smaller devices.
This happened because the time tag was overflowing past
the spoiler blocks width.

This commit intends to fix this problem by adding a `white-space`
attribute to the rendered time tags which will stop it from
overflowing.

Fixes #30641.
2024-07-18 12:37:03 -07:00
Sahil Batra d73fac481b stream-settings: Set max-width for stream creator pill.
We now set max-width on the pill value for stream creator pill
to make sure that the pill does not get too long for long names
and the full name can anyways be seen by clicking on the pill.
2024-07-18 12:34:53 -07:00
evykassirer d23d8b8565 search: Avoid duplicate search results from case sensitivity.
Previously, if you typed "channel: rome" you'd see a result for
both channel "rome" and a second one for "Rome". This commit
deduplicates that by comparing for duplicates without case
sensitivity.

Note that if you fully type "channel: rome" you'll see the
result with a lowercase R instead of uppercase. It would
be a bit involved to change this, so I'm leaving that as
something to address in the future.
2024-07-18 12:33:54 -07:00
Sayam Samal 43e1a643c0 compose_closed_ui: Change mobile "+" button behavior.
This commit removes the popover from the "+" button shown in the closed
compose UI at mobile widths, and instead performs compose actions
directly on-click. The "+" button now opens the compose box with the
channel picker open (even if the user is in a topic or channel view).

This reduces the number of clicks required to start a new message from
the closed compose UI in mobile views, and makes the behavior more
consistent across all the views.

Fixes #30634.
2024-07-18 12:13:03 -07:00
Sayam Samal f545adcb93 compose_closed_ui: Remove unnecessary code updating the new DM button.
The `update_new_direct_message_button` function sets the text for the
new DM button to "New direct message" on every update cycle, which makes
no difference since the button starts with that text and never changes.
2024-07-18 12:13:03 -07:00
Sayam Samal 39d6d3ed27 compose_closed_ui: Make UI in DMs view consistent with non DMs view.
This adds the "New direct message" button back in the closed compose UI
for DMs view, to make the closed compose UI consistent across the app.

Since the closed compose UI is always visible, and one that is likely
to be used frequently, it makes sense to have the same UI across all
the views to avoid the mental overhead of figuring out how to compose
a message in different views.
2024-07-18 12:13:03 -07:00
Aman Agrawal 48edf4c8b8 typeahead: Ignore mouse position once user uses keyboard.
This keeps the first item focused when user uses keyboard.
User can still move the focused item using mouse and click to select it.
Highlighting an item via mouse and then pressing enter would select
the highlighted item.
2024-07-18 11:52:37 -07:00
Sahil Batra 6b1216402f settings: Hide font size and line height inputs when compact mode is checked. 2024-07-18 11:36:53 -07:00
Sahil Batra d8aedc1f8e settings: Fix flashing of information density setting inputs.
We change the code to update the visibility of information
density setting inputs only on successful completion of
request and not on receiving events.

Visibility of inputs is not being live updated on receiving
events because that leads to flashing of inputs when deselecting
the "Compact mode" checkbox due to the data being sent in
different events and data with the client being different for
time till the all events are received.
2024-07-18 11:36:53 -07:00
Sahil Batra 59068c24e9 settings: Pass dense_mode value if changing other settings.
This commit updates code to pass dense_mode value in request
if changing font size or line height settings to some value
other than legacy settings.
2024-07-18 11:36:53 -07:00
Prakhar Pratyush e1f3c54a1d message_edit: Fix tooltip not hidden on closing message edit form.
Bug:
A tooltip appears on hovering over a control button in the
message edit form. Now when the form was closed either using
Esc key (cancel) or Enter / Ctrl + Enter (save), the tooltip
didn't disappear. This resulted in a random tooltip visible
in the message list view.

Fix:
Since tippyjs doesn't hide tooltip even after the element is
hidden we need to explicitly hide the tooltip in those cases.
See https://github.com/atomiks/tippyjs/issues/938

This commit fixes the above mentioned bug by explicitly hiding
the tooltip instance.
2024-07-18 10:52:48 -07:00
Kenneth Rodrigues 2be9774192 integration_url_modal: Fix multiple modals opening.
Earlier the `generate integration url` button (fa-link) was still in
focus even after opening the modal.
This caused the modal to open multiple times when the user pressed the
enter key. This commit fixes that issue by focusing on the input
dropdown when the modal is opened.
2024-07-18 10:46:52 -07:00
Kenneth Rodrigues 5023daaf9b settings_emoji: Fix multiple modals opening.
Earlier the `Add a new emoji` button was still in focus even
after opening the modal. This caused the modal to open multiple times
when the user pressed the enter key. This commit fixes that issue by
focusing on the input field when the modal is opened.
2024-07-18 10:46:52 -07:00
Kenneth Rodrigues 87ff793b5a edit_linkifier: Fix multiple modals opening.
Earlier the `edit` button was still in focus even after opening the
modal. This caused the modal to open multiple times when the user
pressed the enter key. This commit fixes that issue by placing the
carat at the end of the first input field when the modal is opened.
2024-07-18 10:46:52 -07:00
Kenneth Rodrigues 37725e4e9f change_password: Fix multiple modals opening.
Earlier the `change your password` button was still in focus even
after opening the modal. This caused the modal to open multiple times
when the user pressed the enter key. This commit fixes that issue by
focusing on the input field when the modal is opened.
2024-07-18 10:46:52 -07:00
Anders Kaseorg 97753fe3b0 emoji_names: Rebuild with CLDR 45, emoji-data 15.1.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-17 22:49:52 -07:00
Karl Stolley daadf28260 search_pills: Fix subtle but serious alignment bug on user pills. 2024-07-17 14:50:35 -07:00
Karl Stolley 27d5227e48 navbar_search: Make search bar conform to short viewports. 2024-07-17 14:50:35 -07:00
Karl Stolley a86465de54 navbar: Keep descriptions and closed search box from colliding. 2024-07-17 14:37:14 -07:00
evykassirer c622622135 search pills: Decode display value.
https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20quotes.20representation.20in.20pills/near/1890117
2024-07-17 12:27:40 -07:00
evykassirer 05d4e02dcd search pills: Don't re-narrow when deleting pills. 2024-07-17 12:25:59 -07:00
Sanchit Sharma 6dba4cf943 invite_stream_picker_pill: Hide typeahead after backspacing a pill.
Include `hide_on_empty_after_backspace` when
passing opts to `set_up_streams`

Fixes: #30542.
2024-07-17 12:15:45 -07:00
Sanchit Sharma afe9ac7900 typeahead: Add hideOnEmptyAfterBackspace option.
Ensure that for invite modal the typeahead menu does not
display every time a pill is deleted using the backspace
key.
2024-07-17 12:15:45 -07:00
Sanchit Sharma 65635ab948 invite: Increase clickable area to display typeahead menu.
Previously, the .input area was small, restricting the activation
of the typeahead menu to a small region.
2024-07-17 12:15:45 -07:00
Sanchit Sharma 05cc24d2f0 set_up_streams: Fix function to use value from `opts`
Nullish operator has been used for more clarity.
2024-07-17 12:15:45 -07:00
Shubham Padia ce0e2caba1 icons: Remove unused mail.svg.
zulip-icon-mail was removed here.
2024-07-17 12:08:07 -07:00
Shubham Padia 93e2941fb8 compose_box: Replace zulip-icon-mail with zulip-icon-user.
This commit removes all occurences of `zulip-icon-mail`.
2024-07-17 12:08:07 -07:00
Shubham Padia 0565fbb6ff recent_view: Replace fa-envelope with zulip-icon-user.
We don't have any more occurrences of fa-envelope is our codebase now.
2024-07-17 12:08:07 -07:00
Shubham Padia 2f8238d74c inbox: Replace fa-envelope with zulip-icon-user. 2024-07-17 12:08:07 -07:00
Shubham Padia a696294355 user_card_popover: Change icon for `Send direct message`.
Fixes #30918.
This commit also adds a paper plane icon under `send-dm.svg`. `dm` is
used instead of `direct-message` to opt for brevity when using the
icons.
2024-07-17 12:08:07 -07:00
Shubham Padia e5440c7bba user_card_popover: Replace envelope icon with zulip-icon-user.
Fixes part of #30918.
2024-07-17 12:08:07 -07:00
Shubham Padia f77738c235 navbar: Replace fa-envelope with zulip-icon-user.
Fixes part of #30918.
We don't need `align-self: baseline;` for `fa-envelope` set in
`message_view_header` since this is a different icon and it appears
better without it like other icons.
We also don't need the explicit font-size for switching b/w 14px and
16px mode since `zulip-icon` class takes care of that by default.
2024-07-17 12:08:07 -07:00
Karl Stolley 8271c2b083 user_circles: Adjust circles top margin on low-res screens. 2024-07-17 11:37:01 -07:00
Prakhar Pratyush 5cdebcb2dd banner: Update banner text for notify_messages_outside_current_search.
This commit updates the banner text in the case of message sent
while in search view to match the narrow_to_recipient_banner text
displayed in other cases.
2024-07-17 11:35:47 -07:00
Prakhar Pratyush 91e935c695 echo: Fix error during local echo while narrowed to search view.
Earlier, on sending a message while narrowed to a search view
'!can_apply_locally()' resulted in error during local echo.

Reason:
In 'insert_new_messages' the call to 'maybe_add_narrowed_messages'
needs message ID to make a GET request to '/messages/matches_narrow',
but during local echo message ID is not available. We were using
'local_id' (a float) resulting in 400 error response.

Fix:
This commit fixes the bug by skipping the discussed GET request
during local echo.
2024-07-17 11:35:47 -07:00
Prakhar Pratyush 3090247221 process_from_server: Fix message sent in search view not appearing.
Earlier, on sending a new message in a search view it didn't
appear in that view for the sender.

This was because the message event received by the sender
was processed by 'msg_list.view.rerender_messages' which
effectively did nothing because the message is not
rendered in the first place during local echo in that
message list view.

We can't determine locally if the message should be added
to the search narrow. So, we use maybe_add_narrowed_messages
when narrowed to such views.

This fixes the bug and the message appears in the search view.
2024-07-17 11:35:47 -07:00
Shubham Padia 629e6c701c settings: Fix eye icon misaligning with password input on small screen. 2024-07-17 11:05:59 -07:00
Shubham Padia e72b42ec13 settings: Add parent div to all input password elements in same row.
We had to specify margin-bottom as 10px separately for
`modal_password_input`, `password_visibility_toggle` and
`settings-forgot-password` classes. We've added a div that encapsulates
all these 3 elements which are meant to be in the same row and gives it
a common margin-bottom.
This is a refactor commit.
2024-07-17 11:05:59 -07:00
Shubham Padia 2778aa5b0e settings: Fix alignment of `Forgot it` for change your password.
We've removed the unused parent div. We've also removed the class that
was only being used in that div from zulip.css. We've attached a class
to the anchor element now and it has the same name as the class we
removed.
2024-07-17 11:05:59 -07:00
Shubham Padia a4f1c9fd9e settings: Convert password dialog box to use flexbox.
Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/Eye.20icon.20misaligned.20in.20Manage.20your.20API.20key/near/1890711.
The eye icon to show and hide password was misaligned in the 16px info
density mode. But since the icon was using absolute positioning to style
the icon, we took this chance to refactor the element to use flexbox.
We've renamed the `password-div` to `settings-password-div` for settings
specific styling. The eye icon was only broken in settings, and since
the settings and the login/signup stuff the same class was used at is
quite different from each other, it might be better to have two
different classes. The other `password-div` has not been refactored, it
might be better refactored in its own PR along with other similar
elements to use flexbox.
2024-07-17 11:05:59 -07:00
Karl Stolley eb0f72ecef search_pills: Correct border radius to match images. 2024-07-17 10:31:01 -07:00
Karl Stolley 33d2c8fc4d search_pills: Improve grid for correct alignment. 2024-07-17 10:31:01 -07:00
Karl Stolley f738a68bb1 pills: Make --height-input-pill authoritative. 2024-07-17 10:31:01 -07:00
roanster007 47fad72226 narrow: Fix incorrect message_view_header title in `with` operator.
Previously, when a link containing the "with" operator in an incorrect
narrow is loaded, it used to open the correct view with the wrong
title of the message view header.

This commit fixes it by re building the message view header title
in case the narrow for the "with" operator has changed.
2024-07-17 10:15:54 -07:00
roanster007 125ef2a7d4 search: Fix `with` operator to be a valid search term.
This commit adds the "with" operator to be a valid search term,
which is used while rendering search pills.
2024-07-17 10:15:54 -07:00
roanster007 f02c1e321b topics: Fix unnecessary hashchange calls while using with operator.
Previously, while using "with" operator, even when the narrow
was not updated by the operator, hash change requests were
made.

This commit introduces a new variable - "narrow_requires_hash_change"
which determines whether the narrow was updated and thus
requires a hash change or not.

Fixes #30862
2024-07-17 10:15:54 -07:00
Sahil Batra 13eb1381de user_profile: Always include current bot owner in bot owner options.
This change is done to make sure that there is no error if the
bot owner is deactivated as the selected value should always be
present in options.
2024-07-17 10:07:51 -07:00
Shubham Padia 15ea879899 css: Scale font-size for .small buttons.
Fixes #30895.
The root font-size for the app has always been 16px, and it remains the
same when switching between 14px and 16px mode. This leads to
`.small` buttons looking relatively smaller to their surroundings in
16px mode. So, if we use a unit that changes when switching between
modes, we will have to multiple that value by (16/14) so that we don't
change the existing behaviour for the 14px mode and make things smaller.
This commit only affects `.small` buttons, the same named class is used
in other places but does not use rem unit there and therefore does not
require any changes.
The original plan was to use em instead of rem and multiply it by
(16/14 * 0.8), but since em depends on the parent element, there was a
case in the poll button widget where 1em was equal to 16px in the dense
14px mode. While, the right thing to do might have been some refactor to
make it work as desired, the safest thing to do right now might be to
use the --base-font-size-px variable directly for the 9.0 release.
2024-07-17 09:41:43 -07:00
Shubham Padia 16623bf3b7 modal: Scale modal buttons when using 16px mode.
Fixes #30920.

Before this, the buttons remained the same when switching 14px vs 16px
mode because rem was used as the unit and we are not changing the root
font-size for either of the 14px or 16px mode. Root font-size is 16px in
both cases.

We've removed 0.875 out of the 0.875rem for the font-size of the buttons
since 0.875rem is equal to 14px. It has been replaced with the base font
size variable.

We've removed the rem values for padding and border-radius and written
the pixel values directly taking in account 1 rem = 16px. We don't scale
the padding and border when switching b/w 14px and 16px mode, so we
should not do that here too. While keeping the rem around would be the
same as the current pixel value in either of the modes, removing the rem
is still better since we've concluded here that we don't need to scale
the padding and border-size b/w modes.
2024-07-17 09:40:41 -07:00
evykassirer 5e975cd54b search: Remove all pills on backspace from fresh open.
More context:
https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20backspace.20doesn.27t.20clear.20all.20selected.20search.20pills
2024-07-16 23:32:21 -07:00
evykassirer 9865384d06 input pill: Differentiate how pills are removed in the callback. 2024-07-16 23:32:21 -07:00
Aman Agrawal 155f34412e search: Fix search suggestions not wrapping on overflow. 2024-07-16 23:29:45 -07:00
Aman Agrawal c82012e5e2 typeahead: Move all global typeahead styles together. 2024-07-16 23:29:45 -07:00
Anders Kaseorg 34d3b2302e blueslip_stacktrace: Handle thrown null or undefined.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-16 23:27:27 -07:00
Prakhar Pratyush cfba2e8837 stream_settings: Rename stream to channel in stream created banner.
When an administrators create channels that they are themselves
not initial subscribers, a channel creation confirmation banner
is displayed in the settings panel.

This commit updates the term "stream" to "channel" in the banner.
2024-07-16 23:27:03 -07:00
Anders Kaseorg 3a535cacdc dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-16 23:25:37 -07:00
Anders Kaseorg f5e2afd693 stylelint: Fix shorthand-property-no-redundant-values.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-16 23:25:37 -07:00
evykassirer 074542e7ae search: Always reset the search bar when opening it.
Some time ago, I added a condition to not reset
the search bar if the user had already started
typing, so that we wouldn't erase what they'd
started typing. But we encountered a situation
where the search bar can be opened with text in
it: clicking "searching all public channels"
from a search view. We want to reset the searchbox
to add the `channels: public` pill.

I tried to replicate original issue I encountered
where the search box resetting was clearing user
input and couldn't replicate it. So for now I'm
just removing that if statement.
2024-07-16 16:51:30 -07:00
evykassirer d634d202e3 search pills: Render message header when search content changes.
Before we prevented the message header rendering, but this was
tricky for several reasons, and just re-opening the search bar
seems like a better strategy.

More context here:
https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20search.20suggestion.20narrow.20from.20recent.20and.20inbox/near/1890393
2024-07-16 16:50:39 -07:00
evykassirer ad3490ce91 search: Remove extra call to narrow_to_search_contents_with_search_bar_open.
This is redundant, because the typeahead will always call this
through `updater`.
2024-07-16 16:50:39 -07:00
evykassirer e36891923b search: Ensure cursor is at end of input after focus. 2024-07-16 16:50:39 -07:00
roanster007 61f6ec0829 narrow_operators: Add `with` operator to `filter.is_conversation_view`.
This commit updates "filter.is_conversation_view" to be true for
"with" operator. This is important because essentially, the "with"
operator lands you in the same view as the channel-topic narrow
or the "dm" narrow i.e., the last unread message of the narrow.

Hence, the "with" narrow should be handled in a similar way
while determining whether to allow automatically marking
messages as read, or displaying the unread banner, etc.

Fixes #30863
2024-07-16 16:46:39 -07:00
Sahil Batra 3980507599 settings: Do not allow last active value to wrap randomly.
We do not allow the "Last active" values in users list to
wrap at random breakpoints and instead wrap at end of the
words.
2024-07-16 14:52:29 -07:00
sujal shah fa16f7720f settings: Drop email column on narrow screens.
Since we access email through pills,to improve the
visibility on a narrow screen, if the screen width
goes below 'lg_min' or 992px drop the email column from users,
deactivated users, bots, channels, groups using a new classname
'settings-email-column'.
2024-07-16 14:52:29 -07:00
sujal shah b5e215824b organization_settings: Convert name to pills.
Display pills Using user_display_only_pill.hbs template
before users are displayed as links after this commit
convert them to pills.

Fixes #24229.
2024-07-16 14:52:17 -07:00
Sahil Batra f937669ba1 user_pill: Show deactivated icon in user_display_only_pill.
This commit adds code to show the deactivated icon for
deactivated users.
2024-07-16 14:52:17 -07:00
Sahil Batra 5b1326668f settings: Control showing custom font size and line height settings. 2024-07-16 14:04:19 -07:00
Sahil Batra b6905777d0 settings: Use checkbox setting to toggle between 14/122 and 16/140.
The "Dense mode" checkbox is renamed to "Compact mode" and is used
to toggle between changing the font-size and line-height settings
between 14/122 and 16/140 configurations.
2024-07-16 14:04:19 -07:00
Prakhar Pratyush df7ed437c2 compose: Show banner to explain interleaved view messages fading.
In an interleaved view when composing a message we fade messages
which the user is not replying to, to reduce the chance they send
a message to a recipient they didn't intend to.
Also, it reduces the visual/cognitive processing required
to figure out where their message is going to go.

But, it's not necessarily clear to users that what the
fading means, so this commit adds a one-time compose banner
to explain what's going on the first time this comes up.

Fixes part of #29076.
2024-07-16 13:52:30 -07:00
Prakhar Pratyush 35380b095f compose: Show banner to explain non interleaved view messages fading.
In a non interleaved view when composing a message to another
conversation we fade messages which the user is not replying to,
to reduce the chance they send a message to a recipient they didn't
intend to. Also, it reduces the visual/cognitive processing required
to figure out where their message is going to go.

But, it's not necessarily clear to users that what the
fading means, so this commit adds a one-time compose banner
to explain what's going on the first time this comes up.

Fixes part of #29076.
2024-07-16 13:52:29 -07:00
Alex Vandiver 556b92810b thumbnail: Advertize the thumbnail formats at client registration. 2024-07-16 13:22:15 -07:00
Karl Stolley 502b9a76a9 compose: Ensure color concord across compose and edit boxes. 2024-07-16 13:12:21 -07:00
Pratik Chanda f7c3f1414d search_suggestion: Change suggestion string for has: operator.
Earlier in search suggestion, has: operator returned two different
suggestion string which were `messages with one or more links` and
`messages that contain links`.

This commit changes this to a consistent suggestion string.

Fixes: zulip#30908
2024-07-16 11:03:08 -07:00
Karl Stolley 52d8813214 left_sidebar: Calculate top based on prominent row height. 2024-07-16 10:16:10 -07:00
Karl Stolley b2f1cdbce3 left_sidebar: Remove unreachable filter-topics style. 2024-07-16 10:16:10 -07:00
Sayam Samal 1ec5610d7a send_later_popover: Change calendar days icon.
This is a follow-up commit for e0ec522f70,
which fixes some issues with the `calendar-days.svg` icon.
2024-07-16 09:39:48 -07:00
Shubham Padia d7a3b87020 settings_linkifiers: Make edit and delete buttons rounded.
All the buttons in settings have become rounded but these were still
square with no border-radius. Added the `rounded` class for them to have
the standard border-radius.
2024-07-16 09:38:53 -07:00
Karl Stolley e2623f3937 typeaheads: Space channel icons with flexbox. 2024-07-16 09:31:27 -07:00
Sayam Samal 2425f7da01 stream_popover: Fix stream lock icon position in stream actions popover.
This commit overrides the margin-top set on the stream lock icon at the
top-level in `app_components.css`, since we don't need to pull up this
icon for the stream actions popover header.
2024-07-16 09:27:56 -07:00
Kislay Verma 42a7b7e982 compose: Support `channel` in transforming stream-topic links.
This commit extends the work in #29302 to support the new
"channel" operator, which is synonymous to the "stream" operator
in transforming stream-topic links to the #**stream>topic** syntax.
2024-07-15 14:41:50 -07:00
roanster007 5f3de977d9 narrow_state: Fix `_possible_unread_message_ids` when `with` operator.
This commit removes the unnecessary conditionality that used
to check if the channel and topic of the filter operands in the
"_possible_unread_message_ids" method while checking for
"can_bucket_by("channel", "topic", "with")".

This conditionality is unnecessary essentially because the code path
is executed only when "requires_adjustment_for_moved_with_target"
is false, which happens only after the narrow containing the "with"
operator is adjusted to the correct narrow. Else, it remains true.
2024-07-15 14:00:59 -07:00
roanster007 522f6cfaf9 filter: Fix `adjusted_terms_if_moved` handling for non stream messages.
Previously, when "adjusted_terms_if_moved" was called for non stream
messages, it used to return "null" for adjusted terms. This is true
for some extent since the non stream messages can not be moved.

However, in case of narrow containing "with" operator, this would
be buggy since there, we want the narrow terms to be adjusted
according to the "with" operand to point to the current narrow,
rather than returning null.

This commit updates the method to return null only if  the "raw_terms"
dont contain "with" operator. Else, adjust the "raw_terms" according
to the message.
2024-07-15 14:00:59 -07:00
Varun Singh 884317e407 server_message: Create zod schema to parse message recieved from server.
The commit creates a `server_message.ts` module which
will home our `zod` schema for the messages received
from server. We can then import the schema to parse
the data in needed modules at the API boundaries.
This will also help us write better tests.
2024-07-15 13:55:13 -07:00
sujal shah bdd39f4c67 stream_settings: Use IDs Instead of Classes for Stream Creation Form.
This change help us stay consistent with usergroup section by providing
unique IDs for each section. Before we have classes for the section
elements, but now instead of adding unique classes to each
section element we add IDs, that make more sense.
2024-07-15 13:37:23 -07:00
Sayam Samal cf3fd10ad0 popovers: Allow user group popover elements to scale with font size. 2024-07-15 13:36:23 -07:00
Sayam Samal 8ca02d8e38 popovers: Allow user card popover elements to scale with font size. 2024-07-15 13:36:23 -07:00
Sayam Samal 5853848640 popovers: Fix wrapping in condensed popover when count is present. 2024-07-15 13:36:23 -07:00
Sayam Samal 6a6dd2543c popovers: Update `max-width` of popovers to scale UI with font size.
This commit updates the `max-width` of popovers to relative length units
to allow the UI to scale with the font-size. This helps with the multi-
line popover options which we want to break evenly across different
sizes.

The `max-width` of `97vw` still applies to all popovers, and ensures
that the UI does not overflow the viewport.
2024-07-15 13:36:23 -07:00
Sayam Samal fa59200a03 popovers: Allow popover hotkey hints min-width to scale with font size.
A `min-width` is applied to the popover hotkey hints to ensure that they
are nearly square when only one character is present. This `min-width`
was previously using rem units, which did not scale with the font size
of the popover font.

This commit changes the `min-width` to use `em` units, which will scale
with the font size of the popover hotkeys.
2024-07-15 13:36:23 -07:00
Sayam Samal 2a81bda72e popovers: Allow popover options' padding to scale with font size. 2024-07-15 13:36:23 -07:00
Sayam Samal 75780102f4 popovers: Add font-scaling for tab pickers. 2024-07-15 13:36:23 -07:00
Sayam Samal 9b2e1d895d popovers: Fix for Karl's previous commit on font scaling. 2024-07-15 13:36:23 -07:00
Karl Stolley a2de1a5f98 popovers: Allow font-size-based lengths to scale. 2024-07-15 13:36:23 -07:00
Karl Stolley 413ff92da7 popovers: Explicitly set base font-sizes for popovers. 2024-07-15 13:36:23 -07:00
evykassirer df23ab32e0 search pills: Always pass quiet=true to clear().
I missed one call.

Followup to https://github.com/zulip/zulip/pull/30889#issuecomment-2229106232
2024-07-15 13:08:39 -07:00
Aditya 39f84ae840 bookends: Remove the word `channel`.
This commit removes the word `channel` from the
subscribe/unsubscribe bookends in the message feed.

Fixes #30803
2024-07-15 12:43:47 -07:00
Shubham Padia 4207c985b2 settings: Fix Add channel button relying on min-width for padding.
Fixes #30674.
When having a bigger translation string, it was noticed that Add channel
button had no horizontal padding. But this wasn't true for a shorter
string. The button was using `min-width` as a proxy for padding. When
the width of the button went beyond the minimum 100px, the padding
disappeared.
`.new-style` properties will apply here for the standard button
styling, where the standard horizontal padding is important for the fix.
But we can't use the vertical padding of that class since we want the
button to align with the filter to the right of it which is smaller than
a standard button, so we set the vertical padding to 0 and give the
button a height of 30px. This height is used at multiple places to be
the same as the search filter, e.g. roles dropdown in users tab.
We've also changed the margin from 11px to 12px to be the same as the
filter on the right.
2024-07-15 12:43:06 -07:00
Sahil Batra 3fe8ad37df settings: Refactor css for users and bots table.
This commit makes the selectors for CSS applied to users
and bots table more specific since the classes used
before are generic and can be used at other places
as well.
2024-07-15 12:42:08 -07:00
Sahil Batra 413892ddb1 settings: Use more specific selector for file name CSS.
This commit makes the selector used to apply CSS to
file name column in uploaded files table more specific
as the class name used before is generic and can be
used at other places as well.
2024-07-15 12:42:08 -07:00
Sahil Batra cb0a0599e2 linkifier-settings: Remove unnecessary div.
The div element has no classes and thus is not used to apply
any CSS or anything, so this commit removes it.
2024-07-15 12:42:08 -07:00
evykassirer ff99a6a04e search: Update narrow when search bar contents change.
further discussion on this change here:
https://chat.zulip.org/#narrow/stream/101-design/topic/.F0.9F.8E.AF.20search.20pills.20.2326803/near/1884358
2024-07-15 12:38:22 -07:00
evykassirer 6510330003 input_pill: Allow removeAllPills to be called with quiet=true. 2024-07-15 12:38:22 -07:00
evykassirer 56149a5a6c message_view: Fix bug in no-operator alias.
`is:home` is invalid, `in:home` is the correct term.
2024-07-15 12:38:22 -07:00
Shubham Padia e5fd09aaaa i18n: Use user_notification_settings for tr_tag tests.
Before this, settings_tab.hbs was being used to test the `{{#tr}}`
syntax for tagging strings for translation. That was introduced in
82b5d9304b, when the template in question
was small enough to mock.

There are smaller templates than `user_notification_settings` but since
none of them are used as a partial in another template, we can't use
them for this test. This is because we can't test partial block
handling part of the tr tag in templates.js with those templates. Since
`user_notification_settings` has only 1 partial, it will atleast make it
easier for us to know which arguments to pass to the template; in
comparison to `settings_template` where it was hard to determine which
arguments were supposed to be passed to the template.

I've also renamed the test to not say `tr_tag` since it confused me with
the HTML <tr> tag when trying to read the test.

Fixes https://github.com/zulip/zulip/pull/30824#discussion_r1677204395
2024-07-15 12:35:41 -07:00
Aman Agrawal 6fa1c2d3bf subscriptions: Keep individual tabs in the same row.
Fixes #30675
2024-07-15 12:35:00 -07:00
Aman Agrawal b91b643448 dropdown: Fix dropdown partially hidden at small heights.
We generalize the approach used for compose box to apply it for
all the dropdowns.
2024-07-15 12:33:00 -07:00
Aman Agrawal bef8f36518 message_fetch: Don't let recent view errors interrupt msg insertion.
We catch any errors in recent view during message insertion to avoid
it from failing.
2024-07-15 11:35:00 -07:00
Shubham Padia 136391e0a4 lightbox: Remove unnecessary `.small` from lightbox buttons.
All 3 properties of `.small` were being overriden by
`#lightbox_overlay .media-actions .button` and the class is no longer
needed there.
The other selector still uses rem, so it might be good to revisit this
and see how 14px/16px scaling currently works on those buttons.

Preparatory commit for #30895.
2024-07-15 10:39:31 -07:00
Shubham Padia aa74de182e compose: Remove unnecessary `.small` class for compose buttons.
For buttons in the compose box using `.small`, all properties except
min-width were already being overriden in compose.css. So we added
`min-width: inherit` to compose.css and remove the `small` class.

Preparatory commit for #30895.
2024-07-15 10:39:31 -07:00
afeefuddin bef77c8cca edit_embedded_bot: Check if service is defined.
It's likely that service is undefined which results in
error while loading the template. We should check if the
service and service.config_data is defined or not to avoid
throwing errors.
2024-07-15 10:32:35 -07:00
Sayam Samal 4457225d35 bootstrap: Remove legacy `nav nav-list` classes and related CSS.
With the redesign of all popovers completed, we have transitioned away
from the legacy Bootstrap-based popover system. As a result, the
Bootstrap `nav nav-list` classes are now obsolete and no longer used
in the codebase.

This commit, a part of the efforts to clean up the legacy Bootstrap CSS,
removes these unused classes and any related CSS workarounds.

Fixes #26990.
2024-07-15 10:00:22 -07:00
Sayam Samal dfc18518db send_later: Remove Bootstrap `nav nav-list` CSS classes dependency.
This is a prep commit for removing `nav nav-list` classes from all
popovers.

The send later modal, although not being a popover specifically, was the
last place in the code still using `nav nav-list` classes.
2024-07-15 10:00:22 -07:00
Aman Agrawal 7b9d10ae5d message_events: Fix moved messages not rendered if they are not cached.
We used to just drop moved messages from the list of messages to
update if we didn't have them cached. So, if the user is in the
narrow where messages were moved to, user will not see the moved
message if they were not cached locally.

To fix this, we re-render the narrow after fetching messages from
the server.

We don't want to use `fast_track_current_msg_list_to_anchor` here
since that function assumes that current rendered state of the
message list is correct which is not the case here.
2024-07-15 06:48:52 -07:00
afeefuddin 9a57505f63 help: Convert module to TypeScript. 2024-07-14 22:34:23 -07:00
afeefuddin c138082eb3 help: Remove unnecessary onClick event listener.
ClipboardJS attaches event listener to the object when an
instance is created. We don't need to add an additional onClick
event listener to invoke it's functionality.
2024-07-14 22:34:23 -07:00
Vector73 d21ee6fa23 api: Deprecate uri and add url parameter in "/user_uploads" endpoint. 2024-07-14 22:32:36 -07:00
Vector73 28ce2684bb user_groups: Add `is_empty_group` function to check for nobody group.
Removes hardcoded checks for "role:nobody" by checking if the given group
is empty.
2024-07-14 22:29:18 -07:00
Shubham Padia c40698b6b3 display_settings: Extract out different sections into their own file.
The file has becoming longer over time, it would be good to separate it
into different files for better readability.
2024-07-14 22:15:03 -07:00
Shubham Padia ada92f502e display_settings: Split `Advanced` into `Information` and `Navigation`.
Fixes #30776.
`.advanced-settings-status` was being used at a few places for User list
status, that's why it's been replaced with
`.information-settings-status`.
2024-07-14 22:15:03 -07:00
Shubham Padia e1186f8256 display_settings: Remove unnecessary advanced-settings-status hide.
This was introduced in 87635b9e32 and kept
getting renamed over time and did not get deleted. Other statuses'
`.hide()` got deleted over time. I'm not sure why we were using the hide
in the first place, but manual testing shows no behaviour change when
removing it.
2024-07-14 22:15:03 -07:00
Shubham Padia b44fd5365c display_settings: Rename `get_all_preferences`.
We've renamed `get_all_preferences` to
`information_section_checkbox_group`. We've also converted it from a
function into a dictionary since it doesn't contain any page_params
variables anymore. This is a preparatory commit for adding a new
`Information section` as part of a layout change for this page.
2024-07-14 22:15:03 -07:00
Shubham Padia 39af05f475 display_settings: Move out `high_contrast_mode` from checkbox group.
`high_contrast_mode` was part of the checkbox group obtained by calling
`get_all_preferences`. For the new layout change, it will not be a part
of that group and this is a preparatory commit seperating it out from
that group. We will also rename that checkbox group in future commits.
2024-07-14 22:15:03 -07:00
Shubham Padia 554e9f7e29 settings: Move Information density setting to the General section. 2024-07-14 22:15:03 -07:00
Shubham Padia 60fda072e6 settings: Move dense mode setting to the General section. 2024-07-14 22:15:03 -07:00
Shubham Padia cfd46ac44e settings: Move render_only settings to their own dictionary.
These values were only a part of `DisplaySettings` type objects. We're
moving them out of these type of objects to be a standalone object of
its own. This will make it easier to reference in the next few commits
when those `DisplaySettings` objects would be broken down into different
sections.
We've excluded the new function from coverage since there's not much to
be tested there and similar settings functions do the same.
2024-07-14 22:15:03 -07:00
evykassirer 23e7363850 input pills: Focus input after removing a pill with x button.
We decided this is more likely to be where the user wants the
focus to be after exiting a pill with the x button.

CZO:
https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20message.20search.20'x'.2Fdelete/near/1886757
2024-07-14 22:10:24 -07:00
Aman Agrawal c82c0715ca personal_menu: Don't show user local time.
Fixes #30044
2024-07-14 22:09:20 -07:00
evykassirer f23fdede67 search pills: Align icons on top row.
This reverts #30804. We need a followup PR to address the
issue that PR was trying to solve without breaking icon
alignment.
2024-07-13 11:38:11 -07:00
Vector73 d895ca287f tooltips: Make size of tooltips consistent.
Uses a variable for defining font-size on tooltips instead of `1em`.
2024-07-13 07:34:21 -07:00
Tim Abbott b747bd4487 narrow_state: Disable coverage requirement for unlikely case.
I'm not actually sure if this is possible; it's been copy/pasted from
the channel/topic code path, but even with that one, it seems like the
topic being `undefined` is impossible (that's not how operators work),
and the channel being undefined might be something that should fail in
`Filter` initialization, not here.
2024-07-13 07:28:52 -07:00
Aman Agrawal 70be9e8c51 narrow: Implement rendering of `with` narrow operators.
Adds server and web app support for processing the new `with`
search operator.

Fixes part of #21505.

Co-authored-by: roanster007 <rohan.gudimetla07@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-07-13 07:18:24 -07:00
Vector73 e9b796c0be group_settings: Change tooltip on add members input box. 2024-07-13 07:04:08 -07:00
Aman Agrawal b5b3391d0d typeahead: Fix alignment of secondary text of typeahead. 2024-07-13 07:03:46 -07:00
Aman Agrawal a46b075e0e typeahead: Restore line height to original value.
e5e5ba6cea reduce the line height
of the typeaheads, which doesn't look for stream typeaheads. We
restore it back to original value.
2024-07-13 07:03:46 -07:00
Shubham Padia 054f08c6df user_group_pill: Exclude inactive members from pill.
While using the pill in `stream_create`, it was noticed that deactivated
users were also part of the user_ids returned by the user_group_pill,
which we do not want to do.
This pill is used in two areas: compose box and stream create/edit.
This commit will only affect stream create/edit since compose box was
just using the typeahead data from user_group_pill and nothing else.
Stream and user pill handle inactive users already, so no change is
needed there.
2024-07-12 15:22:50 -07:00
Shubham Padia e9166fe6f7 user_group_pill: Internationalize display_pill string. 2024-07-12 15:22:50 -07:00
Shubham Padia 5b57ed959e user_pill: Use group pills to add all users.
Fixes #30690.

Before this, we were adding all users to subscriber list without adding
any pill. But, since we want pills to be the source of truth for adding
the subscribers, we will just add the `role:everyone` pill from now on
whenever `Add all users` is clicked.

While we can just directly call `pill_widget.appendValue` in
`stream_create_subscribers`, it's better to expose an API from
`add_subscribers_pill` and use that. This lets us control how appending
an item would work for subscriber pill in a single place.
2024-07-12 15:22:50 -07:00
Shubham Padia 2b572628d0 user_group_popover: Don't show group settings link for system groups.
System groups are immutable and that's why we should remove the group
settings link from the group popover for system groups.
2024-07-12 15:22:50 -07:00
Shubham Padia 20f83b944f user_group_popover: Add support for displaying subgroup members.
We list all the members of a group including recursive subgroup members
in the user group popover.

We also add another change in this commit to show `Everyone` if the
group name is `role:everyone` by using
`user_groups.get_display_group_name`.
2024-07-12 15:22:50 -07:00
Shubham Padia be5e0d4648 user_group_pill: Hardcode `Everyone` in display name.
For system groups, the directive is that we should use the description
as the display name. But in case of `role:everyone`, the description is
`Admins, moderators, members and guests`, while for the
`user_group_pill`, we want to display a simpler and succinct message:
`Everyone`. We've only hardcoded this for user_group_pill since we don't
want to display the name as `Everyone` anywhere else yet.

We've also exposed a method called `get_display_group_name` which will
be used in later commits to get the group display name.
2024-07-12 15:22:50 -07:00