Skip to content

Add task context breadcrumbs#685

Merged
maccman merged 2 commits into
nextfrom
codex/task-context-breadcrumbs
Jul 10, 2026
Merged

Add task context breadcrumbs#685
maccman merged 2 commits into
nextfrom
codex/task-context-breadcrumbs

Conversation

@maccman

@maccman maccman commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

The aggregate Tasks view strips tasks away from the outline that gives them meaning. A row such as Finish listening is ambiguous without its parent context, for example StartupToolbox → 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

Before After
Aggregated rows show task text without their parent outline. One quiet Parent → Child row labels each consecutive task context.
Repeated tasks from the same context repeat no shared affordance. The shared breadcrumb selects all tasks in that context when clicked.
Task search only matches task text. Search also matches parent outline labels.
Generic parents such as Tasks: would add noise. Lone Task / Tasks / Todo variants are suppressed.
Mobile task rows have their existing compact layout. Mobile rendering stays unchanged; only the shared data/search path grows.

Changes

  1. Extract complete parent outline context. parseNote now walks ancestor Markdown ListItem nodes 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.
  2. Persist breadcrumbs as rebuildable projection data. Migration 0017_task_breadcrumbs.sql adds a JSON tasks.breadcrumbs column. 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.
  3. Restore V1 task contexts. groupTaskContexts coalesces only consecutive rows with identical breadcrumb arrays after existing task ordering. TaskGroupSection renders one breadcrumb before each context and leaves TaskRow itself unchanged.
  4. Support context selection. The shared list-selection hook gains a documented programmatic select(keys) operation. Clicking a breadcrumb selects exactly the rows it labels, so existing bulk task actions work immediately.
  5. Search outline context. The shared desktop/mobile task visibility pipeline matches the search needle against task text or any breadcrumb label.

Tests

  • Markdown extraction covers formatted ancestor labels, wrapped parent text, parent-task breadcrumbs, top-level tasks, and nested due-date isolation.
  • Projection, Rust database, browser SQLite, and query-boundary tests cover JSON storage, schema/projection versions, Zod decoding, and boolean normalization.
  • Context tests cover consecutive-only grouping, repeated non-consecutive contexts, generic-label suppression, and empty input.
  • Selection tests cover programmatic multi-selection in render order.
  • Tasks-screen tests cover one breadcrumb per context, Parent → Child rendering, click-to-select, and generic breadcrumb hiding.
  • Task visibility tests cover search by breadcrumb text.

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 existing packages/core/src/indexing/indexer.ts max-lines warning remains.
  • Vite browser verification — desktop and mobile harnesses loaded with content, no error overlay or captured console errors; the mobile Tasks tab opened against the migrated query shape.
  • 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. Durable chat_* 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 a breadcrumbs array derived from ancestor list items in the note, persisted in the index, and surfaced on desktop like V1.

Indexing & storage: parseNote walks parent ListItem nodes and records plain-text labels (including nested parent tasks and wrapped lines). Migration 0017 adds tasks.breadcrumbs (JSON); projection version 15 and schema 17 trigger reindex backfill. Rust, dev SQLite, and getOpenTasks read/write the field end-to-end.

Desktop UI: groupTaskContexts splits consecutive rows with identical breadcrumbs; TaskBreadcrumbs renders one Parent → Child row per context (generic lone Tasks/Todo headings hidden). Clicking a breadcrumb uses new select(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.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9d39f660-0b4b-4d8b-9452-06bcbc36a806

📥 Commits

Reviewing files that changed from the base of the PR and between 45714df and e3f7194.

📒 Files selected for processing (33)
  • apps/desktop/src-tauri/src/db/tests.rs
  • apps/desktop/src-tauri/src/db/write.rs
  • apps/desktop/src/components/tasks/task-breadcrumbs.tsx
  • apps/desktop/src/components/tasks/task-group-section.tsx
  • apps/desktop/src/components/tasks/tasks-screen.test.tsx
  • apps/desktop/src/dev/dev-index-db.test.ts
  • apps/desktop/src/dev/dev-index-db.ts
  • apps/desktop/src/lib/selection/use-list-selection.test.ts
  • apps/desktop/src/lib/selection/use-list-selection.ts
  • apps/desktop/src/lib/tasks/recently-completed.test.ts
  • apps/desktop/src/lib/tasks/task-cache.test.ts
  • apps/desktop/src/lib/tasks/task-insert-target.ts
  • apps/desktop/src/lib/tasks/task-navigation.test.ts
  • apps/desktop/src/lib/tasks/task-visibility.test.ts
  • apps/desktop/src/lib/tasks/task-visibility.ts
  • apps/desktop/src/lib/tasks/use-task-keyboard.test.ts
  • apps/desktop/src/lib/tasks/use-task-selection.ts
  • apps/desktop/src/mobile/screens/tasks.test.tsx
  • apps/desktop/src/mobile/use-task-sheet-finalizer.test.ts
  • crates/index-schema/migrations/0017_task_breadcrumbs.sql
  • crates/index-schema/src/lib.rs
  • packages/core/src/exports/sync-markdown-indexing.ts
  • packages/core/src/indexing/group-tasks.test.ts
  • packages/core/src/indexing/group-tasks.ts
  • packages/core/src/indexing/index.ts
  • packages/core/src/indexing/indexed-note.test.ts
  • packages/core/src/indexing/indexed-note.ts
  • packages/core/src/indexing/queries-tasks.ts
  • packages/core/src/indexing/queries.test.ts
  • packages/core/src/markdown/extract.test.ts
  • packages/core/src/markdown/extract.ts
  • packages/core/src/markdown/model.ts
  • packages/db/src/schema.gen.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/task-context-breadcrumbs

Comment @coderabbitai help to get the list of available commands.

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>
@maccman maccman merged commit f51e362 into next Jul 10, 2026
7 checks passed
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