Import/export feature for config and data

This commit is contained in:
2026-02-22 07:36:34 +00:00
parent 9cc8a214ad
commit 9deffc3d1d
15 changed files with 1717 additions and 125 deletions

View File

@@ -12,6 +12,7 @@ pub struct StatsSidebar<'a> {
drill: &'a DrillState,
last_result: Option<&'a DrillResult>,
history: &'a [DrillResult],
target_wpm: u32,
theme: &'a Theme,
}
@@ -20,12 +21,14 @@ impl<'a> StatsSidebar<'a> {
drill: &'a DrillState,
last_result: Option<&'a DrillResult>,
history: &'a [DrillResult],
target_wpm: u32,
theme: &'a Theme,
) -> Self {
Self {
drill,
last_result,
history,
target_wpm,
theme,
}
}
@@ -82,6 +85,13 @@ impl Widget for StatsSidebar<'_> {
Span::styled("WPM: ", Style::default().fg(colors.fg())),
Span::styled(wpm_str, Style::default().fg(colors.accent())),
]),
Line::from(vec![
Span::styled("Target: ", Style::default().fg(colors.fg())),
Span::styled(
format!("{} WPM", self.target_wpm),
Style::default().fg(colors.text_pending()),
),
]),
Line::from(""),
Line::from(vec![
Span::styled("Accuracy: ", Style::default().fg(colors.fg())),