Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat: move project path from header to below input box

tikikun1f27cd90db65
diff --git a/src-tauri/src/core/cli/tui.rs b/src-tauri/src/core/cli/tui.rs
index f6b1d7d5e..2d02cd528 100644
--- a/src-tauri/src/core/cli/tui.rs
+++ b/src-tauri/src/core/cli/tui.rs
@@ -3795,7 +3795,8 @@ fn draw(f: &mut Frame, app: &mut App) {
Constraint::Length(1),
Constraint::Min(1),
Constraint::Length(input_h),
- Constraint::Length(1),
+ Constraint::Length(1), // path line
+ Constraint::Length(1), // footer
])
.split(f.area());
@@ -3810,7 +3811,8 @@ fn draw(f: &mut Frame, app: &mut App) {
app.row_index.clear();
draw_picker(f, chunks[1], picker);
f.render_widget(input_box(app), chunks[2]);
- f.render_widget(footer(app), chunks[3]);
+ f.render_widget(path_line(app), chunks[3]);
+ f.render_widget(footer(app), chunks[4]);
return;
}
@@ -3986,7 +3988,8 @@ fn draw(f: &mut Frame, app: &mut App) {
0
};
f.render_widget(input_box(app).scroll((input_scroll, 0)), chunks[2]);
- f.render_widget(footer(app), chunks[3]);
+ f.render_widget(path_line(app), chunks[3]);
+ f.render_widget(footer(app), chunks[4]);
// Dock the permission prompt directly above the input box, growing upward
// and clamped to the body area so it never overruns the transcript.
@@ -4241,11 +4244,6 @@ fn header(app: &App) -> Paragraph<'static> {
(n, 0) => format!("turn {n} "),
(n, m) => format!("turn {n}/{m} "),
};
- let dir_name = app
- .project_root
- .file_name()
- .and_then(|n| n.to_str())
- .unwrap_or(".");
let elapsed = app
.run_started
.map(|t| format!(" {}", format_elapsed(t.elapsed().as_secs())))
@@ -4253,7 +4251,6 @@ fn header(app: &App) -> Paragraph<'static> {
let mut spans = vec![
Span::styled(" jan agent ", Style::new().on_blue().white().bold()),
Span::raw(format!(" {} ", app.model)),
- Span::styled(format!("πŸ“‚ {}", dir_name), Style::new().dark_gray()),
];
if let Some(branch) = app.git_branch.as_ref() {
spans.push(Span::styled(
@@ -4412,6 +4409,21 @@ fn hint_spans(key_style: Style, pairs: &[(&str, &str)]) -> Vec<Span<'static>> {
spans
}
+/// One-line path display shown below the input box.
+fn path_line(app: &App) -> Paragraph<'static> {
+ let path = app.project_root.to_string_lossy();
+ let git = app
+ .git_branch
+ .as_ref()
+ .map(|b| format!(" βŽ‡ {}", b))
+ .unwrap_or_default();
+ Paragraph::new(Line::from(vec![
+ Span::styled("πŸ“‚ ", Style::new().dark_gray()),
+ Span::styled(path.to_string(), Style::new().dark_gray()),
+ Span::styled(git, Style::new().dark_gray()),
+ ]))
+}
+
fn footer(app: &App) -> Paragraph<'static> {
if !app.pending_queue.is_empty() {
return Paragraph::new(Line::from(hint_spans(