From 3cecc7157bf6cce8c453d70bd2862ac0744b8a00 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Sun, 18 Apr 2021 13:27:10 +0200 Subject: [PATCH] Add sidebar filter "first review today" --- ftl/core/browsing.ftl | 1 + qt/aqt/browser/sidebar/tree.py | 6 ++++++ rslib/backend.proto | 1 + rslib/src/backend/search/search_node.rs | 1 + 4 files changed, 9 insertions(+) diff --git a/ftl/core/browsing.ftl b/ftl/core/browsing.ftl index b99e40952..ca5c72b60 100644 --- a/ftl/core/browsing.ftl +++ b/ftl/core/browsing.ftl @@ -146,6 +146,7 @@ browsing-studied-today = Studied browsing-added-today = Added browsing-again-today = Again browsing-edited-today = Edited +browsing-sidebar-first-review = First Review browsing-sidebar-due-today = Due browsing-sidebar-untagged = Untagged browsing-sidebar-overdue = Overdue diff --git a/qt/aqt/browser/sidebar/tree.py b/qt/aqt/browser/sidebar/tree.py index daba51389..a56588c2f 100644 --- a/qt/aqt/browser/sidebar/tree.py +++ b/qt/aqt/browser/sidebar/tree.py @@ -513,6 +513,12 @@ class SidebarTreeView(QTreeView): type=type, search_node=SearchNode(rated=SearchNode.Rated(days=1)), ) + root.add_simple( + name=tr.browsing_sidebar_first_review(), + icon=icon, + type=type, + search_node=SearchNode(introduced_in_days=1), + ) root.add_simple( name=tr.browsing_again_today(), icon=icon, diff --git a/rslib/backend.proto b/rslib/backend.proto index 85603fbe6..b757385d9 100644 --- a/rslib/backend.proto +++ b/rslib/backend.proto @@ -872,6 +872,7 @@ message SearchNode { int32 due_on_day = 16; string tag = 17; string note = 18; + uint32 introduced_in_days = 19; } } diff --git a/rslib/src/backend/search/search_node.rs b/rslib/src/backend/search/search_node.rs index 1a0897c80..668e10b0f 100644 --- a/rslib/src/backend/search/search_node.rs +++ b/rslib/src/backend/search/search_node.rs @@ -49,6 +49,7 @@ impl TryFrom for Node { ease: rated.rating().into(), }), Filter::AddedInDays(u) => Node::Search(SearchNode::AddedInDays(u)), + Filter::IntroducedInDays(u) => Node::Search(SearchNode::IntroducedInDays(u)), Filter::DueInDays(i) => Node::Search(SearchNode::Property { operator: "<=".to_string(), kind: PropertyKind::Due(i),