From 8815ec33cdab66b8e325b0d67ab0a97118c7ba93 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Fri, 8 May 2026 22:06:11 +0200 Subject: [PATCH] fided left hand mode --- .../0034_alter_user_drawer_anchor.py | 18 ++++++++++++++++++ backend/api/models/user.py | 2 +- frontend/src/hooks/useDrawerAnchor.ts | 2 +- frontend/src/pages/Settings.tsx | 6 +++--- 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 backend/api/migrations/0034_alter_user_drawer_anchor.py diff --git a/backend/api/migrations/0034_alter_user_drawer_anchor.py b/backend/api/migrations/0034_alter_user_drawer_anchor.py new file mode 100644 index 0000000..f517fe2 --- /dev/null +++ b/backend/api/migrations/0034_alter_user_drawer_anchor.py @@ -0,0 +1,18 @@ +# Generated by Django 6.0.4 on 2026-05-08 20:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0033_user_drawer_anchor'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='drawer_anchor', + field=models.CharField(choices=[('left', 'Left'), ('right', 'Right')], default='right', max_length=5), + ), + ] diff --git a/backend/api/models/user.py b/backend/api/models/user.py index f722496..f730659 100644 --- a/backend/api/models/user.py +++ b/backend/api/models/user.py @@ -32,7 +32,7 @@ class User(AbstractUser): ] theme = models.CharField(max_length=20, choices=THEME_CHOICES, default="holy_light") language = models.CharField(max_length=2, choices=LANGUAGE_CHOICES, default="en") - drawer_anchor = models.CharField(max_length=5, choices=DRAWER_ANCHOR_CHOICES, default="left") + drawer_anchor = models.CharField(max_length=5, choices=DRAWER_ANCHOR_CHOICES, default="right") avatar = models.ImageField(upload_to="avatars/", blank=True, null=True) pending_email = models.EmailField(max_length=254, blank=True, null=True) email_confirmation_code = models.CharField(max_length=6, blank=True, null=True) diff --git a/frontend/src/hooks/useDrawerAnchor.ts b/frontend/src/hooks/useDrawerAnchor.ts index 07fe581..bc72fe9 100644 --- a/frontend/src/hooks/useDrawerAnchor.ts +++ b/frontend/src/hooks/useDrawerAnchor.ts @@ -8,7 +8,7 @@ const STORAGE_KEY = 'drawer-anchor'; const readLocal = (): DrawerAnchor => { const raw = localStorage.getItem(STORAGE_KEY); - return raw === 'right' ? 'right' : 'left'; + return raw === 'left' ? 'left' : 'right'; }; export interface UseDrawerAnchorResult { diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx index f405b04..014678a 100644 --- a/frontend/src/pages/Settings.tsx +++ b/frontend/src/pages/Settings.tsx @@ -305,8 +305,8 @@ const Settings: React.FC = ({ themeName, onThemeChange }) => { setDrawerAnchor(e.target.checked ? 'right' : 'left')} + checked={drawerAnchor === 'left'} + onChange={(e) => setDrawerAnchor(e.target.checked ? 'left' : 'right')} /> } label={ @@ -317,7 +317,7 @@ const Settings: React.FC = ({ themeName, onThemeChange }) => { {t('settings.leftHandModeHint', { defaultValue: - 'Mobile drawer slides in from the right (better for left-handed thumb reach).', + 'Mobile drawer slides in from the left (better for left-handed thumb reach).', })}