Rewrite history page

This commit is contained in:
micialware committed 2026-09-04 11:18:23 +03:00
1 parent f19a6f64c3
commit 532640058e
11 files changed
+201 -230

No files matched your search

+3 -5
View File
@@ -1,13 +1,10 @@
use std::sync::Arc;
use crate::data::Id;
use crate::data_provider::decks::{DeckRepository};
use crate::data_provider::settings::get_setting;
use crate::data_provider::sqlite::{SqliteConnection};
use crate::data_provider::words::{WordRepository};
use crate::navigation::RootMessage::Keyboard;
use crate::navigation::{AppSettings, RootMessage, ScreenState};
use chrono::NaiveDate;
use hashbrown::HashMap;
use iced::{Subscription, keyboard, window};
use iced_core::window::Position;
#[cfg(target_os = "linux")]
@@ -18,6 +15,7 @@ use parking_lot::RwLock;
use rusqlite::Connection;
use crate::data::repositories::Repository;
use crate::data_provider::card_states::CardStateRepository;
use crate::data_provider::history::HistoryRepository;
use crate::data_provider::word_groups::WordGroupRepository;
pub const USER_FONT: Font = Font::with_name("Noto Sans JP");
@@ -69,7 +67,7 @@ pub struct AppState {
pub card_states: CardStateRepository,
pub connection: Arc<RwLock<SqliteConnection>>,
pub sync_data: Arc<RwLock<AppSettings>>,
pub activity: HashMap<Id, Vec<(NaiveDate, u32)>>,
pub history: HistoryRepository,
}
impl Default for AppState {
@@ -86,11 +84,11 @@ impl AppState {
decks: DeckRepository::new(connection.clone()),
word_groups: WordGroupRepository::new(connection.clone()),
card_states: CardStateRepository::new(connection.clone()),
history: HistoryRepository::new(connection.clone()),
sync_data: Arc::new(RwLock::new(AppSettings {
key: None,
auto_web_fetch: false,
})),
activity: Default::default(),
connection,
}
}