forked from kent/consciousness
Remove dead code: old context builder, plan_context, journal parsing
Removed from context.rs: ContextPlan, plan_context, render_journal_text, assemble_context, truncate_at_section, find_journal_cutoff, parse_msg_timestamp. All replaced by trim_conversation + journal from memory graph. Removed from tui.rs: most_recent_file, format_duration (filesystem scanning leftovers). Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
e9e47eb798
commit
47c6694b10
3 changed files with 11 additions and 293 deletions
|
|
@ -1044,7 +1044,7 @@ impl App {
|
|||
|
||||
let mut lines: Vec<Line> = Vec::new();
|
||||
let section = Style::default().fg(Color::Yellow);
|
||||
let dim = Style::default().fg(Color::DarkGray);
|
||||
let _dim = Style::default().fg(Color::DarkGray);
|
||||
let hint = Style::default().fg(Color::DarkGray).add_modifier(Modifier::ITALIC);
|
||||
|
||||
lines.push(Line::raw(""));
|
||||
|
|
@ -1150,34 +1150,6 @@ impl App {
|
|||
frame.render_widget(para, size);
|
||||
}
|
||||
|
||||
fn most_recent_file(dir: &std::path::Path) -> Option<(String, String)> {
|
||||
let entries = std::fs::read_dir(dir).ok()?;
|
||||
let mut latest: Option<(String, std::time::SystemTime)> = None;
|
||||
for entry in entries.flatten() {
|
||||
let name = entry.file_name().to_string_lossy().to_string();
|
||||
if name.starts_with("pid-") || name.starts_with("transcript-offset") { continue; }
|
||||
if let Ok(meta) = entry.metadata() {
|
||||
if let Ok(modified) = meta.modified() {
|
||||
if latest.as_ref().map_or(true, |(_, t)| modified > *t) {
|
||||
latest = Some((name, modified));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
latest.map(|(name, time)| {
|
||||
let ago = time.elapsed().map(|d| Self::format_duration(d))
|
||||
.unwrap_or_else(|_| "?".into());
|
||||
(name, ago)
|
||||
})
|
||||
}
|
||||
|
||||
fn format_duration(d: std::time::Duration) -> String {
|
||||
let secs = d.as_secs();
|
||||
if secs < 60 { format!("{}s ago", secs) }
|
||||
else if secs < 3600 { format!("{}m ago", secs / 60) }
|
||||
else { format!("{}h ago", secs / 3600) }
|
||||
}
|
||||
|
||||
fn draw_debug(&self, frame: &mut Frame, size: Rect) {
|
||||
let mut lines: Vec<Line> = Vec::new();
|
||||
let section = Style::default().fg(Color::Yellow);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue