Skip to content

feat(web,api): cross-project waiting-tasks widget on the home dashboard - #812

Merged
pikann merged 3 commits into
Paca-AI:masterfrom
kayahk:feature/waiting-tasks-home-widget
Nov 21, 2026
Merged

pikann merged 3 commits into
Paca-AI:masterfrom
kayahk:feature/waiting-tasks-home-widget

Conversation

@kayahk

@kayahk kayahk commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

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_at ascending — 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)

  • New endpoint GET /users/me/waiting-tasks (page_size 1–100 via the existing parsePageSize, include=assignees,reporter via the existing parseTaskInclude).
  • Permission model mirrors GET /users/me/tasks: projects come from ListAccessible, then each project's IAM list scope is applied inside the query via projectScopesSQL — a caller sees only tasks they may read.
  • Single page by design: the server caps at page_size rows and returns a has_more flag. No keyset cursor in v1 — the widget is a top-N view; adding a cursor sort for updated_at would need new TaskCursor plumbing, which I'd rather gate on maintainer feedback.
  • "Waiting" is defined pragmatically as no recent activity on the task, i.e. updated_at. Task comments live in a separate table and don't bump updated_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)

  • WaitingTasksList mirrors the "My Tasks" widget's structure and reuses the project list view's ListGroup/TaskRow — so it looks and behaves like a filtered slice of that view.
  • Configurable, persisted to localStorage (SSR-safe: applied after mount):
    • list size: 10 / 25 / 50
    • visible columns: type, status, importance, waiting (default: status + waiting)
  • New optional "waiting" field for TaskRow/getRowColConfig renders timeAgo(task.updated_at) — available to any list view, not just this widget.
  • i18n keys added to all 9 locales (English copy as the initial translation, consistent with what the locale parity test enforces).

Tests

  • services/api: handler tests for the new route — access scoping (no leak from inaccessible projects), has_more when 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_more note, 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 check and 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)

  • AI-assisted classification into soft attributes (impact/value/complexity) — best filled by an agent into custom fields, not in the request path.
  • Cross-project workflow dependencies — that's [Feature] Cross-project workflow dependencies #320, this PR is read-only visibility.

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: ListScope issues its own ListGrants query per call, so the per-project loop is N+1 on the grants table for every dashboard load. The authorizer's batched ListScopes (used by project_handler.go) would make this one query. ListAssignedToMe has 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 TestScopedAssignedTasksSpanProjectsWithOwnScopes in iam_scope_pg_test.go would cover it.
  • No index on updated_at: the query orders by tasks.updated_at across the user's projects. tasks has no updated_at index, 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using 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).

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 — ListWaitingTasks now calls attachAssigneeIDs, so include=assignees returns real people instead of an empty list.
  • Batched scoping — ListScoper gained ListScopes, and projectScopesContext resolves one scope per project from a single grants fetch; both /users/me/tasks and /users/me/waiting-tasks use it, removing the N+1.
  • Storage guard — readStoredPageSize now mirrors readStoredFields with a try/catch fallback.
  • DB-backed test — TestScopedWaitingTasksSpanProjectsOrderAndAssignees covers 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.

Pullfrog  | View workflow run | Using 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.
@kayahk

kayahk commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

The two CI failures on bad30ca were formatting-only and are fixed in 4cee88b:

  • api-pr-ci Lint: golangci-lint flagged a misaligned gofmt comment in the new DB-backed test (iam_scope_pg_test.go:422) — gofmt -w, no other issues found (golangci-lint run now reports 0 issues).
  • web-pr-ci: biome flagged the widget test file as unformatted — reformatted with biome check --write.

Both verified locally (golangci-lint 0 issues, go test ./... green, biome clean, web suite green). Note the CI runs for 4cee88b show as action_required — first-time-contributor fork runs need a maintainer's approval to execute.

@kayahk

kayahk commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

All actionable feedback from the review (pullfrog review 6004693547, three inline threads + the review body) is addressed in bad30ca8f60fadf9dc1ffc6ccf30ac68975edab2:

  • ListWaitingTasks now populates assignees (r.attachAssigneeIDs), covered by a new DB-backed test in iam_scope_pg_test.go that also closes the review body's missing-DB-test gap (stalest-first ordering, done exclusion, per-project scope filtering, has_more, assignee attachment). Mutant-checked: reverting the fix fails the test.
  • IAM scoping for the two /users/me list handlers is now one batched ListScopes query instead of an N+1 per project.
  • readStoredPageSize guards localStorage with the same try/catch as readStoredFields.
  • Details and evidence on each inline thread.

Verification: widget vitest suite, tsc -b, biome check, and the full web suite (1801 tests) pass on the new head. API: the changed packages pass; the full go test ./... against a live Postgres (PG test harness) shows only failures that reproduce identically on the base commit 2427a12 without my change — TestSeedPlatformRoles_ReconcilesMigratedRoles (bootstrap), TestWriteDocumentAtPath_DocDeletedBeforeRowLockIsPathChanged + TestGitStore_ChangeRequestsAndTaskLinks (postgres), and six test/integration tests (IAM/roles/migration). These look pre-existing on this branch in a fresh-Postgres environment; flagging for whoever runs CI.

CI blocker: the pull_request workflow runs for both the old and new head are stuck in action_required — a maintainer needs to approve workflow runs for this fork before any check executes. Until then there is no CI signal on bad30ca.

Left as explicit decisions (not implemented): the updated_at / composite (project_id, updated_at) index suggestion (schema migration) and translating the 8 non-English locales (happy to land in a follow-up). No merge performed.

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution! 🚀

@pikann
pikann merged commit fea76b7 into Paca-AI:master Nov 21, 2026
7 checks passed
@kayahk
kayahk deleted the feature/waiting-tasks-home-widget branch November 30, 2026 11:54
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.

[Feature] Configurable cross-project task shortlist on the home dashboard

2 participants