Add task context breadcrumbs#685
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (33)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Cherry-picked from the competing #686: task search now also matches the source note's title, and groupTaskContexts/visibleTaskBreadcrumbs move from a desktop-local module into @reflect/core's group-tasks so any surface can reuse them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Problem
The aggregate Tasks view strips tasks away from the outline that gives them meaning. A row such as
Finish listeningis ambiguous without its parent context, for exampleStartupToolbox → Reflections on a Movement.Reflect V1 solved this with one breadcrumb row above each consecutive run of tasks sharing the same parent outline. Reflect Open currently neither projects that context nor searches it. A prior implementation in #660 rendered the breadcrumb inside every desktop and mobile task row; this PR follows the actual V1 context-row behavior instead.
Before -> After
Parent → Childrow labels each consecutive task context.Tasks:would add noise.Task/Tasks/Todovariants are suppressed.Changes
parseNotenow walks ancestor MarkdownListItemnodes for each round+ [ ]task and records the first text block from every parent, root-to-leaf. It uses the existing plain-text renderer, so links/emphasis are stripped consistently, wrapped parent text stays intact, and parent tasks label nested subtasks.0017_task_breadcrumbs.sqladds a JSONtasks.breadcrumbscolumn. Parsed-note, projection, and schema versions advance so unchanged notes reindex. The Rust and browser-development SQLite writers serialize the array; task queries decode it through Zod.groupTaskContextscoalesces only consecutive rows with identical breadcrumb arrays after existing task ordering.TaskGroupSectionrenders one breadcrumb before each context and leavesTaskRowitself unchanged.select(keys)operation. Clicking a breadcrumb selects exactly the rows it labels, so existing bulk task actions work immediately.Tests
Parent → Childrendering, click-to-select, and generic breadcrumb hiding.Verification
pnpm --filter @reflect/core exec vitest run src/markdown/extract.test.ts src/indexing/indexed-note.test.ts src/indexing/queries.test.ts src/indexing/group-tasks.test.ts— 84 tests passed.pnpm --filter @reflect/desktop exec vitest run src/lib/tasks/task-breadcrumbs.test.ts src/lib/tasks/task-visibility.test.ts src/lib/selection/use-list-selection.test.ts src/components/tasks/tasks-screen.test.tsx src/dev/dev-index-db.test.ts— 86 tests passed.pnpm --filter @reflect/desktop exec vitest run src/lib/tasks/use-task-keyboard.test.ts— 20 tests passed.pnpm --filter @reflect/desktop sidecar— passed.cargo test -p reflect-open db::tests --quiet— passed.cargo fmt --all -- --check— passed.pnpm check— passed; the existingpackages/core/src/indexing/indexer.tsmax-lines warning remains.git diff --check— passed.Risk / Rollout
This is a local, rebuildable projection migration. Existing task rows initially receive
[], then the projection-version bump reindexes unchanged Markdown to populate real breadcrumbs. The migration reuses the same number and DDL as the briefly merged/reverted #660, so development databases that already applied that migration have the expected shape. Durablechat_*tables are untouched.The user-visible breadcrumb row is desktop-only, matching the V1 source feature and avoiding extra vertical density on mobile. Breadcrumb-aware search is shared by both surfaces.
Note
Medium Risk
Local rebuildable migration plus markdown extraction changes affect task projection and indexing; desktop selection UX changes are additive but touch shared list-selection used by multiple views.
Overview
Adds parent outline context to the aggregate Tasks experience: each round
+ [ ]task now carries abreadcrumbsarray derived from ancestor list items in the note, persisted in the index, and surfaced on desktop like V1.Indexing & storage:
parseNotewalks parentListItemnodes and records plain-text labels (including nested parent tasks and wrapped lines). Migration0017addstasks.breadcrumbs(JSON); projection version 15 and schema 17 trigger reindex backfill. Rust, dev SQLite, andgetOpenTasksread/write the field end-to-end.Desktop UI:
groupTaskContextssplits consecutive rows with identical breadcrumbs;TaskBreadcrumbsrenders oneParent → Childrow per context (generic loneTasks/Todoheadings hidden). Clicking a breadcrumb uses newselect(keys)on the shared list-selection hook to select that context for bulk actions.Search: Task filtering matches the needle against task text, note title, and breadcrumb labels (shared desktop/mobile visibility pipeline). Mobile layout is unchanged; only data and search behavior grow.
Reviewed by Cursor Bugbot for commit e3f7194. Bugbot is set up for automated code reviews on this repo. Configure here.