Skip to content

Commit 33e15ba

Browse files
committed
tui:
added loading ...
1 parent 1985b73 commit 33e15ba

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

TODO.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
- General
2020
- [x] add the new filters to the GUI and TUI
2121
- [/] clean up the code
22-
- [x] add more logging in the code (and remove the `println!`s)
23-
- [x] bump versions when all else is done and publish to crates.io
24-
25-
- version 7.0
22+
- [/] add more logging in the code (and remove the `println!`s)
2623
- [ ] add more and better ways to filter dates
2724
- [x] add filters for git specific stuff like author, committer, etc
2825
- [ ] ability to get a git repo from a url using something like git clone

cargo-function-history/src/app/ui.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::BTreeMap;
1+
use std::{collections::BTreeMap, time::Duration};
22

33
use function_history_backend_thread::types::Status;
44
use tui::layout::{Alignment, Constraint, Direction, Layout, Rect};
@@ -100,8 +100,17 @@ fn draw_body<B: Backend>(app: &mut App, mut pos: Rect, frame: &mut Frame<B>) {
100100
};
101101
let tick_text: Vec<Spans> = match &app.cmd_output {
102102
CommandResult::None => match app.status {
103-
Status::Loading => vec![Spans::from("Loading...")],
104-
_ => vec![Spans::from("No output")],
103+
Status::Loading =>
104+
vec![Spans::from(format!(
105+
"Loading{}",
106+
".".repeat(((std::time::SystemTime::now()
107+
.duration_since(std::time::UNIX_EPOCH)
108+
.expect("Time went backwards")
109+
.as_millis()
110+
/ 100)
111+
% 4) as usize)
112+
))],
113+
_ => vec![Spans::from("Please enter some commands to search for a function.")],
105114
},
106115
a => a
107116
.to_string()

0 commit comments

Comments
 (0)