Architecture
High-level Flow
- Load token → cache → quota
- Resolve workspace, projects, clients, entries (cache-first)
- Group entries by project + client
- Render dashboard
Modules
- app.rs: App state, cache/quota logic, key handling, settings
- ui.rs: Layout, panels, modals, themes
- toggl.rs: API client + error mapping
- storage.rs: Token, cache, quota, config
- grouping.rs: Aggregation + sorting
- dates.rs: Date parsing/range helpers
Cache Strategy
Cache records are keyed by:
token_hash + workspace_id + date_range
Manual refresh (r) attempts API calls; otherwise cache is used whenever available.