Add task breadcrumbs#660
Conversation
WalkthroughThis PR adds a ChangesTask Breadcrumbs
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/core/src/indexing/queries-tasks.ts (1)
15-16: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider
readonly string[]for the new field.Other array-ish immutable fields in this codebase's conventions favor
readonly;breadcrumbsis derived, read-only data.As per coding guidelines, "Use readonly fields for immutable data."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/core/src/indexing/queries-tasks.ts` around lines 15 - 16, The new breadcrumbs field in the query task types should be modeled as immutable data, so update the relevant type definition around breadcrumbs to use readonly string[] instead of a mutable array. Keep the change localized to the task/query model declarations in queries-tasks.ts and align it with the existing conventions for read-only derived fields.Source: Coding guidelines
apps/desktop/src/mobile/task-row.tsx (1)
44-49: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider an explicit row placement for
TaskBreadcrumbs.
TaskBreadcrumbshere only setscol-start-2, relying on CSS grid auto-placement to land it in row 1 (since the button/div below it explicitly claim row 2). This works correctly per the grid auto-placement algorithm, but it's implicit — reordering elements or adding new explicitly-placed grid children later could silently shift it. Addingrow-start-1would make the intent explicit and guard against future breakage.♻️ Optional clarity improvement
{hasBreadcrumbs ? ( <TaskBreadcrumbs breadcrumbs={breadcrumbs} - className="col-start-2 mb-0 min-w-0 pr-4 pt-3" + className="col-start-2 row-start-1 mb-0 min-w-0 pr-4 pt-3" /> ) : null}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/mobile/task-row.tsx` around lines 44 - 49, TaskBreadcrumbs is relying on implicit grid auto-placement for its row position; update the TaskBreadcrumbs usage in task-row.tsx to explicitly claim the first row as well as the second column so its placement is stable. Keep the existing TaskBreadcrumbs props and className context, and add an explicit row-start placement to the same element so future grid children or reordering cannot shift it unexpectedly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/desktop/src/mobile/task-row.tsx`:
- Around line 44-49: TaskBreadcrumbs is relying on implicit grid auto-placement
for its row position; update the TaskBreadcrumbs usage in task-row.tsx to
explicitly claim the first row as well as the second column so its placement is
stable. Keep the existing TaskBreadcrumbs props and className context, and add
an explicit row-start placement to the same element so future grid children or
reordering cannot shift it unexpectedly.
In `@packages/core/src/indexing/queries-tasks.ts`:
- Around line 15-16: The new breadcrumbs field in the query task types should be
modeled as immutable data, so update the relevant type definition around
breadcrumbs to use readonly string[] instead of a mutable array. Keep the change
localized to the task/query model declarations in queries-tasks.ts and align it
with the existing conventions for read-only derived fields.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 489a8f6d-f0b0-4c9d-a875-57cf20febb75
📒 Files selected for processing (30)
apps/desktop/src-tauri/src/db/tests.rsapps/desktop/src-tauri/src/db/write.rsapps/desktop/src/components/tasks/task-breadcrumbs.tsxapps/desktop/src/components/tasks/task-row.tsxapps/desktop/src/components/tasks/tasks-screen.test.tsxapps/desktop/src/dev/dev-index-db.test.tsapps/desktop/src/dev/dev-index-db.tsapps/desktop/src/lib/tasks/recently-completed.test.tsapps/desktop/src/lib/tasks/task-breadcrumbs.test.tsapps/desktop/src/lib/tasks/task-breadcrumbs.tsapps/desktop/src/lib/tasks/task-cache.test.tsapps/desktop/src/lib/tasks/task-insert-target.tsapps/desktop/src/lib/tasks/task-navigation.test.tsapps/desktop/src/lib/tasks/task-visibility.test.tsapps/desktop/src/lib/tasks/task-visibility.tsapps/desktop/src/lib/tasks/use-task-keyboard.test.tsapps/desktop/src/mobile/screens/tasks.test.tsxapps/desktop/src/mobile/task-row.tsxapps/desktop/src/mobile/use-task-sheet-finalizer.test.tscrates/index-schema/migrations/0017_task_breadcrumbs.sqlcrates/index-schema/src/lib.rspackages/core/src/indexing/group-tasks.test.tspackages/core/src/indexing/indexed-note.test.tspackages/core/src/indexing/indexed-note.tspackages/core/src/indexing/queries-tasks.tspackages/core/src/indexing/queries.test.tspackages/core/src/markdown/extract.test.tspackages/core/src/markdown/extract.tspackages/core/src/markdown/model.tspackages/db/src/schema.gen.ts
Problem
Reflect V1's Tasks view showed the parent outline context above task rows, for example
StartupToolbox -> Reflections on a Movement, so tasks made sense even when aggregated away from their source note.reflect-openonly projected task text/raw/dates into SQLite, so the Tasks view lost that context and task search could not match parent outline labels.Before -> After
ParsedTask,IndexedTask, SQLitetasks, andOpenTaskcarrybreadcrumbs.task.text.Changes
parseNoteby walking parentListItemancestors for round Meowdown task rows, preserving rendered plain text for links/emphasis.tasks.breadcrumbswith migration0017_task_breadcrumbs.sql, bump schema/projection versions, regenerate Kysely schema, and serialize the breadcrumb array through the Rust and dev SQLite write paths.getOpenTasks/getCompletedTasksand include them in optimistic task rows.Tasks/Todobreadcrumbs, while keeping row controls aligned with the task text.Task -> ListItemassumption is explicit.Tests
OpenTaskshape, breadcrumb rendering, and breadcrumb search behavior.Verification
pnpm --filter @reflect/core test -- src/markdown/extract.test.ts src/indexing/indexed-note.test.ts src/indexing/group-tasks.test.ts(passed; package ran 90 files / 1193 tests)pnpm --filter @reflect/desktop test -- src/lib/tasks/task-breadcrumbs.test.ts src/components/tasks/tasks-screen.test.tsx src/dev/dev-index-db.test.ts src/mobile/screens/tasks.test.tsx(passed; package ran 206 files / 1788 tests)pnpm --filter @reflect/core test -- src/indexing/queries.test.ts src/indexing/indexed-note.test.ts src/markdown/extract.test.ts(passed; package ran 90 files / 1193 tests)pnpm --filter @reflect/desktop test -- src/lib/tasks/task-visibility.test.ts src/lib/tasks/task-breadcrumbs.test.ts(passed; package ran 206 files / 1789 tests)pnpm --filter @reflect/core test -- src/indexing/queries.test.ts(passed; package ran 90 files / 1194 tests)pnpm --filter @reflect/desktop test -- src/components/tasks/tasks-screen.test.tsx src/mobile/screens/tasks.test.tsx src/lib/tasks/task-breadcrumbs.test.ts src/lib/tasks/task-visibility.test.ts(passed; package ran 206 files / 1789 tests)pnpm --filter @reflect/core test -- src/markdown/extract.test.ts(passed; package ran 90 files / 1195 tests)pnpm --filter @reflect/desktop sidecar(passed)cargo test -p reflect-open db::tests(passed; 50 tests)pnpm check(passed; existingpackages/core/src/indexing/indexer.tsmax-lines warning still appears)git diff --check(passed)Risk / Rollout
This adds a rebuildable projection column only. Existing indexes get
[]from the schema migration and then receive real breadcrumbs after the projection-version bump triggers reindexing. Chat tables and non-rebuildable data are untouched.Note
Low Risk
Rebuildable projection column with a safe default and version-bump reindex; no auth or durable non-projection data changes.
Overview
Restores V1-style parent outline context on aggregated task rows by threading
breadcrumbsfrom markdown parse through the index into the Tasks view.Indexing:
parseNotewalks parentListItemancestors for round+ [ ]tasks and records plain-text breadcrumb labels.IndexedTask/OpenTaskgainbreadcrumbs; migration0017_task_breadcrumbs.sqladdstasks.breadcrumbs(JSON, default[]); schema and projection version bumps trigger reindexing for real values. Rust and dev SQLite writers serialize the array;getOpenTasksparses it with Zod.UI: Desktop and mobile rows render chevron-separated breadcrumbs above task text (strikethrough applies to text only).
visibleTaskBreadcrumbshides lone generic headings like “Tasks” / “Todo”. Task search also matches breadcrumb text.Reviewed by Cursor Bugbot for commit c1f43a2. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit