Filter the items of a state command by tags and due range #331

Merged
kfickel merged 3 commits from 328_filter-tasks-by-tags-and-due into main 2026-10-25 11:43:42 +01:00
Collaborator

Closes #328.

What changes

Core

  • Due { Now, Days(n), Any } says how far ahead items are listed. Days(n) reaches the end of the day today + n in the project's timezone (through start_of_day, so a clock change is handled). It parses from now / <N>d / any.
  • Filter::any_of: OR alternatives, alias-aware. Filter::shows(item, due, now, tz) replaces the show_future flag.
  • api::state_board takes the OR values and a Due. state_items and partition_values take a Due.
  • Validation now also reserves due as a flag name, so a partitioned_by dimension cannot be called due.

CLI / TUI

  • streamd <key> --due <now|Nd|any>. --show-future stays as a short form of --due any and conflicts with --due. A wrong value is a usage error.
  • In streamd <key> -i, f cycles now → 7 days → any → now. The tab line says · due within 7 days or · with future items.

Bindings

  • New Due enum. stateItems, stateBoard (with any-of placements) and partitionValues take it.

App

  • One chip row: All and the top five values across all partition dimensions. A chosen value outside the top five also gets a chip, and a due range other than the default gets a scope chip that opens the sheet.
  • A filter button next to search, with a dot while the filter is not the default.
  • A filter sheet (TaskFilterSheet) with:
    • the due range (Until today / Next 7 days / Any date),
    • a searchable list of every value, matched by value or dimension, with the match highlighted,
    • TOP 5 labels and live counts from StateLists.preview, which reads no file,
    • Reset, and "Show N tasks".
    • Dismissing the sheet drops the draft.
  • Future items show their date in the primary colour plus today / tomorrow / in N days.
  • The filter survives configuration changes and process death (TaskFilterSaver).

Tests

  • Core:
    • Days(7) at its limits across the Berlin DST change, and parsing.
    • any_of shows the union, and an alias stands for its tag.
    • The board and the counts within a week.
  • CLI: --due parsing, the conflict with --show-future, and the f cycle in model, view and front-end.
  • FFI: a Rust test that Days(7) reaches a future item; StoreTest.kt updated.
  • App:
    • TaskFilterTest (top five, default, chip row, tap, search rows, keeping, due hint, saver).
    • StreamSessionTest for OR + due + preview.
    • 5 new screenshot scenes; the existing state-list references were re-recorded for the new filter button.
  • nix flake check and nix build .#streamd-app pass.

Notes

  • The strings say "tasks", as the plan and mock-up do, even though a state command may hold other things.
  • rememberModalBottomSheetState is deprecated in this Material version; it is used the same way as ActivityRange.kt already does.
Closes #328. ## What changes **Core** - `Due { Now, Days(n), Any }` says how far ahead items are listed. `Days(n)` reaches the end of the day *today + n* in the project's timezone (through `start_of_day`, so a clock change is handled). It parses from `now` / `<N>d` / `any`. - `Filter::any_of`: OR alternatives, alias-aware. `Filter::shows(item, due, now, tz)` replaces the `show_future` flag. - `api::state_board` takes the OR values and a `Due`. `state_items` and `partition_values` take a `Due`. - Validation now also reserves `due` as a flag name, so a `partitioned_by` dimension cannot be called `due`. **CLI / TUI** - `streamd <key> --due <now|Nd|any>`. `--show-future` stays as a short form of `--due any` and conflicts with `--due`. A wrong value is a usage error. - In `streamd <key> -i`, `f` cycles now → 7 days → any → now. The tab line says `· due within 7 days` or `· with future items`. **Bindings** - New `Due` enum. `stateItems`, `stateBoard` (with any-of placements) and `partitionValues` take it. **App** - One chip row: **All** and the top five values across all partition dimensions. A chosen value outside the top five also gets a chip, and a due range other than the default gets a scope chip that opens the sheet. - A filter button next to search, with a dot while the filter is not the default. - A filter sheet (`TaskFilterSheet`) with: - the due range (Until today / Next 7 days / Any date), - a searchable list of every value, matched by value or dimension, with the match highlighted, - TOP 5 labels and live counts from `StateLists.preview`, which reads no file, - Reset, and "Show N tasks". - Dismissing the sheet drops the draft. - Future items show their date in the primary colour plus `today` / `tomorrow` / `in N days`. - The filter survives configuration changes and process death (`TaskFilterSaver`). ## Tests - Core: - `Days(7)` at its limits across the Berlin DST change, and parsing. - `any_of` shows the union, and an alias stands for its tag. - The board and the counts within a week. - CLI: `--due` parsing, the conflict with `--show-future`, and the `f` cycle in model, view and front-end. - FFI: a Rust test that `Days(7)` reaches a future item; `StoreTest.kt` updated. - App: - `TaskFilterTest` (top five, default, chip row, tap, search rows, keeping, due hint, saver). - `StreamSessionTest` for OR + due + preview. - 5 new screenshot scenes; the existing state-list references were re-recorded for the new filter button. - `nix flake check` and `nix build .#streamd-app` pass. ## Notes - The strings say "tasks", as the plan and mock-up do, even though a state command may hold other things. - `rememberModalBottomSheetState` is deprecated in this Material version; it is used the same way as `ActivityRange.kt` already does.
Core: Due (now, N days, any) and Filter::any_of; state_board takes OR values. CLI: --due, and f cycles now, 7 days, any in the view. Bindings: Due for stateItems, stateBoard and partitionValues.
One chip row with the top five values, a filter button marked when the filter is not the default, and a sheet with the due range and a searchable list of every value, counted live by the core. Future items show their date with how far ahead they are.
docs(state): describe the due range and the filter of the state screen
Some checks failed
Continuous Integration / Conventional Commits (push) Successful in 18s
Continuous Integration / Lint, Check & Test (push) Successful in 8m9s
Continuous Integration / Build Package (push) Has been cancelled
de3e158b42
kfickel force-pushed 328_filter-tasks-by-tags-and-due from de3e158b42
Some checks failed
Continuous Integration / Conventional Commits (push) Successful in 18s
Continuous Integration / Lint, Check & Test (push) Successful in 8m9s
Continuous Integration / Build Package (push) Has been cancelled
to 777c782327
All checks were successful
Continuous Integration / Conventional Commits (push) Successful in 16s
Continuous Integration / Build Package (push) Successful in 42s
Continuous Integration / Lint, Check & Test (push) Successful in 1m31s
2026-10-25 11:28:09 +01:00
Compare
kfickel scheduled this pull request to auto merge when all checks succeed 2026-10-25 11:28:16 +01:00
kfickel deleted branch 328_filter-tasks-by-tags-and-due 2026-10-25 11:43:42 +01:00
Sign in to join this conversation.
No reviewers
No labels
android
cli
epic
planned
tui
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
kfickel/streamd!331
No description provided.