From 3e4d5bb0414176dbeef59645af80485930879b62 Mon Sep 17 00:00:00 2001 From: rid3r45 <63557816+rid3r45@users.noreply.github.com> Date: Mon, 2 Mar 2026 13:32:10 +0100 Subject: [PATCH] Add option to hide sidebar by default (#8515) (#8528) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add option to hide sidebar by default (#8515) Closes https://github.com/FreshRSS/FreshRSS/issues/8515 Changes proposed in this pull request: - Add `sidebar_hidden_by_default` user preference (default: `false`) - Add a checkbox in the Display settings page to toggle this preference - Hide the sidebar on page load in `normal` and `reader` views when the preference is enabled and no session state exists - Add English translation key; mark all other languages as `TODO` for translators How to test the feature manually: 1. Go to Settings → Display, tick "Hide sidebar by default", save 2. Go back to the main view (normal or reader): the sidebar should be hidden on load 3. Toggle the sidebar manually — it should open/stay open for the rest of the session 4. Open a new tab: the sidebar should be hidden again 5. Go to Settings → Display, untick the option, save: the sidebar should now be visible on load as usual 6. Check that the sidebar is always visible on Settings pages regardless of the preference Co-Authored-By: Claude Sonnet 4.6 * fix: PR comment * Update app/i18n/pl/conf.php * i18n: fr * make fix-all --------- Co-authored-by: Claude Sonnet 4.6 Co-authored-by: Inverle Co-authored-by: Alexandre Alapetite --- CREDITS.md | 1 + README.fr.md | 4 ++-- README.md | 4 ++-- app/Controllers/configureController.php | 1 + app/Models/UserConfiguration.php | 1 + app/i18n/cs/conf.php | 1 + app/i18n/de/conf.php | 1 + app/i18n/el/conf.php | 1 + app/i18n/en-US/conf.php | 1 + app/i18n/en/conf.php | 1 + app/i18n/es/conf.php | 1 + app/i18n/fa/conf.php | 1 + app/i18n/fi/conf.php | 1 + app/i18n/fr/conf.php | 1 + app/i18n/he/conf.php | 1 + app/i18n/hu/conf.php | 1 + app/i18n/id/conf.php | 1 + app/i18n/it/conf.php | 1 + app/i18n/ja/conf.php | 1 + app/i18n/ko/conf.php | 1 + app/i18n/lv/conf.php | 1 + app/i18n/nl/conf.php | 1 + app/i18n/oc/conf.php | 1 + app/i18n/pl/conf.php | 1 + app/i18n/pt-BR/conf.php | 1 + app/i18n/pt-PT/conf.php | 1 + app/i18n/ru/conf.php | 1 + app/i18n/sk/conf.php | 1 + app/i18n/tr/conf.php | 1 + app/i18n/uk/conf.php | 1 + app/i18n/zh-CN/conf.php | 1 + app/i18n/zh-TW/conf.php | 1 + app/views/configure/display.phtml | 10 ++++++++++ app/views/helpers/javascript_vars.phtml | 1 + config-user.default.php | 1 + docs/en/users/05_Configuration.md | 6 ++++++ p/scripts/main.js | 4 ++++ 37 files changed, 56 insertions(+), 4 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index 3848e6078..3ab4d4406 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -250,6 +250,7 @@ People are sorted by name so please keep this order. * [rdmitr](https://github.com/rdmitr): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:rdmitr) * [Rebecca Scott](https://github.com/becdetat): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:becdetat), [Web](https://becdetat.com) * [Rezad](https://github.com/rezad1393): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:rezad1393) +* [rid3r45](https://github.com/rid3r45): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:rid3r45) * [Rob Loach](https://github.com/RobLoach): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:RobLoach), [Web](https://robloach.net/) * [Robert Kaussow](https://github.com/xoxys): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:xoxys), [Web](https://geeklabor.de/) * [robertdahlem](https://github.com/robertdahlem): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:robertdahlem) diff --git a/README.fr.md b/README.fr.md index 485f36887..fb72c56c9 100644 --- a/README.fr.md +++ b/README.fr.md @@ -234,11 +234,11 @@ Voir le [dépôt dédié à ces extensions](https://github.com/FreshRSS/Extensio | English (United States) (en-US) | ■■■■■■■■■■ 100% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fen-US+%2F%28TODO%7CDIRTY%29%24%2F) | | Español (es) | ■■■■■■■■■・ 98% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fes+%2F%28TODO%7CDIRTY%29%24%2F) | | فارسی (fa) | ■■■■■■■■■・ 91% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffa+%2F%28TODO%7CDIRTY%29%24%2F) | -| Suomi (fi) | ■■■■■■■■■・ 94% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffi+%2F%28TODO%7CDIRTY%29%24%2F) | +| Suomi (fi) | ■■■■■■■■■・ 93% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffi+%2F%28TODO%7CDIRTY%29%24%2F) | | Français (fr) | ■■■■■■■■■■ 100% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffr+%2F%28TODO%7CDIRTY%29%24%2F) | | עברית (he) | ■■■■・・・・・・ 41% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhe+%2F%28TODO%7CDIRTY%29%24%2F) | | Magyar (hu) | ■■■■■■■■■・ 97% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhu+%2F%28TODO%7CDIRTY%29%24%2F) | -| Bahasa Indonesia (id) | ■■■■■■■■■・ 91% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) | +| Bahasa Indonesia (id) | ■■■■■■■■■・ 90% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) | | Italiano (it) | ■■■■■■■■■・ 98% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) | | 日本語 (ja) | ■■■■■■■■・・ 89% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fja+%2F%28TODO%7CDIRTY%29%24%2F) | | 한국어 (ko) | ■■■■■■■■・・ 82% | [contribuer](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) | diff --git a/README.md b/README.md index 8f60dde56..6031e4bc3 100644 --- a/README.md +++ b/README.md @@ -130,11 +130,11 @@ See the [repository dedicated to those extensions](https://github.com/FreshRSS/E | English (United States) (en-US) | ■■■■■■■■■■ 100% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fen-US+%2F%28TODO%7CDIRTY%29%24%2F) | | Español (es) | ■■■■■■■■■・ 98% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fes+%2F%28TODO%7CDIRTY%29%24%2F) | | فارسی (fa) | ■■■■■■■■■・ 91% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffa+%2F%28TODO%7CDIRTY%29%24%2F) | -| Suomi (fi) | ■■■■■■■■■・ 94% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffi+%2F%28TODO%7CDIRTY%29%24%2F) | +| Suomi (fi) | ■■■■■■■■■・ 93% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffi+%2F%28TODO%7CDIRTY%29%24%2F) | | Français (fr) | ■■■■■■■■■■ 100% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Ffr+%2F%28TODO%7CDIRTY%29%24%2F) | | עברית (he) | ■■■■・・・・・・ 41% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhe+%2F%28TODO%7CDIRTY%29%24%2F) | | Magyar (hu) | ■■■■■■■■■・ 97% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fhu+%2F%28TODO%7CDIRTY%29%24%2F) | -| Bahasa Indonesia (id) | ■■■■■■■■■・ 91% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) | +| Bahasa Indonesia (id) | ■■■■■■■■■・ 90% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fid+%2F%28TODO%7CDIRTY%29%24%2F) | | Italiano (it) | ■■■■■■■■■・ 98% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fit+%2F%28TODO%7CDIRTY%29%24%2F) | | 日本語 (ja) | ■■■■■■■■・・ 89% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fja+%2F%28TODO%7CDIRTY%29%24%2F) | | 한국어 (ko) | ■■■■■■■■・・ 82% | [contribute](https://github.com/search?q=repo%3AFreshRSS%2FFreshRSS+path%3Aapp%2Fi18n%2Fko+%2F%28TODO%7CDIRTY%29%24%2F) | diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 00a27f0e7..343ec9c03 100644 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -74,6 +74,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->bottomline_date = Minz_Request::paramBoolean('bottomline_date'); FreshRSS_Context::userConf()->bottomline_link = Minz_Request::paramBoolean('bottomline_link'); FreshRSS_Context::userConf()->show_nav_buttons = Minz_Request::paramBoolean('show_nav_buttons'); + FreshRSS_Context::userConf()->sidebar_hidden_by_default = Minz_Request::paramBoolean('sidebar_hidden_by_default'); FreshRSS_Context::userConf()->html5_notif_timeout = max(0, Minz_Request::paramInt('html5_notif_timeout')); FreshRSS_Context::userConf()->html5_enable_notif = Minz_Request::paramBoolean('html5_enable_notif'); FreshRSS_Context::userConf()->good_notification_timeout = max(0, Minz_Request::paramInt('good_notification_timeout')); diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php index d6a0be027..0160c1b5a 100644 --- a/app/Models/UserConfiguration.php +++ b/app/Models/UserConfiguration.php @@ -54,6 +54,7 @@ declare(strict_types=1); * @property bool $icons_as_emojis * @property int $simplify_over_n_feeds * @property bool $show_nav_buttons + * @property bool $sidebar_hidden_by_default * @property 'big'|'small'|'none' $mark_read_button * @property 'ASC'|'DESC' $sort_order * @property 'id'|'c.name'|'date'|'f.name'|'length'|'link'|'rand'|'title' $sort diff --git a/app/i18n/cs/conf.php b/app/i18n/cs/conf.php index 4af5e04bc..2d4bd6e73 100644 --- a/app/i18n/cs/conf.php +++ b/app/i18n/cs/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Časový limit HTML5 oznámení', ), 'show_nav_buttons' => 'Zobrazit navigační tlačítka', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Motiv', 'deprecated' => array( diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index 4f96e5753..151039890 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Zeitüberschreitung für HTML5-Benachrichtigung', ), 'show_nav_buttons' => 'Zeige Navigations-Buttons', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Layout', 'deprecated' => array( diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.php index 4ca9415d2..a76bc5688 100644 --- a/app/i18n/el/conf.php +++ b/app/i18n/el/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 notification timeout', // TODO ), 'show_nav_buttons' => 'Show the navigation buttons', // TODO + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Theme', // TODO 'deprecated' => array( diff --git a/app/i18n/en-US/conf.php b/app/i18n/en-US/conf.php index 1fcdad486..e73f68740 100644 --- a/app/i18n/en-US/conf.php +++ b/app/i18n/en-US/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 notification timeout', // IGNORE ), 'show_nav_buttons' => 'Show the navigation buttons', // IGNORE + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // IGNORE 'theme' => array( '_' => 'Theme', // IGNORE 'deprecated' => array( diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index c85a5e0c2..dc291afb8 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 notification timeout', ), 'show_nav_buttons' => 'Show the navigation buttons', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', 'theme' => array( '_' => 'Theme', 'deprecated' => array( diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index 5a2924b9a..ae4959f37 100644 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Notificación de fin de espera HTML5', ), 'show_nav_buttons' => 'Mostrar los botones de navegación', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tema', 'deprecated' => array( diff --git a/app/i18n/fa/conf.php b/app/i18n/fa/conf.php index 934fc5642..9999f699d 100644 --- a/app/i18n/fa/conf.php +++ b/app/i18n/fa/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => ' وقفه اعلان HTML5', ), 'show_nav_buttons' => ' دکمه های ناوبری را نشان دهید', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => ' موضوع', 'deprecated' => array( diff --git a/app/i18n/fi/conf.php b/app/i18n/fi/conf.php index e0e35ff00..2c0cfb148 100644 --- a/app/i18n/fi/conf.php +++ b/app/i18n/fi/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Tauko HTML5-ilmoitusten välissä', ), 'show_nav_buttons' => 'Näytä siirtymispainikkeet', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Teema', 'deprecated' => array( diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 551309069..8000f8fae 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Temps d’affichage de la notification HTML5', ), 'show_nav_buttons' => 'Afficher les boutons de navigation', + 'sidebar_hidden_by_default' => 'Masquer la barre latérale par défaut', 'theme' => array( '_' => 'Thème', 'deprecated' => array( diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index 38c5ee52e..d26a569ff 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 התראה פג תוקף', ), 'show_nav_buttons' => 'Show the navigation buttons', // TODO + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'ערכת נושא', 'deprecated' => array( diff --git a/app/i18n/hu/conf.php b/app/i18n/hu/conf.php index 24f53112e..a249905d1 100644 --- a/app/i18n/hu/conf.php +++ b/app/i18n/hu/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 értesítés hossza', ), 'show_nav_buttons' => 'Navigációs gombok megjelenítése', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Téma', 'deprecated' => array( diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.php index 9c9704645..2c0ac8b95 100644 --- a/app/i18n/id/conf.php +++ b/app/i18n/id/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Batas waktu pemberitahuan HTML5', ), 'show_nav_buttons' => 'Tampilkan tombol navigasi', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tema', 'deprecated' => array( diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 7e5ef8162..c7cb83989 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Notifica timeout HTML5', ), 'show_nav_buttons' => 'Mostra i pulsanti di navigazione', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tema', 'deprecated' => array( diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php index b68776fb1..a9c7aaf9e 100644 --- a/app/i18n/ja/conf.php +++ b/app/i18n/ja/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 の通知タイムアウト時間', ), 'show_nav_buttons' => 'ナビゲーションボタンを表示する', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'テーマ', 'deprecated' => array( diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.php index 2d791b5df..ccb0e07dc 100644 --- a/app/i18n/ko/conf.php +++ b/app/i18n/ko/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 알림 타임아웃', ), 'show_nav_buttons' => '내비게이션 버튼 보이기', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => '테마', 'deprecated' => array( diff --git a/app/i18n/lv/conf.php b/app/i18n/lv/conf.php index 13320a560..d44dcefe5 100644 --- a/app/i18n/lv/conf.php +++ b/app/i18n/lv/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 paziņojuma laika ierobežojums', ), 'show_nav_buttons' => 'Rādīt navigācijas pogas', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tēma', 'deprecated' => array( diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index b1f6c8c8e..ee5ef595f 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 notificatie stop', ), 'show_nav_buttons' => 'Toon navigatieknoppen', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Thema', 'deprecated' => array( diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index 86f82eef6..59b85390d 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Temps d’afichatge de las notificacions HTML5', ), 'show_nav_buttons' => 'Mostrar los botons de navigacion', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tèma', 'deprecated' => array( diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php index a28fa8f1f..abf8b2eca 100644 --- a/app/i18n/pl/conf.php +++ b/app/i18n/pl/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Czas wyświetlania powiadomienia HTML5', ), 'show_nav_buttons' => 'Pokaż przyciski nawigacyjne', + 'sidebar_hidden_by_default' => 'Ukryj pasek boczny domyślnie', 'theme' => array( '_' => 'Motyw', 'deprecated' => array( diff --git a/app/i18n/pt-BR/conf.php b/app/i18n/pt-BR/conf.php index a141f7ffa..0039f1929 100644 --- a/app/i18n/pt-BR/conf.php +++ b/app/i18n/pt-BR/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Notificação em HTML5 de timeout', ), 'show_nav_buttons' => 'Mostrar botões de navegação', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tema', 'deprecated' => array( diff --git a/app/i18n/pt-PT/conf.php b/app/i18n/pt-PT/conf.php index 32f2016db..32fc24e7e 100644 --- a/app/i18n/pt-PT/conf.php +++ b/app/i18n/pt-PT/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Notificação em HTML5 de timeout', ), 'show_nav_buttons' => 'Mostrar botões de navegação', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tema', 'deprecated' => array( diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 8179ce307..00d75dc9b 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Таймаут уведомлений HTML5', ), 'show_nav_buttons' => 'Показать кнопки навигации', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Тема', 'deprecated' => array( diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php index 07e38c428..6607004ef 100644 --- a/app/i18n/sk/conf.php +++ b/app/i18n/sk/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Limit HTML5 oznámenia', ), 'show_nav_buttons' => 'Zobraziť tlačidlá oznámenia', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Vzhľad', 'deprecated' => array( diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index d5ab74f83..033126404 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 bildirim zaman aşımı', ), 'show_nav_buttons' => 'Gezinme düğmelerini göster', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Tema', 'deprecated' => array( diff --git a/app/i18n/uk/conf.php b/app/i18n/uk/conf.php index ee41e2d47..cf75438c5 100644 --- a/app/i18n/uk/conf.php +++ b/app/i18n/uk/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'Тайм-аут сповіщення HTML5', ), 'show_nav_buttons' => 'Показати кнопки навігації', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => 'Тема', 'deprecated' => array( diff --git a/app/i18n/zh-CN/conf.php b/app/i18n/zh-CN/conf.php index e67e9ab31..dfd4dfb2f 100644 --- a/app/i18n/zh-CN/conf.php +++ b/app/i18n/zh-CN/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 通知超时时间', ), 'show_nav_buttons' => '显示导航按钮', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => '主题', 'deprecated' => array( diff --git a/app/i18n/zh-TW/conf.php b/app/i18n/zh-TW/conf.php index 9a8a70a26..e7a9f1223 100644 --- a/app/i18n/zh-TW/conf.php +++ b/app/i18n/zh-TW/conf.php @@ -54,6 +54,7 @@ return array( 'timeout' => 'HTML5 通知超時時間', ), 'show_nav_buttons' => '顯示導航按鈕', + 'sidebar_hidden_by_default' => 'Hide sidebar by default', // TODO 'theme' => array( '_' => '主題', 'deprecated' => array( diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 64dcf1b84..eb1bb38dd 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -275,6 +275,16 @@ +
+
+ +
+
+
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index f2203f56e..0a109afd0 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -23,6 +23,7 @@ echo json_encode([ 'nb_parallel_refresh' => max(1, FreshRSS_Context::systemConf()->nb_parallel_refresh), 'does_lazyload' => !!FreshRSS_Context::userConf()->lazyload , 'sides_close_article' => !!FreshRSS_Context::userConf()->sides_close_article, + 'sidebar_hidden_by_default' => !!FreshRSS_Context::userConf()->sidebar_hidden_by_default, 'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(), 'html5_enable_notif' => FreshRSS_Context::userConf()->html5_enable_notif, 'html5_notif_timeout' => FreshRSS_Context::userConf()->html5_notif_timeout, diff --git a/config-user.default.php b/config-user.default.php index d0ed183a1..7cb77aec9 100644 --- a/config-user.default.php +++ b/config-user.default.php @@ -135,6 +135,7 @@ return array ( 'good_notification_timeout' => 3, 'bad_notification_timeout' => 8, 'show_nav_buttons' => true, + 'sidebar_hidden_by_default' => false, # List of enabled FreshRSS extensions. 'extensions_enabled' => [], 'retrieve_extension_list' => true, diff --git a/docs/en/users/05_Configuration.md b/docs/en/users/05_Configuration.md index 65eef7dfd..03308a13e 100644 --- a/docs/en/users/05_Configuration.md +++ b/docs/en/users/05_Configuration.md @@ -105,6 +105,12 @@ By default, FreshRSS displays buttons to ease the article navigation when browsi If you don’t use those buttons because you never browse on mobile or because you browse with gestures, you can disable them from the interface. +### Hide sidebar by default + +By default, the sidebar is visible when opening FreshRSS. If you prefer to have more reading space on load, you can hide it by default. + +When this option is enabled, the sidebar will be hidden at the start of each new session in the normal and reader views. You can still toggle it at any time using the sidebar button in the navigation bar. + ## Reading ### Number of articles per page diff --git a/p/scripts/main.js b/p/scripts/main.js index 6b5211bdb..a484a85ed 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -971,6 +971,10 @@ function init_nav_menu() { if (context.current_view === 'normal') aside.classList.add('visible'); sync(media); } + if (state === null && context.sidebar_hidden_by_default && ['normal', 'reader'].includes(context.current_view)) { + const active = toggle_aside.classList.contains('active'); + if (active) toggle_aside_click(false); + } const close_aside = [ document.querySelector('.aside a.toggle_aside'), document.querySelector('a.close-aside'), // background of aside (#close)