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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Keys: `keymap.rs` is the one table of commands, what each is called and its keys

Settings: `settings.rs` holds what it does without widgets, and its tests: `ConfigFile` and `EnvEdit` read the files `GET /api/v1/files` names, refuse a file that changed since it was shown, change the config through `pending_core::edit::ConfigDoc` (comments and order kept), load the result with `pending_runtime::config::check` and write it with `write_file` (one step, links followed, the env file 0600), and the forms of a source and a stack turn what a page shows into those changes. `ui/settings.rs` is its main page and `ui/sources.rs` the pages of a source, of the kinds and of a stack, built from `pending_core::schema`. A secret is never read back into an entry. The sandbox edits `src/sandbox.toml` and a made-up env file in memory.

Todos: `todo_store.rs` keeps them in `todos.sqlite3` in the data dir (`pending_runtime::config::data_dir`), through `rusqlite` with SQLite bundled; `session::Todos` writes the whole list on every change, so a save that works makes good one that failed. The file carries an `application_id` and a `user_version`: a schema change is a new entry at the end of `MIGRATIONS`, never an edit to one that shipped, and a file from a newer schema is read and never written. `scripts/install.sh --uninstall` removes only the files it installed from that folder. The sandbox and `--screenshot` keep their todos in memory. Alerts are not saved.
Todos: `todo_store.rs` keeps them in `todos.sqlite3` in the data dir (`pending_runtime::config::data_dir`), through `rusqlite` with SQLite bundled; `session::Todos` writes the whole list on every change, so a save that works makes good one that failed. A todo in Done keeps when it went there (`done_at`), and `Todos::expire`, run on the window's alert tick, deletes those `session::DONE_LASTS` (40 minutes) or more in Done. The file carries an `application_id` and a `user_version`: a schema change is a new entry at the end of `MIGRATIONS`, never an edit to one that shipped, and a file from a newer schema, or an older one the migration cannot write to, is read and never written. `secure_delete` is on, so a deleted todo leaves no text in the file. `scripts/install.sh --uninstall` removes only the files it installed from that folder. The sandbox and `--screenshot` keep their todos in memory. Alerts are not saved.

The app's tests need no display (CI has none): what they check lives outside the widgets, in `present`, `state`, `view` and `backend`, against a stand-in daemon on a loopback port. Widget lifetimes (closures that capture a widget hold it alive: capture it weakly when the widget owns the closure) and keyboard focus (never `can_focus(false)` on a container, which shuts its children out) are checked by hand on a display.

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.10.1

A todo 40 minutes in Done is deleted, and nothing of it is kept.

### Changed

- A todo 40 minutes in Done is deleted, with its alert, and nothing of it is kept, in the todo file either; moving it out of Done stops the 40 minutes, and moving it back starts them over. The 40 minutes go on while TasksPending is closed, and the todo dialog says how long todos are kept. A todo already in Done in the file of 0.9.0 or 0.10.0 gets its 40 minutes from the first time 0.10.1 counts them. The todo file gains a column for when a todo went to Done, so 0.9.0 and 0.10.0 open it read-only: what changes in them is lost when they quit.

## 0.10.0

Settings sets the sources, their stacks and their tokens up, writing the config file with its comments kept and the env file, and the keyboard moves only between the cards.
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ members = [
resolver = "3"

[workspace.package]
version = "0.10.0"
version = "0.10.1"
edition = "2024"
rust-version = "1.95"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A click on the icon (ringed) drops the window down, and the next sends it away.

<p align="center">
<img src="docs/assets/tasks-pending-board.png" alt="The Board tab: one group of stacks per source, with the picked cards highlighted" width="49%">
<img src="docs/assets/tasks-pending-todo.png" alt="The New todo dialog: a title, optional details, and the note that todos are kept while alerts last as long as TasksPending runs" width="49%">
<img src="docs/assets/tasks-pending-todo.png" alt="The New todo dialog: a title, optional details, and the note that todos are kept until 40 minutes in Done while alerts last as long as TasksPending runs" width="49%">
</p>

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion crates/pending-app/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Soft corners: 12px for groups and stage columns, dialog rows at 8px, cards at 10
- Card: card surface, 1px border, 10px radius, 10/12px padding; title (a link when the item has one, same colour, accent on hover), two lines of body in Text 2, and one three-dot button at the end that appears on hover and stays while its menu is open. The menu holds every action: the stage moves (on Activity), send to or remove from Activity, Snooze (on the Board), Alert me about, Cancel the alert, and for a todo Edit and Delete in place of the Activity entry and Snooze. Picked: accent tint and the inset accent line. Changed: a dot before the title. Alert: a caption line in Text 2 with an alarm icon and the time. Keyboard focus, when the keyboard put it there: a 2px ring in the text colour, 2px out, never the accent, so it does not read as picked; the three dots shown. On the page only the cards take the focus. The stage moves and Edit show their key at the end of the menu entry, and the other entries none: GTK makes a key shown there a shortcut while the menu is open, and Delete would delete on one press.
- Tabs: pill buttons on the page with a 1px border; the open one is filled with the accent tint and outlined with the accent. Activity carries its count in a pill.
- Stage: a group-like box with the stack label style for its name and a count pill; an empty one says so in Text 3.
- Todo: a card in the Activity named after no source ("Todo" under it, no logo), written down with the New control at the end of Picked's header; its dialog is two entries, the note on what is kept in Text 3, Cancel and the one primary button. While the todos cannot be saved, the Activity opens with a stale notice saying so, over the stages.
- Todo: a card in the Activity named after no source ("Todo" under it, no logo), written down with the New control at the end of Picked's header; its dialog is two entries, the note on what is kept (until 40 minutes in Done) in Text 3, Cancel and the one primary button. While the todos cannot be saved, the Activity opens with a stale notice saying so, over the stages.
- Stack header: a flat button with a chevron (rotated when collapsed), the upper-case name, a count pill, and the dot when a card inside changed.
- Group: group surface, 1px border, 12px radius; the logo sits in a 28px tile on the card surface.
- Controls: 34px buttons with a 1px border on the group surface; Refresh is the one filled with accent, and as wide as its longest label ("Refreshing…") whatever it says, its icon and label centred, so nothing beside it moves; the gear carries a 7px accent dot while the board filter is on, and turns into the warning icon, in Warning, while a source needs a look. There is no Sources button: the sources head Settings.
Expand Down
27 changes: 19 additions & 8 deletions crates/pending-app/src/present.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use pending_core::{
use crate::alert;
use crate::backend::{Command, Refusal};
use crate::keymap::Command as KeyCommand;
use crate::session::{Session, Todo};
use crate::session::{DONE_LASTS, Session, Todo};
use crate::snooze::{self, until_text};
use crate::state::ViewState;
use crate::theme::OmarchyTheme;
Expand Down Expand Up @@ -454,8 +454,14 @@ pub fn todo_note(kept: bool, unsaved: Option<&str>) -> String {
Some(why) => {
format!("{TODO_UNSAVED} ({why}): quitting TasksPending forgets the changes.")
}
None if kept => "Todos are kept; alerts last as long as TasksPending runs.".to_owned(),
None => "Kept only while TasksPending runs: quitting it forgets every todo.".to_owned(),
None if kept => format!(
"Kept until {} minutes in Done; alerts last as long as TasksPending runs.",
DONE_LASTS.num_minutes()
),
None => format!(
"Kept until {} minutes in Done, and only while TasksPending runs.",
DONE_LASTS.num_minutes()
),
}
}

Expand Down Expand Up @@ -1436,7 +1442,11 @@ mod tests {
.add("Write the release notes", "for 0.7")
.unwrap();
let second = session.todos.add("Call the bank", "").unwrap();
assert!(session.todos.move_to(&second, Stage::InProgress));
assert!(
session
.todos
.move_to(&second, Stage::InProgress, chrono::Utc::now())
);
let view = View {
board: Some("Work".to_owned()),
..View::default()
Expand Down Expand Up @@ -1644,17 +1654,18 @@ mod tests {
assert!(quick_menu(&card, Place::Board, K::Pick).is_empty());
}

/// The todo dialog says what becomes of the todo: kept in the file,
/// kept for the run (the sandbox), or not saved, and why.
/// The todo dialog says what becomes of the todo: kept in the file
/// until it has been 40 minutes in Done, kept for the run (the
/// sandbox), or not saved, and why.
#[test]
fn the_todo_dialog_says_whether_todos_are_kept() {
assert_eq!(
todo_note(true, None),
"Todos are kept; alerts last as long as TasksPending runs."
"Kept until 40 minutes in Done; alerts last as long as TasksPending runs."
);
assert_eq!(
todo_note(false, None),
"Kept only while TasksPending runs: quitting it forgets every todo."
"Kept until 40 minutes in Done, and only while TasksPending runs."
);
assert_eq!(
todo_note(true, Some("disk full")),
Expand Down
Loading
Loading