Skip to content

Browser tree shows only open work that has edges - #199

Merged
MJohnson459 merged 1 commit into
mainfrom
tree-open-edges
Sep 29, 2026
Merged

MJohnson459 merged 1 commit into
mainfrom
tree-open-edges

Conversation

@MJohnson459

Copy link
Copy Markdown
Contributor

The task browser's blocker tree (t) now shows only open work that has edges. On a copy of the real store (678 tasks) it drops from 526 top-level rows to 29; the header reads 443 tasks with no edges hidden · 54 closed trees hidden.

What changed

  • voro_core::blocks_tree takes an is_open predicate and returns a Tree: the rows plus two counts. A top-level row must block nothing, be open, and have at least one blocker. A task that blocks nothing and has no blocker counts under "no edges". A closed task heading a tree counts under "closed trees", with its subtree hidden too. Closed blockers under an open task still show, dimmed like any closed row.
  • The browser header reads All tasks — by blockers — N tasks with no edges hidden · M closed trees hidden, with singular forms for 1.
  • Space on a ↑ #N reference row opens every fold above the full copy and selects that copy.
  • Cycles: Graph finds tasks on a cycle with Tarjan's algorithm, and TreeRow.cycle marks them. A cycle that no top-level row reaches now prints as a top-level row instead of vanishing, marked [cycle] in the browser and in voro tree. The store refuses cycles, so this only guards bad data.
  • fold_counts and tree_browser_rows look tasks up through a new App::all_index (id → index) instead of a linear find.
  • voro tree <id> (blocker_tree) is unchanged and prints any task's tree, whatever its state.
  • DESIGN.md §9 now states the rule for what the tree shows, the header counts, the [cycle] guard and the reference jump. It also corrects the [milestone] sentence: only a milestone's full row carries the marker, not a reference row.

The space entry in the help overlay still reads "toggle a tree fold". A longer label pushed another entry off the 80×24 key-map page, and every_key_map_entry_is_reachable_on_a_small_terminal failed.

Verification

  • cargo test --workspace, cargo clippy --workspace --all-targets -- -D warnings and cargo fmt --all all pass.
  • New core tests:
    • the acceptance fixture: one top-level row, (no_edges, closed_trees) == (3, 1)
    • a closed blocker nests under an open task
    • a two-task cycle with no dependent prints both tasks marked cycle
  • New TUI tests:
    • the same fixture through the app
    • space on a reference inside a closed fold opens the way and selects the full copy
    • the drawn header text, and the DIM modifier on a done blocker's row
    • voro tree on a done task prints #c done c / #d done d
  • Real-store count: a throwaway ignored test, removed before commit, ran against a copy of ~/.local/share/voro/voro.db. Top-level rows went from 526 to 29, with 443 no-edge tasks and 54 closed trees hidden. No open task with an edge is missing from the tree, and there are no cycles.

Known gap

An open task whose only dependents are closed, and which has no blocker, sits inside a hidden closed tree and is counted nowhere. No task on the real store is in this position today. It is filed as #679.

On the real store the tree listed 526 top-level rows against 678 in the
flat list: most were tasks with no blocks edge, or closed trees. The tree
now heads rows only with open tasks that have a blocker, counts the rest
in its header, and keeps closed blockers inside an open task's tree,
dimmed. Space on a reference row opens the folds down to its full copy.
Tasks on a cycle that no top-level row reaches now print, marked
[cycle], instead of vanishing. fold_counts looks tasks up by id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017CwJAmruPDTxGhHxrrBoiX
@MJohnson459
MJohnson459 merged commit fb9e1f4 into main Sep 29, 2026
7 checks passed
@MJohnson459
MJohnson459 deleted the tree-open-edges branch September 29, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant