Commit Graph

59903 Commits

Author SHA1 Message Date
Alex Vandiver e4a8304f57 thumbnail: Store the post-orientation-transformation dimensions.
Modern browsers respect the EXIF orientation information of images,
applying rotation and/or mirroring as specified in those tags.  The
the `width="..."` and `height="..."` tags are to size the image
_after_ applying those orientation transformations.

The `.width` and `.height` properties of libvips' images are _before_
any transformations are applied.  Since we intend to use these to hint
to rendering clients the size that the image should be _rendered at_,
change to storing (and providing to clients) the dimensions of the
rendered image, not the stored bytes.
2024-07-24 09:56:42 -07:00
Alex Vandiver e7ac62aad7 tests: Add a test that the thumb is actually the expected size. 2024-07-24 09:56:42 -07:00
Alex Vandiver d824988bc4 tests: Remove THUMBNAIL_IMAGES overrides, since the setting was dropped.
These were omitted from b42863be4b.
2024-07-24 09:53:14 -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
Tim Abbott daca62513d i18n: Update translation data from Transifex. 2024-07-23 14:45:19 -07:00
Karl Stolley 096bb22e40 help: Update edit icon across help pages. 2024-07-23 14:34:44 -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
Alya Abbott b88b11b958 help: Add a note about frequency of Zulip updates. 2024-07-23 13:10:36 -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
Shubham Padia 304d948416 docs: Replace `Advanced` with relevant section for user Preferences.
This is a followup commit to #30824.
Fixes
https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20help.20not.20updated.20for.20new.20preferences.20sections/near/1899330.
git grep in the help directory will still show up results for `Advanced`
but those are mostly used in either plain english language instructions
or refer to some other part of the app. At the point of writing this
commit, there were 6 results for `Advanced`, 4 of which were plain
english, 1 refers to the Advanced settings in chrome for desktop
notifications, and another one refers to `Advanced configurations` for
channel settings.
2024-07-23 09:44:25 -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
Mateusz Mandera 8f461b3c03 email_mirror: Change default topic name if subject ends up empty.
If the email subject is something like `Fwd:`, it gets stripped to an
empty string, activating the "(no topic)" override. This however leads
to failure if the organization enables the setting forcing every message
to have a topic. Such emails should still go through, so we should just
change the topic value used.
2024-07-22 22:31:45 -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
Tim Abbott 391045ada0 thumbnail: Document thumbnailing API. 2024-07-22 22:41:10 -04:00
Alex Vandiver 2ea0cc0005 thumbnail: Add a data-original-dimensions attribute.
This allows clients to potentially lay out the thumbnails more
intelligently, or to provide a better "progressive-load" experience
when enlarging the thumbnail.
2024-07-22 22:41:10 -04:00
Alex Vandiver 65828b20e9 thumbnail: Factor out a dataclass for markdown image metadata. 2024-07-22 22:41:10 -04:00
Alya Abbott 81a9c8b55b help: Improve previews documentation.
- Make page title more general.
- Document new option for animated image previews.
- Split instructions for showing different preview types.
- Update intro.
2024-07-22 15:28:16 -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
Alya Abbott 1c30ea1819 help: Document feedback@zulip.com contact email. 2024-07-22 13:48:40 -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
Prakhar Pratyush 6838a7302d test_import_export: Add test coverage for OnboardingUserMessage. 2024-07-22 10:26:33 -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