Repository navigation
feat(web,api): cross-project waiting-tasks widget on the home dashboard - #812
Conversation
Adds a configurable "Waiting tasks" pane to the home dashboard (issue Paca-AI#811): open (non-done) tasks across every project the viewer can access, ordered by updated_at ascending — the tasks that have been sitting the longest without activity. - API: GET /users/me/waiting-tasks (page_size 1-100, include=assignees,reporter), permission-filtered by ListAccessible projects plus per-project IAM list scoping, mirroring /users/me/tasks. Single page by design: the widget shows at most page_size items and a has_more flag; no keyset cursor in v1. - Web: WaitingTasksList reuses the project list view's ListGroup/TaskRow and groups by project. List size (10/25/50) and visible columns (type, status, importance, waiting) are selectable in the widget and persisted to localStorage. New "waiting" TaskRow column shows time-ago of updated_at. - i18n keys added to all locales (English copy as the initial translation). - Tests: handler tests (access scoping, has_more cap, empty, 401), web widget tests (error/empty/grouping/columns), route gate coverage updated. Closes Paca-AI#811
There was a problem hiding this comment.
Important
ListWaitingTasks never populates AssigneeIDs, so include=assignees returns an empty list even though the endpoint advertises it (and the web client sends include=assignees,reporter). Add r.attachAssigneeIDs(ctx, tasks) before returning, matching ListAssignedTasks/ListTasks, and cover it with a handler test.
The rest of the PR is in good shape: the permission model mirrors GET /users/me/tasks, the widget reuses ListGroup/TaskRow, and the handler/web tests cover the main states. A few non-blocking notes:
- N+1 IAM lookups:
ListScopeissues its ownListGrantsquery per call, so the per-project loop is N+1 on the grants table for every dashboard load. The authorizer's batchedListScopes(used byproject_handler.go) would make this one query.ListAssignedToMehas the same loop, but this endpoint covers every accessible project rather than just projects with assignments, so the fan-out is larger. - Missing DB-backed test: the handler tests use a fake service, so the new SQL's ordering, done exclusion, and per-project scope filtering aren't exercised. A parallel to
TestScopedAssignedTasksSpanProjectsWithOwnScopesiniam_scope_pg_test.gowould cover it. - No index on
updated_at: the query orders bytasks.updated_atacross the user's projects.taskshas noupdated_atindex, so this is a sort over all matching open tasks. A composite(project_id, updated_at)or partial(updated_at)index may be worth adding as the table grows. - Translations: the 8 non-English locales get English copy for the new keys. The locale parity test only checks keys, so it passes, but those users will see English; translating at least the column header or landing translations in a follow-up would help.
I didn't run the suites; the review is based on the diff and surrounding code.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
- ListWaitingTasks now attaches task assignees like ListTasks/ListAssignedTasks, so include=assignees returns real people (was always empty). - Batched IAM scoping: ListScoper gains ListScopes and the two /users/me list handlers resolve one scope per project in a single authorizer query instead of an N+1 per dashboard load. - DB-backed test for ListWaitingTasks: stalest-first ordering, done exclusion, per-project scope filtering, has_more and assignee attachment (mutant-checked). - readStoredPageSize guards localStorage with try/catch like readStoredFields. Closes the actionable feedback on PR Paca-AI#812 (pullfrog review 6004693547).
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — the fix commit closes the assignee gap and replaces the per-project ListScope fan-out with the authorizer's batched ListScopes, backed by a real Postgres test.
Reviewed changes — reviewed the delta since the prior pullfrog review (bad30ca):
- Assignee fix —
ListWaitingTasksnow callsattachAssigneeIDs, soinclude=assigneesreturns real people instead of an empty list. - Batched scoping —
ListScopergainedListScopes, andprojectScopesContextresolves one scope per project from a single grants fetch; both/users/me/tasksand/users/me/waiting-tasksuse it, removing the N+1. - Storage guard —
readStoredPageSizenow mirrorsreadStoredFieldswith a try/catch fallback. - DB-backed test —
TestScopedWaitingTasksSpanProjectsOrderAndAssigneescovers stalest-first ordering, done exclusion, per-project scope filtering, deny-all,has_more, and assignee attachment. I ran it against a local Postgres 18 instance and it passes.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
golangci-lint flagged a misaligned trailing comment added in bad30ca, and the web CI flags the widget test file as unformatted. No behaviour change: gofmt -w + biome format. go test ./... and the web suite pass locally.
|
The two CI failures on
Both verified locally (golangci-lint 0 issues, |
|
All actionable feedback from the review (pullfrog review 6004693547, three inline threads + the review body) is addressed in
Verification: widget vitest suite, CI blocker: the Left as explicit decisions (not implemented): the |
pikann
left a comment
There was a problem hiding this comment.
LGTM! Thank you for the contribution! 🚀

Closes #811.
What
A configurable "Waiting tasks" pane on the home dashboard: open (non-done) tasks across every project the viewer can access, ordered by
updated_atascending — the tasks that have been sitting the longest without any activity. This gives the dashboard its first at-a-glance cross-project "what is stuck" surface, complementing the existing "My Tasks" widget and the per-project views.Backend (
services/api)GET /users/me/waiting-tasks(page_size 1–100 via the existingparsePageSize,include=assignees,reportervia the existingparseTaskInclude).GET /users/me/tasks: projects come fromListAccessible, then each project's IAM list scope is applied inside the query viaprojectScopesSQL— a caller sees only tasks they may read.page_sizerows and returns ahas_moreflag. No keyset cursor in v1 — the widget is a top-N view; adding a cursor sort forupdated_atwould need newTaskCursorplumbing, which I'd rather gate on maintainer feedback.updated_at. Task comments live in a separate table and don't bumpupdated_at, so a task commented on yesterday but not otherwise modified still ranks as waiting — for a staleness widget that seemed like the right default, but I'm happy to change the signal (e.g. join latest task_activity) if maintainers prefer.Web (
apps/web)WaitingTasksListmirrors the "My Tasks" widget's structure and reuses the project list view'sListGroup/TaskRow— so it looks and behaves like a filtered slice of that view.localStorage(SSR-safe: applied after mount):"waiting"field forTaskRow/getRowColConfigrenderstimeAgo(task.updated_at)— available to any list view, not just this widget.Tests
services/api: handler tests for the new route — access scoping (no leak from inaccessible projects),has_morewhen capped, empty-accessible-projects, unauthenticated 401 — plus the existing route-gate coverage tests (new route added to the self-service group).apps/web: widget tests — error state, empty state, grouping + navigation +has_morenote, default column pass-through + persisted list-size change.go test ./...and the full web suite (bunx --bun vitest run, 1801 tests) pass locally;tsc -b,biome checkand the production build are clean. The Playwright e2e suite wasn't extended in this PR (needs a running seeded stack) — happy to add a spec if maintainers want one.Out of scope (from the issue discussion)