Skip to content

feat: add "My Tasks" widget to home page#324

Merged
pikann merged 3 commits into
masterfrom
feature/add-my-tasks-widget-to-home-page
Jul 24, 2026
Merged

feat: add "My Tasks" widget to home page#324
pikann merged 3 commits into
masterfrom
feature/add-my-tasks-widget-to-home-page

Conversation

@pikann

@pikann pikann commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a "My Tasks" widget to the home page that shows open tasks assigned to the current user across every project they belong to.

Backend

  • New endpoint GET /users/me/tasks (task_handler.go ListAssignedToMe): resolves the caller's projects via ListAccessible, then their per-project project_members.id via ListMembers (task assignment is stored by member ID, not user ID), and queries assigned tasks across all of them.
  • New TaskRepository.ListAssignedTasks / TaskService.ListAssignedTasks: returns open (non-done-category) tasks assigned to any of a set of member IDs, ordered by importance (desc) then created_at (asc), keyset-paginated with the same opaque cursor format used by ListTasks.
  • page_size defaults to 10, capped at 100 (parsePageSize).
  • Route registered under /users/me/tasks, guarded by deps.Task != nil; handler responds with an empty list if no project service is wired via WithTaskAssignedProjectService.
  • Unit tests for the handler (member ID resolution across multiple projects, no-projects empty response, unauthenticated 401) and updated fakes/mocks in the sprint/task service and integration test suites to satisfy the extended TaskRepository/TaskService interfaces.

Frontend

  • New AssignedTasksList component (assigned-tasks-list.tsx): fetches assigned tasks via an infinite query, groups them by project, and renders each group with the existing ListGroup/task-row components so it looks like a filtered slice of the project task list rather than a bespoke summary. Handles loading (skeleton), empty ("you're all caught up"), and "load more" pagination states.
  • listAssignedTasks / assignedTasksQueryOptions added to interaction-api.ts, backed by useInfiniteQuery with no refetchInterval (home page isn't a live board).
  • Widget wired into the home page (home/index.tsx) between the stats and projects sections, only shown when the user has at least one project; its query is prefetched in the route loader alongside the existing project/stats queries.
  • Added home.myTasks.* translation strings (title, subtitle, empty state, load more/loading) to all 10 supported locales.

Testing

  • Go unit tests for the new handler, repository, and service methods, plus updated fakes across sprint, task, and integration test packages to keep interfaces satisfied.
  • Manual verification pending — no frontend tests added for AssignedTasksList itself.

- Implemented AssignedTasksList component to fetch and display tasks assigned to the current user across all projects.
- Added translations for "My Tasks" section in multiple languages.
- Updated interaction API to support fetching assigned tasks with pagination.
- Enhanced task repository and service layers to handle assigned tasks retrieval.
- Integrated the new widget into the home page layout, displaying a loading state and handling empty task scenarios.
- Added tests for the new functionality, ensuring proper member ID resolution and task retrieval.

@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 critical issues — one minor suggestion inline.

Reviewed changes — PR adds a cross-project "My Tasks" widget to the home page. A new ListAssignedToMe handler resolves the current user's per-project member IDs concurrently via errgroup, then queries open assigned tasks across all projects with importance-based keyset pagination. The frontend AssignedTasksList component groups results by project and renders them through the existing ListGroup/TaskRow infrastructure.

  • New GET /users/me/tasks endpointTaskHandler.ListAssignedToMe authenticates, resolves per-project member IDs in parallel, and delegates to the repository's ListAssignedTasks
  • Postgres ListAssignedTasks query — filters non-deleted, non-done tasks assigned to the resolved member IDs, sorted by importance descending then created_at ascending
  • AssignedTasksList component — fetches via useInfiniteQuery, groups by project_id, renders each project with the shared ListGroup component and the same visible field set as the project list view
  • i18n — "My Tasks" section header and empty state translated across 9 languages
  • Route loader — prefetches first page via ensureInfiniteQueryData

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

Comment thread apps/web/src/components/home/assigned-tasks-list.tsx

@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 in the incremental commits. One prior review thread remains open and is not addressed by these changes.

Reviewed changes — second commit adds test coverage and two defensive fixes. The frontend AssignedTasksList gets unit tests for grouping, navigation, and pagination; the endpoint gets e2e tests for cross-project aggregation and cursor pagination. The ListMembers fan-out is now capped at 20 concurrent lookups, and the service default limit is tightened from 20 to 10 to match the handler default.

  • Frontend unit tests for AssignedTasksList — covers empty state, task grouping by project with navigation wiring, and "Load more" pagination exhausted
  • g.SetLimit(20) on errgroup — caps concurrent per-project ListMembers lookups so a user in many projects can't fire unbounded goroutines
  • Service default limit 20→10 — aligns ListAssignedTasks's fallback with the handler's parsePageSize default
  • E2E tests for GET /users/me/tasks — verifies cross-project task aggregation (excludes done-status tasks and tasks assigned to others) and cursor pagination (no duplicates, no gaps)
  • E2E env wiring — passes WithTaskAssignedProjectService(projectService) so the new endpoint is exercised

Pullfrog  | Fix it ➔View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

@pikann pikann linked an issue Jul 24, 2026 that may be closed by this pull request

@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.

Reviewed changes — this incremental commit adds error handling to the AssignedTasksList widget, addressing the prior review's open thread.

  • Error state for failed fetchesisError from useInfiniteQuery now renders a destructive-styled banner with an AlertCircle icon and the home.myTasks.loadError string, preventing failed queries from silently showing the "all caught up" empty state
  • loadError i18n key — added to all 10 supported locale files with translated error messages
  • Error state test — verifies the error UI renders and the empty state / task groups do not when the fetch rejects

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

@pikann
pikann merged commit e84d4fd into master Jul 24, 2026
5 checks passed
@pikann
pikann deleted the feature/add-my-tasks-widget-to-home-page branch July 24, 2026 08:03
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] Global Inbox

1 participant