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.
This commit is contained in:
roanster007
2024-07-21 18:53:56 +05:30
committed by Tim Abbott
parent 1c30ea1819
commit 66a96bee71
27 changed files with 251 additions and 5 deletions

View File

@@ -161,6 +161,7 @@ def confirm_email_change(request: HttpRequest, confirmation_key: str) -> HttpRes
emojiset_choices = {emojiset["key"] for emojiset in UserProfile.emojiset_choices()}
web_home_view_options = ["recent_topics", "inbox", "all_messages"]
web_animate_image_previews_options = ["always", "on_hover", "never"]
def check_settings_values(
@@ -329,6 +330,9 @@ def json_change_settings(
user_list_style: int | None = REQ(
json_validator=check_int_in(UserProfile.USER_LIST_STYLE_CHOICES), default=None
),
web_animate_image_previews: str | None = REQ(
str_validator=check_string_in(web_animate_image_previews_options), default=None
),
email_address_visibility: int | None = REQ(
json_validator=check_int_in(UserProfile.EMAIL_ADDRESS_VISIBILITY_TYPES), default=None
),