Commit Graph

59537 Commits

Author SHA1 Message Date
Alex Vandiver 49c0f7306e thumbnail: Increase logging level to ERROR and above.
Warnings are quite common when dealing with bogus image data.
2024-07-12 13:26:47 -07:00
Alex Vandiver 262689da76 thumbnail: Fix MAX_EMOJI_GIF_FILE_SIZE_BYTES check to be post-resize.
This check was intended to check the post-resized image size, not the
pre-resized image.
2024-07-12 13:26:47 -07:00
Alex Vandiver 544d3df057 thumbnail: Stop applying MAX_EMOJI_GIF_FILE_SIZE_BYTES before resizing.
b14a33c659 attempted to make the 128k limit apply _after_ resizing,
but left this check, which examines the pre-resized image size.
2024-07-12 13:26:47 -07:00
Alex Vandiver 54f2fabac0 thumbnail: Still emoji are always pngs. 2024-07-12 13:26:47 -07:00
Alex Vandiver 6110ac7339 emoji: Use a transaction, rather than create and delete-on-fail. 2024-07-12 13:26:47 -07:00
Alex Vandiver 2b3da0e70f fixup! thumbnail: Fix MAX_EMOJI_GIF_FILE_SIZE_BYTES check to be post-resize. 2024-07-12 13:26:47 -07:00
Alex Vandiver f6b99171ce emoji: Derive the file extension from a limited set of content-types.
We thumbnail and serve emoji with the same format as they were
uploaded.  However, we preserved the original extension, which might
mismatch with the provided content-type.

Limit the content-type to a subset which is both (a) an image format
we can thumbnail, and (b) a media format which is widely-enough
supported that we are willing to provide it to all browsers.  This
prevents uploading a `.tiff` emoji, for instance.

Based on this limited content-type, we then reverse to find the
reasonable extension to use when storing it.  This is particularly
important because the local file storage uses the file extension to
choose what content-type to re-serve the emoji as.

This does nothing for existing emoji, which may have odd or missing
file extensions.
2024-07-12 13:26:47 -07:00
Alex Vandiver 62a0611ddb emoji: Pass down content-type, rather than guessing from extension. 2024-07-12 13:26:47 -07:00
Alex Vandiver f3473defe1 transfer: Log when local emoji files are missing. 2024-07-12 13:26:47 -07:00
Alex Vandiver fa28e3aa0f tests: Split up test_upload.EmojiTest into test_thumbnail. 2024-07-12 13:26:47 -07:00
evykassirer 57cb4321b1 search pills: Align typeahead text with pills. 2024-07-12 13:25:36 -07:00
PieterCK f5a834c2d6 integration-docs: Update Jotform for new doc format.
Part of #29592.
2024-07-12 13:21:07 -07:00
PieterCK e034a715cb integration-docs: Update JSON formatter for new doc format.
Part of #29592.
2024-07-12 13:21:07 -07:00
PieterCK ecbbf53c0e integration-docs: Update Greenhouse recruitment for new doc format.
Part of #29592.
2024-07-12 13:21:07 -07:00
PieterCK 0e967e4633 integration-docs: Update Harbor for new doc format.
Aside from updating the doc structure, this commit
also rephrases step 4 to make it read better. The
list of supported events in step 5 is also removed.

Part of #29592.
2024-07-12 13:21:07 -07:00
Tim Abbott 4b6393955b buddy_list: Rename total_subscriber_count for clarity. 2024-07-12 13:10:44 -07:00
Tim Abbott 4228d32639 buddy_list: Rewrite total_subscriber_count.
This much more simply does what it sounds like it does.
2024-07-12 13:10:44 -07:00
Pratik Chanda 503b66f52a buddy_list: Fix incorrect user count in sidebar with bot as recipient.
Earlier in right sidebar user count, it would show less user count
when a bot was present as a recipient in the conversation. Since the
sidebar shows active human users only, user count should not
consider bots in the conversation.

This commit fixes the behaviour by adding all the subtracted bots
in from user count.
2024-07-12 13:10:44 -07:00
Sayam Samal 757bb8c68d user_card_popover: Update `max-width` 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.

The `max-width` of `97vw` still applies to the popover, and ensures
that the UI does not overflow the viewport.
2024-07-12 13:03:40 -07:00
Sayam Samal 724c91d127 user_card_popover: Add user-card-specific class to the email field. 2024-07-12 13:03:40 -07:00
Sayam Samal 50645ffd7e user_card_popover: Use different selector for clear status tooltip. 2024-07-12 13:03:40 -07:00
Sayam Samal a20ac9a831 user_card_popover: Fix keyboard nav for right sidebar popovers. 2024-07-12 13:03:40 -07:00
Sayam Samal 97f84b4aae user_card_popover: Scope related css inside a common class. 2024-07-12 13:03:40 -07:00
Sayam Samal ad121335e3 user_card_popover: Add medium avatar back on mount. 2024-07-12 13:03:40 -07:00
Tim Abbott df1fc71685 user_card_popover: Skip copy icon for keyboard focus.
It's invisible unless the email is cropped, and even if it weren't,
the menu is more likely of interest to a keyboard user.
2024-07-12 13:03:40 -07:00
Tim Abbott 94a0941b0c user_card_popover: Fix on_mount hooks not being called.
The extra undefined parameter appears to be a bug introduced in
5142f1279a45d00320904b369b092f0c9c116b90; when the show_as_overlay
parmater was dropped, the other callers to show_user_card_popover did
not have their extra argument removed.

This had the effect of not setting initial keyboard focus when opening
the popover.
2024-07-12 13:03:40 -07:00
Sayam Samal 6ee491697f user_card_popover: Improve outline styling for focused elements.
- Adds focus outline to the custom profile field links.
- Replaces the grey outline of the copy and status buttons with the
  blue one used across the popover options.
- Adds hover state styling to the focus state styling for the copy
  buttons.
2024-07-12 13:03:40 -07:00
Sayam Samal 7232ff68f8 user_card_popover: Enable keyboard nav for custom field copy buttons. 2024-07-12 13:03:40 -07:00
Sayam Samal 8ead2035bf user_card_popover: Enable keyboard navigation for email copy button. 2024-07-12 13:03:40 -07:00
Sayam Samal 2ee9d80c7f user_card_popover: Add tooltip for status clear button.
Previously, the tooltip for the status clear button was scoped to only
the personal menu popover. This commit moves that logic to `tippyjs.ts`
and adds support for the status clear button in the user card popover.
2024-07-12 13:03:40 -07:00
Sayam Samal 1f6fcb81e8 user_card_popover: Cleanup user card popover after redesign.
As a follow-up to the user card popover redesign, this commit removes
the unused code and styles from the user card popover.

- Removed tooltip logic for user name and user type, since we now
  display them in full without any ellipses.

- Removed unused css whose class names are no longer used in the
  user card popover.

- Removed additional styling needed to handle font awesome and zulip
  custom icons, used in the older design.
2024-07-12 13:03:40 -07:00
Sayam Samal 5a123e57ce user_card_popover: Align user info to popover header's vertical center.
This commit aligns the user info, which contains the user's full name
and type, to the vertical center of the user card popover's header.

With this, the user info is aligned in the center of the popover header
for short names, and then for the longer names, the user info eventually
aligns to the top and the rest of the content are pushed down.
2024-07-12 13:03:40 -07:00
Sayam Samal dd2739a7e1 user_card_popover: Update the hover and active colors of copy button.
Using the new color palette defined in the previous commit, this commit
updates the hover and active colors of the copy button in the user card
popover.

This also adds a background to the copy icon on hover and active states.
2024-07-12 13:03:40 -07:00
Sayam Samal 84bf694257 css: Add Zulip color palette to app_variables.css.
This commit adds the new Zulip color palette, as css custom properties
to the app_variables.css file. Defining it in the app_variables.css file
allows us to visualize the colors in the editor's autocomplete dropdown
when we use these color values for defining other component based css
variables.

Since hex color values are used in defining the color palette, we
disable the `color-no-hex` stylelint rule for that part of the file.
2024-07-12 13:03:40 -07:00
Sayam Samal d707c9f779 user_card_popover: Change success behavior of the email copy button.
Previously, when the email was successfully copied via the email copy
button, the email in the user card popover was replaced with a "Email
copied!" message.

This commit replaces this behavior with a more subtle approach, where
only the tooltip of the email copy button changes to "Copied!".
2024-07-12 13:03:40 -07:00
Sayam Samal eb5bef8ff5 user_card_popover: Redesign user card popover for unknown user.
This commit extends the user card popover redesign to the case where
the guest is not allowed access to view some of the other users'
profiles due to a change in the
"Who can view all other users in the organization" permission.

Fixes #27338.
2024-07-12 13:03:40 -07:00
Sayam Samal 9bd8a0c72c user_card_popover: Move manage user menu options to user card popover.
This commit removes the manage user menu popover and moves the
options contained within it directly to the parent user card popover.
2024-07-12 13:03:40 -07:00
Sayam Samal 7a903e6336 user_card_popover: Align status emoji to the top for multi-line status. 2024-07-12 13:03:40 -07:00
Sayam Samal 258e2a7297 user_card_popover: Fix clear status icon padding.
The clear status icon was not properly aligned with the text in the user
card popover, due to additional padding on the icon. The reason for this
padding was to ensure correct focus ring offset, so to fix this issue,
without breaking the focus ring, this commit sets the `outline-offset`
to `0`.
2024-07-12 13:03:40 -07:00
Sayam Samal 58357dfd75 user_card_popover: Fix user avatar shrinking on long status text. 2024-07-12 13:03:40 -07:00
Sayam Samal 60d1993ed8 user_card_popover: Redesign popover using the new `popover-menu` theme.
As part of the popover menu redesign, this commit redesigns the user
card popover using the new "popover-menu" tippy theme and improves
accessibility by using appropriate ARIA attributes.
2024-07-12 13:03:40 -07:00
Shubham Padia c5d70cdc1d settings: Do not execute hotkey inside any users tab filter input.
We changed the scope of the selector to just the switcher. This means
that the hotkeys will only run when the user focuses on that element.
This follows the same pattern as the `Personal` and `Organization` tab
switchers which limit the hotkey area to their tab list and not the
content. If we want to use hotkeys inside the content, just filtering
out INPUT elements in keydown_util might be better.
Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20Org.20settings.20user.20search.20does.20not.20work.20with.20vim.20hotkeys.2E/near/1882313
2024-07-12 11:51:40 -07:00
Shubham Padia a2f2b52c2d left_sidebar: Stop event propagation on DM filter click.
Before this, in the onclick event for
`#direct-messages-section-header.zoom-in`, we were filtering out the
class for the direct messages filter, and not activating a narrow on
trying to input on the filter. This was fragile, so we've added an
onclick listener to the direct messages filter which will do nothing
else than stopping the event propagation upto direct messages section
header.
Fixes https://github.com/zulip/zulip/pull/30332#discussion_r1669198527.
2024-07-12 11:32:49 -07:00
Shubham Padia 6c3707f484 left_sidebar: Move DM section header id to top level in css file.
This is a refactor and should not introduce any visual changes.
Fixes https://github.com/zulip/zulip/pull/30707#discussion_r1669110661.
2024-07-12 11:32:49 -07:00
Aman Agrawal 135f31468f bootstrap_typeahead: Fix not being displayed on mobile.
`$container` was not mounted when `show` called on mobile, likely
due to slower processing on mobile compared to web, so we ensure
$container is mounted to fix the `show` call having no effect.
2024-07-12 11:08:47 -07:00
Aman Agrawal e75ac2bfd1 dropdown_widget: Fix dropdown not displayed on mobile.
This was due to reference being hidden by keyboard or scrolled
offscreen. We fix it by showing the dropdown even if the reference
is hidden for mobile devices.
2024-07-12 11:08:47 -07:00
Sahil Batra ebf9105a51 settings: Make sure sorting arrows are visible correctly.
This commit adds right padding, approximately equal to the
size of the sorting arrow, to the table headers which show
sorting arrows to make sure that arrows are visible clearly
at different font sizes and in different text languages.
2024-07-12 10:35:22 -07:00
Sahil Batra 5e5633b5ee settings: Remove user_role class from bot owner column.
We do not allow wrapping text randomly for user role values,
but since bot owner names can be long we do not want to do
that for bot owner column. So, this commit removes the
user_role class which is responsible for adding the required
CSS rule for role values.
2024-07-12 10:35:22 -07:00
Sahil Batra 91cf69f6a1 settings: Set min-width of table columns for narrow screens.
This commit adds minimum width property for different columns
such that the columns do not get too small for narrow screens
and the tables can be scrolled horizontally to view the content.
2024-07-12 10:35:22 -07:00
Sahil Batra 42a5ae76bb settings: Do not allow table headers to wrap randomly. 2024-07-12 10:35:22 -07:00