Commit Graph

5508 Commits

Author SHA1 Message Date
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