Add session-owned Pomodoro cycles and controls
Add configurable work and break intervals, pause/resume, CLI and activity-popup controls, and silent completion alerts. Use CLOCK_BOOTTIME deadlines so running timers include suspend without consuming paused time. Refs #31
This commit is contained in:
1 parent
53ba599918
commit
2c9bb85f2c
18 files changed
+1209
-16
No files matched your search
@@ -485,3 +485,26 @@ fn launcher_toggle_uses_the_shell_command() {
|
||||
);
|
||||
server.join().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pomodoro_commands_use_the_versioned_session_api() {
|
||||
for action in ["start", "pause", "resume", "next", "stop", "reset", "status"] {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
let socket = directory.path().join("control.sock");
|
||||
let listener = UnixListener::bind(&socket).unwrap();
|
||||
let worker = thread::spawn(move || {
|
||||
let (mut stream, _) = listener.accept().unwrap();
|
||||
let request: Request = read_frame(&mut stream).unwrap();
|
||||
assert_eq!(request.command, "pomodoro");
|
||||
assert_eq!(request.args, json!({"version":1,"action":action,"session":null}));
|
||||
write_frame(&mut stream, &Response::success(request.id, json!({"phase":"work"}))).unwrap();
|
||||
});
|
||||
success(
|
||||
ctl(&["--socket", socket.to_str().unwrap(), "pomodoro", action])
|
||||
.output()
|
||||
.unwrap(),
|
||||
);
|
||||
worker.join().unwrap();
|
||||
}
|
||||
success(ctl(&["pomodoro", "--help"]).output().unwrap());
|
||||
}
|
||||
Reference in new issue
Block a user