mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-27 16:24:20 +00:00
* Add UI setting for collapsing bot comments. Fixes #3838 * Fixing clippy check.
This commit is contained in:
parent
b9b65c9c18
commit
97a4fb9a72
|
@ -119,6 +119,7 @@ pub async fn save_user_settings(
|
||||||
post_listing_mode: data.post_listing_mode,
|
post_listing_mode: data.post_listing_mode,
|
||||||
enable_keyboard_navigation: data.enable_keyboard_navigation,
|
enable_keyboard_navigation: data.enable_keyboard_navigation,
|
||||||
enable_animated_images: data.enable_animated_images,
|
enable_animated_images: data.enable_animated_images,
|
||||||
|
collapse_bot_comments: data.collapse_bot_comments,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,8 @@ pub struct SaveUserSettings {
|
||||||
pub enable_keyboard_navigation: Option<bool>,
|
pub enable_keyboard_navigation: Option<bool>,
|
||||||
/// Whether user avatars or inline images in the UI that are gifs should be allowed to play or should be paused
|
/// Whether user avatars or inline images in the UI that are gifs should be allowed to play or should be paused
|
||||||
pub enable_animated_images: Option<bool>,
|
pub enable_animated_images: Option<bool>,
|
||||||
|
/// Whether to auto-collapse bot comments.
|
||||||
|
pub collapse_bot_comments: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
|
|
@ -447,6 +447,7 @@ diesel::table! {
|
||||||
totp_2fa_enabled -> Bool,
|
totp_2fa_enabled -> Bool,
|
||||||
enable_keyboard_navigation -> Bool,
|
enable_keyboard_navigation -> Bool,
|
||||||
enable_animated_images -> Bool,
|
enable_animated_images -> Bool,
|
||||||
|
collapse_bot_comments -> Bool,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,8 @@ pub struct LocalUser {
|
||||||
pub enable_keyboard_navigation: bool,
|
pub enable_keyboard_navigation: bool,
|
||||||
/// Whether user avatars and inline images in the UI that are gifs should be allowed to play or should be paused
|
/// Whether user avatars and inline images in the UI that are gifs should be allowed to play or should be paused
|
||||||
pub enable_animated_images: bool,
|
pub enable_animated_images: bool,
|
||||||
|
/// Whether to auto-collapse bot comments.
|
||||||
|
pub collapse_bot_comments: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, TypedBuilder)]
|
#[derive(Clone, TypedBuilder)]
|
||||||
|
@ -94,6 +96,7 @@ pub struct LocalUserInsertForm {
|
||||||
pub totp_2fa_enabled: Option<bool>,
|
pub totp_2fa_enabled: Option<bool>,
|
||||||
pub enable_keyboard_navigation: Option<bool>,
|
pub enable_keyboard_navigation: Option<bool>,
|
||||||
pub enable_animated_images: Option<bool>,
|
pub enable_animated_images: Option<bool>,
|
||||||
|
pub collapse_bot_comments: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
|
@ -124,4 +127,5 @@ pub struct LocalUserUpdateForm {
|
||||||
pub totp_2fa_enabled: Option<bool>,
|
pub totp_2fa_enabled: Option<bool>,
|
||||||
pub enable_keyboard_navigation: Option<bool>,
|
pub enable_keyboard_navigation: Option<bool>,
|
||||||
pub enable_animated_images: Option<bool>,
|
pub enable_animated_images: Option<bool>,
|
||||||
|
pub collapse_bot_comments: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,6 +268,7 @@ mod tests {
|
||||||
totp_2fa_enabled: inserted_sara_local_user.totp_2fa_enabled,
|
totp_2fa_enabled: inserted_sara_local_user.totp_2fa_enabled,
|
||||||
enable_keyboard_navigation: inserted_sara_local_user.enable_keyboard_navigation,
|
enable_keyboard_navigation: inserted_sara_local_user.enable_keyboard_navigation,
|
||||||
enable_animated_images: inserted_sara_local_user.enable_animated_images,
|
enable_animated_images: inserted_sara_local_user.enable_animated_images,
|
||||||
|
collapse_bot_comments: inserted_sara_local_user.collapse_bot_comments,
|
||||||
},
|
},
|
||||||
creator: Person {
|
creator: Person {
|
||||||
id: inserted_sara_person.id,
|
id: inserted_sara_person.id,
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE local_user
|
||||||
|
DROP COLUMN collapse_bot_comments;
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE local_user
|
||||||
|
ADD COLUMN collapse_bot_comments boolean DEFAULT FALSE NOT NULL;
|
||||||
|
|
Loading…
Reference in a new issue