claude-dashboard 0.2.2

A terminal TUI dashboard that renders Claude Code usage reports with token stats, project breakdowns, and language distribution.
Documentation
use serde::{Deserialize, Serialize};

// --- history.jsonl types ---

#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HistoryEntry {
    pub display: String,
    pub timestamp: i64,
    pub project: String,
    #[serde(default)]
    pub session_id: String,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_deserialize_history_entry() {
        let json = r#"{"display":"test msg","timestamp":1712345678000,"project":"D:\\dev\\example","sessionId":"abc123"}"#;
        let entry: HistoryEntry = serde_json::from_str(json).unwrap();
        assert_eq!(entry.display, "test msg");
        assert_eq!(entry.project, "D:\\dev\\example");
        assert_eq!(entry.session_id, "abc123");
    }

    #[test]
    fn test_deserialize_history_entry_missing_session_id() {
        let json = r#"{"display":"test","timestamp":1234567890,"project":"/test"}"#;
        let entry: HistoryEntry = serde_json::from_str(json).unwrap();
        assert_eq!(entry.session_id, "");
    }
}