Add sidebar filter "first review today"

This commit is contained in:
RumovZ 2021-04-18 13:27:10 +02:00
parent e274ff26ab
commit 3cecc7157b
4 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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,

View File

@ -872,6 +872,7 @@ message SearchNode {
int32 due_on_day = 16;
string tag = 17;
string note = 18;
uint32 introduced_in_days = 19;
}
}

View File

@ -49,6 +49,7 @@ impl TryFrom<pb::SearchNode> 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),