Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes are listed here. Format follows [Keep a Changelog](https://k

## [Unreleased]

## [0.5.9] - 2026-11-18

### Changed

- Dates and times are handled by jiff instead of chrono, which is no longer maintained. Your numbers don't change.
- `--since` explains itself plainly when it can't read a date.

### Fixed

- After **From now on**, choosing history that starts that same day now reads that day's earlier messages.

## [0.5.8] - 2026-11-18

### Added
Expand Down Expand Up @@ -305,7 +316,8 @@ First release.
- Per-source consent: nothing is read until you allow it, and Forget deletes a source's data
- `noactually` command-line tool (`sources`, `allow`, `sync`, `stats`)

[Unreleased]: https://github.com/HTMLGuyLLC/NoActually/compare/v0.5.8...HEAD
[Unreleased]: https://github.com/HTMLGuyLLC/NoActually/compare/v0.5.9...HEAD
[0.5.9]: https://github.com/HTMLGuyLLC/NoActually/compare/v0.5.8...v0.5.9
[0.5.8]: https://github.com/HTMLGuyLLC/NoActually/compare/v0.5.7...v0.5.8
[0.5.7]: https://github.com/HTMLGuyLLC/NoActually/compare/v0.5.6...v0.5.7
[0.5.6]: https://github.com/HTMLGuyLLC/NoActually/compare/v0.5.5...v0.5.6
Expand Down
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/engine", "crates/sources", "crates/store", "crates/cli", "app/src-tauri"]

[workspace.package]
version = "0.5.8"
version = "0.5.9"
edition = "2021"
# Oldest Rust that builds the whole workspace, app included. CI's `msrv` job checks it.
rust-version = "1.90"
Expand All @@ -25,7 +25,7 @@ store = { path = "crates/store", package = "noactually-store" }
regex = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
chrono = { version = "0.4", default-features = false, features = ["std", "clock", "serde"] }
jiff = { version = "0.2.38", features = ["serde"] }
rayon = "1"
rusqlite = { version = "0.43", features = ["bundled", "fallible_uint"] }
sha2 = "0.10"
Expand Down
4 changes: 2 additions & 2 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ These are the direct runtime dependencies from the `Cargo.toml` files (versions
| Crate | License |
|---|---|
| `tauri` 2.12.5 and the `tauri-plugin-*` crates (notification, autostart, positioner, dialog, single-instance, log, opener, updater) | Apache-2.0 OR MIT |
| `regex`, `serde`, `serde_json`, `chrono`, `anyhow`, `dirs`, `rayon`, `sha2`, `log` | MIT OR Apache-2.0 |
| `regex`, `serde`, `serde_json`, `anyhow`, `dirs`, `rayon`, `sha2`, `log` | MIT OR Apache-2.0 |
| `thiserror` | MIT OR Apache-2.0 |
| `memchr` | Unlicense OR MIT |
| `memchr`, `jiff` | Unlicense OR MIT |
| `ruzstd`, `rusqlite` | MIT |
| `notify` | CC0-1.0 |

Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "noactually-app",
"private": true,
"version": "0.5.8",
"version": "0.5.9",
"type": "module",
"packageManager": "pnpm@10.32.1",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cli = { path = "../../crates/cli", package = "noactually-cli" }
serde.workspace = true
# Used by the code `tauri::generate_context!` expands to.
serde_json.workspace = true
chrono.workspace = true
jiff.workspace = true
# The home folder, for the Codex files report cards add.
dirs.workspace = true
log.workspace = true
Expand Down
19 changes: 9 additions & 10 deletions app/src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use crate::updater::{self, UpdateStatus, Updates};
use crate::{lock, tracker::Msg, App, SyncStatus};
use chrono::{Local, NaiveDate};
use jiff::civil::Date;
use serde::Serialize;
use sources::{Kind, Source};
use std::path::Path;
Expand Down Expand Up @@ -99,14 +99,14 @@ pub fn meta(app: State<Arc<App>>) -> Meta {

#[tauri::command(async)]
pub fn stats(app: State<Arc<App>>, filter: Filter) -> Res<Stats> {
lock(&app.reader).stats(&filter, Local::now().date_naive()).map_err(err)
lock(&app.reader).stats(&filter, sources::time::today()).map_err(err)
}

/// The Improve tab: history for the filter, plus your goal, trophies and bests. Off the main
/// thread: it reads every week of history.
#[tauri::command(async)]
pub fn progress(app: State<Arc<App>>, filter: Filter) -> Res<Progress> {
lock(&app.reader).progress(&filter, Local::now().date_naive()).map_err(err)
lock(&app.reader).progress(&filter, sources::time::today()).map_err(err)
}

/// The latest report cards under the model filter, newest first, for Improve's recent list.
Expand All @@ -117,8 +117,8 @@ pub fn recent_report_cards(app: State<Arc<App>>, filter: Filter) -> Res<Vec<Rece

#[tauri::command(async)]
pub fn set_goal(app: State<Arc<App>>, kind: GoalKind, target: i64) -> Res<Goal> {
let now = chrono::Local::now();
lock(&app.writer).set_goal(kind, target, now.date_naive(), now.timestamp_millis()).map_err(err)
let now = jiff::Zoned::now();
lock(&app.writer).set_goal(kind, target, now.date(), now.timestamp().as_millisecond()).map_err(err)
}

#[tauri::command(async)]
Expand Down Expand Up @@ -197,7 +197,7 @@ pub fn allow_source(
handle: AppHandle,
app: State<Arc<App>>,
id: String,
since: Option<NaiveDate>,
since: Option<Date>,
from_now: Option<bool>,
) -> Res<()> {
only_main(window.label())?;
Expand Down Expand Up @@ -671,7 +671,7 @@ mod tests {
assert_eq!(demo["meta"], meta, "demo.json `meta` differs from the `meta` command");

let db = store::Store::open_in_memory().unwrap();
let stats = serde_json::to_value(db.stats(&Filter::default(), Local::now().date_naive()).unwrap()).unwrap();
let stats = serde_json::to_value(db.stats(&Filter::default(), sources::time::today()).unwrap()).unwrap();
let keys = |v: &serde_json::Value| -> Vec<String> {
let mut k: Vec<String> = v.as_object().unwrap().keys().cloned().collect();
k.sort();
Expand All @@ -692,8 +692,7 @@ mod tests {
"demo.json `prompts.tip` keys differ"
);
assert_eq!(keys(&demo["stats"]["overall"]), keys(&stats["overall"]), "demo.json `overall` keys differ");
let progress =
serde_json::to_value(db.progress(&Filter::default(), Local::now().date_naive()).unwrap()).unwrap();
let progress = serde_json::to_value(db.progress(&Filter::default(), sources::time::today()).unwrap()).unwrap();
assert_eq!(keys(&demo["progress"]), keys(&progress), "demo.json `progress` keys differ from `Progress`");
let week = serde_json::to_value(store::HistoryWeek::default()).unwrap();
for w in demo["progress"]["weeks"].as_array().unwrap() {
Expand Down Expand Up @@ -730,7 +729,7 @@ mod tests {
assert_eq!(keys(&shown["habit"]), keys(&trend["habit"]), "demo.json `insights.report_cards.habit` keys differ");
let recent = serde_json::to_value(store::RecentReportCard {
day: String::new(),
graded_day: chrono::NaiveDate::default(),
graded_day: jiff::civil::Date::default(),
source: String::new(),
grade: String::new(),
missing: Some(String::new()),
Expand Down
3 changes: 2 additions & 1 deletion app/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ pub fn apply_menu_bar(handle: &AppHandle, app: &App, enabled: bool) {
#[derive(Debug, Clone, Default, Serialize)]
pub struct SyncStatus {
pub syncing: bool,
pub last_sync: Option<chrono::DateTime<chrono::Utc>>,
#[serde(with = "sources::time::json")]
pub last_sync: Option<jiff::Timestamp>,
pub last_error: Option<String>,
pub files_with_errors: usize,
/// The pass in progress reads history again, so the numbers are partial until it ends.
Expand Down
9 changes: 4 additions & 5 deletions app/src-tauri/src/milestones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//! so backfilling history never fires a pile of old milestones.

use crate::{lock, App};
use chrono::Local;
use store::milestones::{crossed, goal_milestones, Milestone, Snapshot};
use store::GoalNews;
use tauri::AppHandle;
Expand Down Expand Up @@ -50,13 +49,13 @@ fn due(

pub fn check(handle: &AppHandle, app: &App, quiet: Quiet) {
let store = lock(&app.writer);
let Ok(stats) = store.stats(&store::Filter::default(), Local::now().date_naive()) else { return };
let Ok(stats) = store.stats(&store::Filter::default(), sources::time::today()) else { return };
let now = Snapshot::of(&stats);
let prev = store.advance_milestones(&now);
// Like the goal's weeks, the report card baseline moves even on a quiet pass.
let cards = store.advance_card_milestones(Local::now().date_naive(), !quiet.goal);
let cards = store.advance_card_milestones(sources::time::today(), !quiet.goal);
// Freeze the goal's finished weeks even on a quiet pass, so they're never re-judged later.
let goal = store.close_goal_weeks(Local::now().date_naive());
let goal = store.close_goal_weeks(sources::time::today());
drop(store);
let goal = goal.unwrap_or_else(|e| {
log::warn!("couldn't close the goal's weeks: {e}");
Expand Down Expand Up @@ -107,7 +106,7 @@ mod tests {
id: 1,
kind: store::GoalKind::Tier { tier: Tier::Coworker },
target: 0,
start: chrono::NaiveDate::from_ymd_opt(2026, 10, 1).unwrap(),
start: jiff::civil::date(2026, 10, 1),
}),
}
}
Expand Down
10 changes: 5 additions & 5 deletions app/src-tauri/src/report_cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod plugin_files;
mod tests;

use crate::{lock, App};
use chrono::{DateTime, Local, NaiveDate};
use jiff::civil::Date;
use serde::{Deserialize, Serialize};
use std::fs;
use std::io::{ErrorKind, Read};
Expand Down Expand Up @@ -422,7 +422,7 @@ fn plugin_source() -> String {
/// anything. After that come a check that couldn't be made now, what an earlier check found wrong with the
/// downloaded plugin (`claude::saved_problem`), and a move it left unfinished (`claude::Pending`), until
/// a launch finishes it.
fn status(env: &Env, last_cards: &[(String, NaiveDate)], problem: Option<String>) -> Status {
fn status(env: &Env, last_cards: &[(String, Date)], problem: Option<String>) -> Status {
let last = |tool: Tool| last_cards.iter().find(|(s, _)| s == tool.source()).map(|(_, day)| day.to_string());
let claude_installed = env.claude.is_some();
let codex_installed = codex::installed(env);
Expand Down Expand Up @@ -621,7 +621,7 @@ pub async fn report_cards_status(window: tauri::Window, app: State<'_, Arc<App>>
let reader = lock(&app.reader);
let state = reader.source_state(Tool::ClaudeCode.source()).ok().flatten();
let since = tips_since(&env, &shown).filter(|_| state.is_some_and(|s| s.allowed && !s.paused));
let tip_activity = reader.tip_activity(Local::now().date_naive(), since).unwrap_or_else(|e| {
let tip_activity = reader.tip_activity(sources::time::today(), since).unwrap_or_else(|e| {
log::warn!("report cards: couldn't read how tips are doing: {e}");
TipActivity::default()
});
Expand All @@ -634,9 +634,9 @@ pub async fn report_cards_status(window: tauri::Window, app: State<'_, Arc<App>>
}

/// The day tips were turned on, when they're on and able to reach a chat.
fn tips_since(env: &Env, shown: &Status) -> Option<NaiveDate> {
fn tips_since(env: &Env, shown: &Status) -> Option<Date> {
let on = fs::metadata(env.tips_file()).and_then(|m| m.modified()).ok();
on.filter(|_| shown.claude_code.on).map(|t| DateTime::<Local>::from(t).date_naive())
on.filter(|_| shown.claude_code.on).and_then(|t| jiff::Timestamp::try_from(t).ok()).map(sources::time::local_day)
}

#[tauri::command]
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/src/report_cards/codex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ fn read_hooks(path: &Path) -> Res<Option<Json>> {
/// Copies the hooks file as it is to `hooks.json.bak-YYYYMMDD-HHMMSS` beside it, never over an
/// earlier copy (a second one in the same second gets `-1`, `-2`...).
fn back_up(real: &Path) -> std::io::Result<()> {
let stamp = chrono::Local::now().format("%Y%m%d-%H%M%S");
let stamp = jiff::Zoned::now().strftime("%Y%m%d-%H%M%S");
let mut src = std::fs::File::open(real)?;
for n in 0.. {
let name = if n == 0 { format!("hooks.json.bak-{stamp}") } else { format!("hooks.json.bak-{stamp}-{n}") };
Expand Down
6 changes: 3 additions & 3 deletions app/src-tauri/src/report_cards/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3083,14 +3083,14 @@ fn what_an_app_update_writes_is_written_like_a_fresh_turn_on() {
assert_eq!(names, ["na"], "written through a temporary file that is gone");
}

fn day(text: &str) -> NaiveDate {
fn day(text: &str) -> Date {
text.parse().unwrap()
}

#[test]
fn the_latest_card_is_per_tool() {
let lab = Lab::with_claude();
let last: Vec<(String, NaiveDate)> = [
let last: Vec<(String, Date)> = [
("claude-code", "2026-10-28"),
("codex", "2026-10-20"),
("claude-cowork", "2026-10-29"),
Expand Down Expand Up @@ -3162,7 +3162,7 @@ fn tips_since_is_the_day_they_went_on_only_while_claude_code_is_on() {
};
assert_eq!(tips_since(&lab.env, &shown(true)), None, "tips are off");
set_tips(&lab.env, true).unwrap();
assert_eq!(tips_since(&lab.env, &shown(true)), Some(Local::now().date_naive()));
assert_eq!(tips_since(&lab.env, &shown(true)), Some(sources::time::today()));
assert_eq!(tips_since(&lab.env, &shown(false)), None, "the hook isn't there to give the rules");
}

Expand Down
17 changes: 8 additions & 9 deletions app/src-tauri/src/tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn pass_started(status: &mut SyncStatus, rebuilding: bool) {
}

/// A pass ended well, with `errors` files skipped.
fn pass_succeeded(status: &mut SyncStatus, errors: usize, now: chrono::DateTime<chrono::Utc>) {
fn pass_succeeded(status: &mut SyncStatus, errors: usize, now: jiff::Timestamp) {
status.syncing = false;
status.rebuilding = false;
status.last_sync = Some(now);
Expand All @@ -109,7 +109,7 @@ fn pass_succeeded(status: &mut SyncStatus, errors: usize, now: chrono::DateTime<
}

/// A pass failed: the last sync time still moves, so the window says when it last tried.
fn pass_failed(status: &mut SyncStatus, message: String, now: chrono::DateTime<chrono::Utc>) {
fn pass_failed(status: &mut SyncStatus, message: String, now: jiff::Timestamp) {
status.syncing = false;
status.rebuilding = false;
status.last_sync = Some(now);
Expand Down Expand Up @@ -153,11 +153,11 @@ fn sync_once(handle: &AppHandle, app: &App, quiet: bool) {
log::warn!("{line}");
}
let changed = pass_changed(r.files_read, r.rescored, r.errors.len(), &status, rebuilding);
pass_succeeded(&mut status, r.errors.len(), chrono::Utc::now());
pass_succeeded(&mut status, r.errors.len(), jiff::Timestamp::now());
drop(status);
if r.rescored {
// Kept so the window can say so after the popup is gone, or if popups are off.
let when = chrono::Utc::now().to_rfc3339();
let when = sources::time::rfc3339(jiff::Timestamp::now());
if let Err(e) = lock(&app.writer).set_setting(crate::RESCORED_NOTICE_KEY, &when) {
log::warn!("couldn't note that scores were rebuilt: {e}");
}
Expand All @@ -172,7 +172,7 @@ fn sync_once(handle: &AppHandle, app: &App, quiet: bool) {
}
Err(e) => {
log::error!("sync failed: {}", shorten_home_in(&format!("{e:#}"), std::env::home_dir().as_deref()));
pass_failed(&mut status, e.to_string(), chrono::Utc::now());
pass_failed(&mut status, e.to_string(), jiff::Timestamp::now());
drop(status);
let _ = handle.emit("sync-failed", e.to_string());
}
Expand All @@ -181,7 +181,7 @@ fn sync_once(handle: &AppHandle, app: &App, quiet: bool) {

/// Hovering the menu bar icon shows the score without opening anything.
fn update_tray(handle: &AppHandle, app: &App) {
let Ok(o) = lock(&app.reader).overall(chrono::Local::now().date_naive()) else { return };
let Ok(o) = lock(&app.reader).overall(sources::time::today()) else { return };
if let Some(tray) = handle.tray_by_id("tray") {
let tip = match (o.score, o.tier) {
(Some(score), Some(tier)) => format!("No, Actually... · {} · score {score}", tier.name()),
Expand Down Expand Up @@ -269,10 +269,9 @@ pub fn spawn(handle: AppHandle, app: Arc<App>, tx: mpsc::Sender<Msg>, rx: mpsc::
#[cfg(test)]
mod tests {
use super::*;
use chrono::{TimeZone, Utc};

fn at() -> chrono::DateTime<Utc> {
Utc.with_ymd_and_hms(2026, 11, 1, 12, 0, 0).unwrap()
fn at() -> jiff::Timestamp {
"2026-11-01T12:00:00Z".parse().unwrap()
}

/// A stand-in for the tracking thread, which answers `Stop` after `pass`.
Expand Down
Loading
Loading