Skip to content

Commit aa77a51

Browse files
zippoxerclaude
andcommitted
v0.1.4: Revert to folder scope default, add helpful hint for empty results
- Default search scope back to current folder (not everywhere) - Show "Nothing here. Press / to search everywhere." when folder has no sessions - Show "No results. Press / to search everywhere." when query has no matches - Use full-width layout when no results for better hint display 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 13b3748 commit aa77a51

File tree

3 files changed

+34
-19
lines changed

3 files changed

+34
-19
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "recall"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
edition = "2021"
55
description = "Search and resume Claude Code and Codex CLI conversations"
66

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl App {
9898
total_sessions: 0,
9999
index_rx: Some(rx),
100100
indexing: true,
101-
search_scope: SearchScope::Everything,
101+
search_scope: SearchScope::Folder(launch_cwd.clone()),
102102
launch_cwd,
103103
};
104104

src/ui.rs

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::app::App;
1+
use crate::app::{App, SearchScope};
22
use crate::session::{Role, SessionSource};
33
use crate::theme::Theme;
44
use ratatui::{
@@ -54,19 +54,24 @@ pub fn render(frame: &mut Frame, app: &mut App) {
5454
])
5555
.split(main_layout[2]);
5656

57-
// Two-pane layout: 40% results, 2 space padding, 60% preview
58-
let content_layout = Layout::default()
59-
.direction(Direction::Horizontal)
60-
.constraints([
61-
Constraint::Percentage(40),
62-
Constraint::Length(2), // Padding between panes
63-
Constraint::Percentage(60),
64-
])
65-
.split(content_with_padding[1]);
66-
67-
render_results_list(frame, app, content_layout[0]);
68-
// content_layout[1] is the padding space - left empty
69-
render_preview(frame, app, content_layout[2]);
57+
// When no results, use full width for the hint message
58+
if app.results.is_empty() {
59+
render_results_list(frame, app, content_with_padding[1]);
60+
} else {
61+
// Two-pane layout: 40% results, 2 space padding, 60% preview
62+
let content_layout = Layout::default()
63+
.direction(Direction::Horizontal)
64+
.constraints([
65+
Constraint::Percentage(40),
66+
Constraint::Length(2), // Padding between panes
67+
Constraint::Percentage(60),
68+
])
69+
.split(content_with_padding[1]);
70+
71+
render_results_list(frame, app, content_layout[0]);
72+
// content_layout[1] is the padding space - left empty
73+
render_preview(frame, app, content_layout[2]);
74+
}
7075

7176
// Add horizontal padding to status bar
7277
let status_with_padding = Layout::default()
@@ -152,10 +157,20 @@ fn render_results_list(frame: &mut Frame, app: &mut App, area: Rect) {
152157
let available_width = area.width.saturating_sub(2) as usize;
153158

154159
if app.results.is_empty() {
155-
if !app.query.is_empty() {
160+
// Show hint to search everywhere if scoped and no results
161+
let is_scoped = !matches!(app.search_scope, SearchScope::Everything);
162+
if is_scoped {
163+
let prefix = if app.query.is_empty() { "Nothing here." } else { "No results." };
164+
let hint = Line::from(vec![
165+
Span::styled(format!(" {} Press ", prefix), Style::default().fg(t.snippet_fg)),
166+
Span::styled(" / ", Style::default().bg(t.keycap_bg)),
167+
Span::styled(" to search everywhere.", Style::default().fg(t.snippet_fg)),
168+
]);
169+
frame.render_widget(Paragraph::new(hint), area);
170+
} else if !app.query.is_empty() {
156171
let paragraph = Paragraph::new(Span::styled(
157-
"No results",
158-
Style::default().fg(t.dim_fg),
172+
" No results.",
173+
Style::default().fg(t.snippet_fg),
159174
));
160175
frame.render_widget(paragraph, area);
161176
}

0 commit comments

Comments
 (0)