Add TODOs and implement pressing enter to open link
This commit is contained in:
26
src/gui.rs
26
src/gui.rs
@@ -49,12 +49,36 @@ pub struct App {
|
||||
pub should_quit: bool,
|
||||
}
|
||||
|
||||
// TODO: The whole architecture of the app may be a bit unusual. Compare with
|
||||
// example on https://ratatui.rs/examples/widgets/scrollbar/
|
||||
// TODO: Implement exclusion and inclusion of papers (e.g., X and Y chars)
|
||||
// TODO: Implement moving through steps and iterations (populating pending papers)
|
||||
// TODO: Implement input of seed papers using IDs
|
||||
// TODO: Implement possibility of pushing excluded papers back into pending
|
||||
// TODO: Implement export of included papers as csv for keywording with a spreadsheet
|
||||
// TODO: Implement export of included papers into zotero (Use RIS format somehow)
|
||||
impl App {
|
||||
fn handle_key(&mut self, key: KeyCode) {
|
||||
match key {
|
||||
KeyCode::Char('q') => {
|
||||
self.should_quit = true;
|
||||
}
|
||||
KeyCode::Enter => match self.active_pane {
|
||||
ActivePane::IncludedPublications => {
|
||||
open::that(
|
||||
&self.included_publications[self.included_selected_idx]
|
||||
.id,
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
ActivePane::PendingPublications => {
|
||||
open::that(
|
||||
&self.pending_publications[self.pending_selected_idx]
|
||||
.id,
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
},
|
||||
KeyCode::Char('h') => {
|
||||
self.active_pane = ActivePane::IncludedPublications;
|
||||
}
|
||||
@@ -113,6 +137,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Implement scrolling. See
|
||||
//https://ratatui.rs/examples/widgets/scrollbar/
|
||||
fn ui(f: &mut Frame, app: &App) {
|
||||
// Root layout
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ impl From<serde_json::Error> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: The whole initialization and deinitialization and use of crossterm
|
||||
// might be unnecessary. Compare with example on
|
||||
// https://ratatui.rs/examples/widgets/scrollbar/
|
||||
fn main() -> io::Result<()> {
|
||||
let args = Args::parse();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ pub fn reconstruct_abstract(inverted_index: &HashMap<String, Vec<u32>>) -> Strin
|
||||
sanitized.replace("\u{a0}", " ").trim().to_string()
|
||||
}
|
||||
|
||||
|
||||
// TODO: Get all papers, not just the first page
|
||||
pub async fn get_citing_papers(
|
||||
target_id: &str,
|
||||
email: &str,
|
||||
|
||||
Reference in New Issue
Block a user