Add TODOs and implement pressing enter to open link

This commit is contained in:
2025-12-29 04:22:19 +02:00
parent 65936ea106
commit 5e65f09748
5 changed files with 68 additions and 1 deletions

View File

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

View File

@@ -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();

View File

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