mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-10 06:54:12 +00:00
add keyboard navigation setting (#3569)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com> Co-authored-by: Dessalines <tyhou13@gmx.com>
This commit is contained in:
parent
dc327652a5
commit
6470ea81a7
6 changed files with 14 additions and 0 deletions
|
@ -123,6 +123,8 @@ pub struct SaveUserSettings {
|
|||
pub open_links_in_new_tab: Option<bool>,
|
||||
/// Enable infinite scroll
|
||||
pub infinite_scroll_enabled: Option<bool>,
|
||||
/// Whether to allow keyboard navigation (for browsing and interacting with posts and comments).
|
||||
pub enable_keyboard_navigation: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||
|
|
|
@ -442,6 +442,7 @@ diesel::table! {
|
|||
admin -> Bool,
|
||||
post_listing_mode -> PostListingModeEnum,
|
||||
totp_2fa_enabled -> Bool,
|
||||
enable_keyboard_navigation -> Bool,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@ pub struct LocalUser {
|
|||
pub admin: bool,
|
||||
pub post_listing_mode: PostListingMode,
|
||||
pub totp_2fa_enabled: bool,
|
||||
/// Whether to allow keyboard navigation (for browsing and interacting with posts and comments).
|
||||
pub enable_keyboard_navigation: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, TypedBuilder)]
|
||||
|
@ -91,6 +93,7 @@ pub struct LocalUserInsertForm {
|
|||
pub admin: Option<bool>,
|
||||
pub post_listing_mode: Option<PostListingMode>,
|
||||
pub totp_2fa_enabled: Option<bool>,
|
||||
pub enable_keyboard_navigation: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
|
@ -120,4 +123,5 @@ pub struct LocalUserUpdateForm {
|
|||
pub admin: Option<bool>,
|
||||
pub post_listing_mode: Option<PostListingMode>,
|
||||
pub totp_2fa_enabled: Option<bool>,
|
||||
pub enable_keyboard_navigation: Option<bool>,
|
||||
}
|
||||
|
|
|
@ -267,6 +267,7 @@ mod tests {
|
|||
admin: false,
|
||||
post_listing_mode: inserted_sara_local_user.post_listing_mode,
|
||||
totp_2fa_enabled: inserted_sara_local_user.totp_2fa_enabled,
|
||||
enable_keyboard_navigation: inserted_sara_local_user.enable_keyboard_navigation,
|
||||
},
|
||||
creator: Person {
|
||||
id: inserted_sara_person.id,
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE local_user
|
||||
DROP COLUMN enable_keyboard_navigation;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE local_user
|
||||
ADD COLUMN enable_keyboard_navigation boolean DEFAULT FALSE NOT NULL;
|
||||
|
Loading…
Reference in a new issue