Răsfoiți Sursa

New state: favorite or unread (#7088)

* New state: favorite or unread
https://github.com/FreshRSS/FreshRSS/discussions/7078#discussioncomment-11526292

* Experiment using this state by default

* Rework state

* Allow ANDS for typos

* Revert change unrelated to this PR

* Revert change of default state

* Add option *unread_or_favorite*

* Fix hide_read_feeds

* i18n: it

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>

* Update app/i18n/pl/conf.php

Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com>

* Update app/i18n/pl/conf.php

Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com>

* Fix i18n

* Fix auto_remove_article

* Fix mark_unread_enabled

---------

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>
Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com>
Alexandre Alapetite 1 an în urmă
părinte
comite
6b14a743cc

+ 1 - 0
.typos.toml

@@ -3,6 +3,7 @@ ot = "ot"
 Ths2 = "Ths2"
 
 [default.extend-words]
+ANDS = "ANDS"
 referer = "referer"
 
 [files]

+ 10 - 18
app/Models/Context.php

@@ -224,15 +224,15 @@ final class FreshRSS_Context {
 
 		self::$state = Minz_Request::paramInt('state') ?: FreshRSS_Context::userConf()->default_state;
 		$state_forced_by_user = Minz_Request::paramString('state') !== '';
-		if (!$state_forced_by_user && !self::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
-			if (FreshRSS_Context::userConf()->default_view === 'all') {
-				self::$state |= FreshRSS_Entry::STATE_ALL;
+		if (!$state_forced_by_user) {
+			if (FreshRSS_Context::userConf()->show_fav_unread && (self::isCurrentGet('s') || self::isCurrentGet('T') || self::isTag())) {
+				self::$state = FreshRSS_Entry::STATE_NOT_READ | FreshRSS_Entry::STATE_READ;
+			} elseif (FreshRSS_Context::userConf()->default_view === 'all') {
+				self::$state = FreshRSS_Entry::STATE_NOT_READ | FreshRSS_Entry::STATE_READ;
+			} elseif (FreshRSS_Context::userConf()->default_view === 'unread_or_favorite') {
+				self::$state = FreshRSS_Entry::STATE_OR_NOT_READ | FreshRSS_Entry::STATE_OR_FAVORITE;
 			} elseif (FreshRSS_Context::userConf()->default_view === 'adaptive' && self::$get_unread <= 0) {
-				self::$state |= FreshRSS_Entry::STATE_READ;
-			}
-			if (FreshRSS_Context::userConf()->show_fav_unread &&
-					(self::isCurrentGet('s') || self::isCurrentGet('T') || self::isTag())) {
-				self::$state |= FreshRSS_Entry::STATE_READ;
+				self::$state = FreshRSS_Entry::STATE_NOT_READ | FreshRSS_Entry::STATE_READ;
 			}
 		}
 
@@ -553,16 +553,8 @@ final class FreshRSS_Context {
 	 *   - the "unread" state is enable
 	 */
 	public static function isAutoRemoveAvailable(): bool {
-		if (!FreshRSS_Context::userConf()->auto_remove_article) {
-			return false;
-		}
-		if (self::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
-			return false;
-		}
-		if (!self::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ)) {
-			return false;
-		}
-		return true;
+		return FreshRSS_Context::userConf()->auto_remove_article && !self::isStateEnabled(FreshRSS_Entry::STATE_READ) &&
+			(self::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) || self::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ));
 	}
 
 	/**

+ 4 - 0
app/Models/Entry.php

@@ -9,6 +9,10 @@ class FreshRSS_Entry extends Minz_Model {
 	public const STATE_ALL = 3;
 	public const STATE_FAVORITE = 4;
 	public const STATE_NOT_FAVORITE = 8;
+	public const STATE_ANDS = self::STATE_READ | self::STATE_NOT_READ | self::STATE_FAVORITE | self::STATE_NOT_FAVORITE;
+	public const STATE_OR_NOT_READ = 32;
+	public const STATE_OR_FAVORITE = 64;
+	public const STATE_ORS = self::STATE_OR_NOT_READ | self::STATE_OR_FAVORITE;
 
 	/** @var numeric-string */
 	private string $id = '0';

+ 25 - 10
app/Models/EntryDAO.php

@@ -1112,19 +1112,34 @@ SQL;
 			string $order = 'DESC', string $firstId = '', int $date_min = 0): array {
 		$search = ' ';
 		$values = [];
-		if ($state & FreshRSS_Entry::STATE_NOT_READ) {
-			if (!($state & FreshRSS_Entry::STATE_READ)) {
-				$search .= 'AND ' . $alias . 'is_read=0 ';
+		if ($state & FreshRSS_Entry::STATE_ANDS) {
+			if ($state & FreshRSS_Entry::STATE_NOT_READ) {
+				if (!($state & FreshRSS_Entry::STATE_READ)) {
+					$search .= 'AND (' . $alias . 'is_read=0) ';
+				}
+			} elseif ($state & FreshRSS_Entry::STATE_READ) {
+				$search .= 'AND (' . $alias . 'is_read=1) ';
+			}
+			if ($state & FreshRSS_Entry::STATE_FAVORITE) {
+				if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) {
+					$search .= 'AND (' . $alias . 'is_favorite=1) ';
+				}
+			} elseif ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) {
+				$search .= 'AND (' . $alias . 'is_favorite=0) ';
 			}
-		} elseif ($state & FreshRSS_Entry::STATE_READ) {
-			$search .= 'AND ' . $alias . 'is_read=1 ';
 		}
-		if ($state & FreshRSS_Entry::STATE_FAVORITE) {
-			if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) {
-				$search .= 'AND ' . $alias . 'is_favorite=1 ';
+		if ($state & FreshRSS_Entry::STATE_ORS) {
+			if (trim($search) === '') {
+				$search = 'AND (1=0) ';
+			}
+			if ($state & FreshRSS_Entry::STATE_OR_NOT_READ) {
+				$search = rtrim($search, ') ');
+				$search .= ' OR ' . $alias . 'is_read=0) ';
+			}
+			if ($state & FreshRSS_Entry::STATE_OR_FAVORITE) {
+				$search = rtrim($search, ') ');
+				$search .= ' OR ' . $alias . 'is_favorite=1) ';
 			}
-		} elseif ($state & FreshRSS_Entry::STATE_NOT_FAVORITE) {
-			$search .= 'AND ' . $alias . 'is_favorite=0 ';
 		}
 
 		switch ($order) {

+ 2 - 1
app/i18n/cs/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Počet zobrazených článků',
 			'active_category' => 'Aktivní kategorie',
-			'adaptive' => 'Vyberte zobrazení',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Zobrazit všechny články',
 			'all_categories' => 'Všechny kategorie',
 			'no_category' => 'Žádná kategorie',
 			'remember_categories' => 'Zapamatovat otevřené kategorie',
 			'unread' => 'Zobrazit pouze nepřečtené',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Použije se také na popisky',
 		'sides_close_article' => 'Kliknutí mimo oblast textu článku zavře článek',

+ 2 - 1
app/i18n/de/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Artikel zum Anzeigen',
 			'active_category' => 'Aktive Kategorie',
-			'adaptive' => 'Anzeige anpassen',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Alle Artikel zeigen',
 			'all_categories' => 'Alle Kategorien',
 			'no_category' => 'Keine Kategorie',
 			'remember_categories' => 'Geöffnete Kategorien merken',
 			'unread' => 'Nur ungelesene zeigen',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Auch auf Labels anwenden',
 		'sides_close_article' => 'Klick außerhalb des Artikel-Textes schließt den Artikel',

+ 3 - 2
app/i18n/el/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Articles to display',	// TODO
 			'active_category' => 'Active category',	// TODO
-			'adaptive' => 'Adjust showing',	// TODO
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Show all articles',	// TODO
 			'all_categories' => 'All categories',	// TODO
 			'no_category' => 'No category',	// TODO
 			'remember_categories' => 'Remember open categories',	// TODO
-			'unread' => 'Show only unread',	// TODO
+			'unread' => 'Show unreads',	// TODO
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Applies also on labels',	// TODO
 		'sides_close_article' => 'Clicking outside of article text area closes the article',	// TODO

+ 3 - 2
app/i18n/en-us/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Articles to display',	// IGNORE
 			'active_category' => 'Active category',	// IGNORE
-			'adaptive' => 'Adjust showing',	// IGNORE
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// IGNORE
 			'all_articles' => 'Show all articles',	// IGNORE
 			'all_categories' => 'All categories',	// IGNORE
 			'no_category' => 'No category',	// IGNORE
 			'remember_categories' => 'Remember open categories',	// IGNORE
-			'unread' => 'Show only unread',	// IGNORE
+			'unread' => 'Show unreads',	// IGNORE
+			'unread_or_favorite' => 'Show unreads and favorites',	// IGNORE
 		),
 		'show_fav_unread_help' => 'Applies also on labels',	// IGNORE
 		'sides_close_article' => 'Clicking outside of article text area closes the article',	// IGNORE

+ 3 - 2
app/i18n/en/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Articles to display',
 			'active_category' => 'Active category',
-			'adaptive' => 'Adjust showing',
+			'adaptive' => 'Show unreads if any, all articles otherwise',
 			'all_articles' => 'Show all articles',
 			'all_categories' => 'All categories',
 			'no_category' => 'No category',
 			'remember_categories' => 'Remember open categories',
-			'unread' => 'Show only unread',
+			'unread' => 'Show unreads',
+			'unread_or_favorite' => 'Show unreads and favourites',
 		),
 		'show_fav_unread_help' => 'Applies also on labels',
 		'sides_close_article' => 'Clicking outside of article text area closes the article',

+ 2 - 1
app/i18n/es/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Artículos a mostrar',
 			'active_category' => 'Categoría activa',
-			'adaptive' => 'Ajustar la visualización',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Mostrar todos los artículos',
 			'all_categories' => 'Todas las categorías',
 			'no_category' => 'Sin categoría',
 			'remember_categories' => 'Recordar categorías abiertas',
 			'unread' => 'Mostrar solo pendientes',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Se aplica también en las etiquetas',
 		'sides_close_article' => 'Pinchar fuera del área de texto del artículo lo cerrará',

+ 2 - 1
app/i18n/fa/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => ' مقالات برای نمایش',
 			'active_category' => ' دسته فعال',
-			'adaptive' => ' نمایش را تنظیم کنید',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => ' نمایش همه مقالات',
 			'all_categories' => ' همه دسته ها',
 			'no_category' => ' بدون دسته',
 			'remember_categories' => ' دسته بندی های باز را به خاطر بسپارید',
 			'unread' => ' فقط خوانده نشده را نشان دهد',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => ' روی برچسب ها نیز اعمال می شود',
 		'sides_close_article' => ' با کلیک کردن خارج از ناحیه متن مقاله',

+ 2 - 1
app/i18n/fi/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Näytettävät artikkelit',
 			'active_category' => 'Käytössä oleva luokka',
-			'adaptive' => 'Säädä näkymää',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Näytä kaikki artikkelit',
 			'all_categories' => 'Kaikki luokat',
 			'no_category' => 'Ei luokkaa',
 			'remember_categories' => 'Muista avoinna olevat luokat',
 			'unread' => 'Näytä vain lukemattomat',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Koskee myös merkintöjä',
 		'sides_close_article' => 'Artikkeli sulkeutuu napsauttamalla sen ulkopuolelle',

+ 2 - 1
app/i18n/fr/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Articles à afficher',
 			'active_category' => 'La catégorie active',
-			'adaptive' => 'Adapter l’affichage',
+			'adaptive' => 'Afficher les non lus s’il y en a, sinon tous les articles',
 			'all_articles' => 'Afficher tous les articles',
 			'all_categories' => 'Toutes les catégories',
 			'no_category' => 'Aucune catégorie',
 			'remember_categories' => 'Se souvenir des catégories dépliées',
 			'unread' => 'Afficher les non lus',
+			'unread_or_favorite' => 'Afficher les non lus et les favoris',
 		),
 		'show_fav_unread_help' => 'S’applique aussi aux étiquettes',
 		'sides_close_article' => 'Cliquer hors de la zone de texte ferme l’article',

+ 2 - 1
app/i18n/he/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'מאמרים להצגה',
 			'active_category' => 'Active category',	// TODO
-			'adaptive' => 'תצוגה מתעדכנת',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'הצגת כל המאמרים',
 			'all_categories' => 'All categories',	// TODO
 			'no_category' => 'No category',	// TODO
 			'remember_categories' => 'Remember open categories',	// TODO
 			'unread' => 'הצגת מאמרים שלא נקראו בלבד',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Applies also on labels',	// TODO
 		'sides_close_article' => 'Clicking outside of article text area closes the article',	// TODO

+ 2 - 1
app/i18n/hu/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Megjelenített cikkek',
 			'active_category' => 'Aktív kategória',
-			'adaptive' => 'Megjelenítés beállítása',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Mindegyik cikk megjelenítése',
 			'all_categories' => 'Mindegyik kategória',
 			'no_category' => 'Nincs kategória',
 			'remember_categories' => 'Emlékezzen a kibontott kategóriákra',
 			'unread' => 'Csak az olvasatlan cikkek',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'A címkékre is vonatkozik',
 		'sides_close_article' => 'A cikk szövegrészén kívüli kattintás bezárja a cikket',

+ 2 - 1
app/i18n/id/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Artikel untuk ditampilkan',
 			'active_category' => 'Kategori aktif',
-			'adaptive' => 'Penyesuaian tampilan',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Tampilkan semua artikel',
 			'all_categories' => 'Semua kategori',
 			'no_category' => 'Tidak ada kategori',
 			'remember_categories' => 'Ingat kategori yang terbuka',
 			'unread' => 'Hanya tampilkan yang belum dibaca',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Berlaku juga pada label',
 		'sides_close_article' => 'Klik di luar area teks artikel untuk menutup artikel',

+ 2 - 1
app/i18n/it/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Articoli da visualizzare',
 			'active_category' => 'Categoria attiva',
-			'adaptive' => 'Adatta visualizzazione',
+			'adaptive' => 'Mostra i non letti se ci sono o tutti gli articoli altrimenti',
 			'all_articles' => 'Mostra tutti gli articoli',
 			'all_categories' => 'Tutte le categorie',
 			'no_category' => 'Nessuna categoria',
 			'remember_categories' => 'Ricorda le categorie aperte',
 			'unread' => 'Mostra solo non letti',
+			'unread_or_favorite' => 'Mostra i non letti e i preferiti',
 		),
 		'show_fav_unread_help' => 'Si applica anche alle etichette',
 		'sides_close_article' => 'Cliccare fuori dall’area di testo dell’articolo chiude l’articolo',

+ 2 - 1
app/i18n/ja/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => '記事を表示する',
 			'active_category' => 'アクティブなカテゴリ',
-			'adaptive' => '表示を調整する',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'すべての記事を表示する',
 			'all_categories' => 'すべてのカテゴリ',
 			'no_category' => '未分類',
 			'remember_categories' => '前回開いたカテゴリ',
 			'unread' => '未読のみ表示する',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'ラベルも適用する',
 		'sides_close_article' => '記事の外をクリックすると記事を閉じるようにする',

+ 2 - 1
app/i18n/ko/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => '글 표시 방식',
 			'active_category' => '활성화 된 카테고리',
-			'adaptive' => '읽지 않은 글이 없으면 모든 글 표시',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => '모든 글 표시',
 			'all_categories' => '모든 카테고리',
 			'no_category' => '카테고리 없음',
 			'remember_categories' => '열린 카테고리 기억',
 			'unread' => '읽지 않은 글만 표시',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => '라벨에도 적용하기',
 		'sides_close_article' => '글 영역 바깥을 클릭하면 글 접기',

+ 2 - 1
app/i18n/lv/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Rādāmie raksti',
 			'active_category' => 'Aktīvā kategorija',
-			'adaptive' => 'Pielāgot rādīšanu',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Rādīt visus rakstus',
 			'all_categories' => 'Visas kategorijas',
 			'no_category' => 'Bez kategorijas',
 			'remember_categories' => 'Iegaumēt atvērtās kategorijas',
 			'unread' => 'Rādīt tikai nelasītos',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Attiecas arī uz birkām',
 		'sides_close_article' => 'Spiežot ārpus raksta teksta apgabala, raksts tiek aizvērts',

+ 2 - 1
app/i18n/nl/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Artikelen om te tonen',
 			'active_category' => 'Actieve categorie',
-			'adaptive' => 'Pas weergave aan',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Bekijk alle artikelen',
 			'all_categories' => 'Alle categorieën',
 			'no_category' => 'Geen categorie',
 			'remember_categories' => 'Open categorieën herinneren',
 			'unread' => 'Bekijk alleen ongelezen',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Ook toepassen op labels',
 		'sides_close_article' => 'Sluit het artikel door buiten de artikeltekst te klikken',

+ 2 - 1
app/i18n/oc/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Articles de mostrar',
 			'active_category' => 'Activar categoria',
-			'adaptive' => 'Adaptar l’afichatge',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Mostrar totes los articles',
 			'all_categories' => 'Totas las categorias',
 			'no_category' => 'Cap de categoria',
 			'remember_categories' => 'Se remembrar de las categorias dobèrtas',
 			'unread' => 'Mostrar pas que los pas legits',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Aplicar tanben a las etiquetas',
 		'sides_close_article' => 'Clicar fòra de la zòna de tèxte tampa l’article',

+ 2 - 1
app/i18n/pl/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Wiadomości do wyświetlenia',
 			'active_category' => 'Aktualna',
-			'adaptive' => 'Dopasuj do sytuacji',
+			'adaptive' => 'Pokaż istniejące nieprzeczytane artykuły, w przeciwnym razie wyświetl wszystkie',
 			'all_articles' => 'Wszystkie wiadomości',
 			'all_categories' => 'Wszystkie',
 			'no_category' => 'Żadna',
 			'remember_categories' => 'Pamiętaj otwarte kategorie',
 			'unread' => 'Tylko nieprzeczytane',
+			'unread_or_favorite' => 'Pokaż nieprzeczytane i ulubione',
 		),
 		'show_fav_unread_help' => 'Stosuje się również do etykiet',
 		'sides_close_article' => 'Kliknięcie poza zawartością wiadomości zamyka widok wiadomości',

+ 2 - 1
app/i18n/pt-br/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Artigos para exibir',
 			'active_category' => 'Categoria ativa',
-			'adaptive' => 'Ajustar visualização',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Exibir todos os artigos',
 			'all_categories' => 'Exibir todas as categorias',
 			'no_category' => 'Nenhuma categoria',
 			'remember_categories' => 'lembrar de abrir as categorias',
 			'unread' => 'Exibir apenas não lido',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Aplicar também nas tags',
 		'sides_close_article' => 'Clicando fora da área do texto do artigo fecha o mesmo',

+ 2 - 1
app/i18n/ru/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Какие статьи отображать',
 			'active_category' => 'Активную категорию',
-			'adaptive' => 'Адаптивно',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Показывать все статьи',
 			'all_categories' => 'Все категории',
 			'no_category' => 'Никакие категории',
 			'remember_categories' => 'Запоминать открытые категории',
 			'unread' => 'Только непрочитанные',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Также относится к меткам',
 		'sides_close_article' => 'Нажатия мышью за пределами текста статьи закрывают статью',

+ 2 - 1
app/i18n/sk/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Článkov na zobrazenie',
 			'active_category' => 'Aktívna kategória',
-			'adaptive' => 'Vyberte zobrazenie',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Zobraziť všetky články',
 			'all_categories' => 'Všetky kategórie',
 			'no_category' => 'Bez kategŕie',
 			'remember_categories' => 'Zapamätať otvorené kategórie',
 			'unread' => 'Zobraziť iba neprečítané',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Týka sa aj štítkov',
 		'sides_close_article' => 'Po kliknutí mimo textu článku sa článok zatvorí',

+ 2 - 1
app/i18n/tr/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => 'Gösterilecek makaleler',
 			'active_category' => 'Mevcut kategori',
-			'adaptive' => 'Ayarlanmış gösterim',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => 'Tüm makaleleri göster',
 			'all_categories' => 'Tüm kategoriler',
 			'no_category' => 'Hiçbir kategori',
 			'remember_categories' => 'Açık kategorileri hatırla',
 			'unread' => 'Sadece okunmamış makaleleri göster',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => 'Etiketlerde de uygula',
 		'sides_close_article' => 'Makale dışında bir alana tıklamak makaleyi kapatır',

+ 2 - 1
app/i18n/zh-cn/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => '文章显示',
 			'active_category' => '活跃的分类',
-			'adaptive' => '自适应显示',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => '显示所有',
 			'all_categories' => '所有分类',
 			'no_category' => '无分类',
 			'remember_categories' => '记住打开的分类',
 			'unread' => '只显示未读',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => '同样适用于标签',
 		'sides_close_article' => '点击文章文本区域外关闭文章',

+ 2 - 1
app/i18n/zh-tw/conf.php

@@ -257,12 +257,13 @@ return array(
 		'show' => array(
 			'_' => '文章顯示',
 			'active_category' => '啟用的分類',
-			'adaptive' => '智能顯示',
+			'adaptive' => 'Show unreads if any, all articles otherwise',	// TODO
 			'all_articles' => '顯示所有',
 			'all_categories' => '所有分類',
 			'no_category' => '無分類',
 			'remember_categories' => '記住打開的分類',
 			'unread' => '只顯示未讀',
+			'unread_or_favorite' => 'Show unreads and favourites',	// TODO
 		),
 		'show_fav_unread_help' => '同樣適用於標籤',
 		'sides_close_article' => '點擊文章區域外以關閉',

+ 4 - 4
app/layout/aside_feed.phtml

@@ -3,11 +3,11 @@
 	/** @var FreshRSS_View $this */
 	$actual_view = Minz_Request::actionName();
 	$class = '';
-	if (FreshRSS_Context::userConf()->hide_read_feeds &&
-			FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) &&
+		if (FreshRSS_Context::userConf()->hide_read_feeds &&
+			(FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) || FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ)) &&
 			!FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
-		$class = ' state_unread';
-	}
+			$class = ' state_unread';
+		}
 
 	$state_filter_manual = Minz_Request::paramString('state');
 	if ($state_filter_manual !== '') {

+ 5 - 2
app/layout/nav_menu.phtml

@@ -22,7 +22,9 @@
 			foreach ($states as $state_str => $state) {
 				$state_enabled = FreshRSS_Context::isStateEnabled($state);
 				$url_state = Minz_Request::currentRequest();
-				$url_state['params']['state'] = FreshRSS_Context::getRevertState($state);
+				$reverted_state = FreshRSS_Context::getRevertState($state);
+				$reverted_state &= FreshRSS_Entry::STATE_ANDS;	// Keep only the AND states
+				$url_state['params']['state'] = $reverted_state;
 		?>
 		<a id="toggle-<?= $state_str ?>"
 			class="btn <?= $state_enabled ? 'active' : '' ?>"
@@ -153,7 +155,8 @@
 	$mark_before_today['params']['idMax'] = $today . '000000';
 	$mark_before_one_week = $mark_read_url;
 	$mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000';
-	$mark_unread_enabled = FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) or !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ);
+	$mark_unread_enabled = FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) ||
+		(!FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ));
 ?>
 				<li class="item separator">
 					<button class="as-link <?= $confirm ?>"

+ 2 - 1
app/views/configure/reading.phtml

@@ -29,9 +29,10 @@
 				<label class="group-name" for="default_view"><?= _t('conf.reading.show') ?></label>
 				<div class="group-controls">
 					<select name="default_view" id="default_view" data-leave-validation="<?= FreshRSS_Context::userConf()->default_view ?>">
+						<option value="unread"<?= FreshRSS_Context::userConf()->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option>
 						<option value="adaptive"<?= FreshRSS_Context::userConf()->default_view === 'adaptive' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.adaptive') ?></option>
+						<option value="unread_or_favorite"<?= FreshRSS_Context::userConf()->default_view === 'unread_or_favorite' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread_or_favorite') ?></option>
 						<option value="all"<?= FreshRSS_Context::userConf()->default_view === 'all' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.all_articles') ?></option>
-						<option value="unread"<?= FreshRSS_Context::userConf()->default_view === 'unread' ? ' selected="selected"' : '' ?>><?= _t('conf.reading.show.unread') ?></option>
 					</select>
 				</div>
 			</div>