Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn run_discover(ctx: &mut crate::storage::AppContext) -> anyhow::Result<()>
let sims = discover_similar_projects(&conn)?;

let mut merged: HashMap<(String, String, String), Discovery> = HashMap::new();
for d in deps.into_iter().chain(sims.into_iter()) {
for d in deps.into_iter().chain(sims) {
let key = (d.from.clone(), d.to.clone(), d.relation_type.clone());
if let Some(existing) = merged.get(&key) {
if d.confidence > existing.confidence {
Expand Down
2 changes: 1 addition & 1 deletion src/knowledge_engine/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn generate_fallback_summary(path: &Path) -> (String, String) {
}
}
let mut pairs: Vec<(String, usize)> = counts.into_iter().collect();
pairs.sort_by(|a, b| b.1.cmp(&a.1));
pairs.sort_by_key(|b| std::cmp::Reverse(b.1));
let top: Vec<String> =
pairs.into_iter().take(3).map(|(e, c)| format!("{}({})", e, c)).collect();
if top.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/mcp/tools/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ fn collect_hot_files(repo_path: &std::path::Path, days: i64) -> Vec<serde_json::
);
}
let mut sorted: Vec<_> = file_counts.into_iter().collect();
sorted.sort_by(|a, b| b.1.cmp(&a.1));
sorted.sort_by_key(|b| std::cmp::Reverse(b.1));
sorted
.into_iter()
.take(10)
Expand Down
24 changes: 8 additions & 16 deletions src/tui/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,11 @@ pub(crate) async fn run_app<B: Backend>(
app.nlp_results.clear();
app.nlp_selected = 0;
}
KeyCode::Down => {
if app.nlp_selected + 1 < app.nlp_results.len() {
app.nlp_selected += 1;
}
KeyCode::Down if app.nlp_selected + 1 < app.nlp_results.len() => {
app.nlp_selected += 1;
}
KeyCode::Up => {
if app.nlp_selected > 0 {
app.nlp_selected -= 1;
}
KeyCode::Up if app.nlp_selected > 0 => {
app.nlp_selected -= 1;
}
_ => {}
}
Expand Down Expand Up @@ -240,15 +236,11 @@ pub(crate) async fn run_app<B: Backend>(
app.search_results.clear();
app.search_selected = 0;
}
KeyCode::Down => {
if app.search_selected + 1 < app.search_results.len() {
app.search_selected += 1;
}
KeyCode::Down if app.search_selected + 1 < app.search_results.len() => {
app.search_selected += 1;
}
KeyCode::Up => {
if app.search_selected > 0 {
app.search_selected -= 1;
}
KeyCode::Up if app.search_selected > 0 => {
app.search_selected -= 1;
}
KeyCode::Enter => {
if let Some(result) = app.search_results.get(app.search_selected) {
Expand Down
Loading