Repository navigation
feat: redesign the home dashboard with trend sparklines - #829
Conversation
GET /projects/workspace-trend?days=N (7-90, default 30) returns the workspace counters of /projects/workspace-stats as daily series over the last N UTC days, for the home page stat-card sparklines. Nothing is snapshotted; each series is rebuilt from existing rows: - projects and team members from created_at / deleted_at (exact); - open tasks from each task's status timeline, rebuilt from the "status" entries of its task.updated activities. The stretch after the last recorded change uses the current status, so today's value equals the live open-task count. Older values are approximate: status changes made outside the task update endpoint are not logged, and a status renamed or deleted since counts as open. Projects and open tasks cover the same projects and per-project task scope as workspace-stats; the project listing and scope setup are extracted into helpers both handlers share. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Compact header with a live summary: tasks assigned to you, overdue and due this week. - Slimmer stat cards with a 30-day sparkline and a 7-day change badge (from the new workspace-trend endpoint), "N assigned to you" on Open Tasks and a "Set up" link when no AI agent exists. - Two-column layout: My Tasks and Waiting tasks on the left; a new "Due soon" card and a compact project list (replacing the card grid) on the right. - My Tasks gets status filter tabs with counts; statuses with the same name in different projects share a tab. The page size goes from 10 to 50 so the counts, the summary and "Due soon" cover a typical workload. - New strings in all nine locales; the unused hero badge and subtitle strings are removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Important
The new GET /projects/workspace-trend route is missing from the router's reviewed open-route allowlist, so three services/api router tests fail (TestEveryRouteIsGuarded, TestRouteCoverage_EveryNonOpenRouteDeclaresAGate, TestRouteCoverage_Behaviour). I reproduced all three on 60ed81c; the fix is a one-line allowlist entry, detailed inline on router.go.
Approach: sound — the trend is rebuilt from existing rows with no snapshot table or migration, and reconstructing open tasks from the task.updated status timeline is a reasonable, explicitly documented approximation. The project/team-member series are exact only for projects the caller can still see.
Reviewed changes
- Workspace trend endpoint: new
GET /projects/workspace-trend?days=N(7–90, default 30) returns daily project, open-task and team-member series with UTC dates; projects/users come from row timestamps, open tasks from thestatusentries oftask.updatedactivities. - Shared project/task scoping:
workspaceProjectIDsandworkspaceTaskScopeextracted soworkspace-statsand the trend use the same project set and per-project task scope. - Home dashboard: compact header with overdue/due-this-week summary, sparkline stat cards with 7-day deltas, two-column layout, new Due soon card, project rows in place of the card grid, and status filter tabs with counts on My Tasks.
- Supporting changes:
due-datesandsparklinehelpers with tests,ASSIGNED_TASKS_PAGE_SIZE10→50, new strings in all nine locales, authorization docs updated.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
| "overdue_many": "{{count}} просрочено", | ||
| "overdue_other": "{{count}} просрочено", | ||
| "dueThisWeek_one": "{{count}} — срок на этой неделе", | ||
| "dueThisWeek_other": "{{count}} — срок на этой неделе" |
There was a problem hiding this comment.
dueThisWeek only has _one/_other, but Russian selects _few for counts 2–4 and _many for 5+, and i18next does not fall back to _other within the same language — those counts fall through to en and render English. The neighbouring assigned, overdue, subAssigned and trendLabel keys all carry the full _few/_many set; add the two missing forms here.
| // ProjectCountTrend counts, at each day end, how many of projectIDs existed: | ||
| // created before it and not yet deleted. projectIDs is the caller's current | ||
| // set of accessible projects, so the last value equals the live project count. | ||
| func (r *WorkspaceTrendRepository) ProjectCountTrend(ctx context.Context, projectIDs []uuid.UUID, firstDayEnd, lastDayEnd time.Time) ([]int64, error) { |
There was a problem hiding this comment.
workspaceProjectIDs only ever returns live projects (List/ListAccessible filter deleted_at IS NULL), so this method never sees a project deleted inside the window and the series omits it rather than showing a drop; OpenTaskTrend inherits the same gap. The PG test's gone project hides this because production can never pass a deleted id.
Technical details
# Project/open-task history omits projects deleted in the window
## Affected sites
- `services/api/internal/transport/http/handler/project_handler.go:283` — `workspaceProjectIDs` fetches via `svc.List` / `ListAccessible`, both of which filter `deleted_at IS NULL`.
- `services/api/internal/repository/postgres/workspace_trend_repository.go:66` — `ProjectCountTrend` handles `deleted_at`, but is never given a deleted id.
- `services/api/internal/repository/postgres/workspace_trend_pg_test.go:97` — the test inserts `gone` with `deleted_at` and passes it directly, which production cannot do.
## Required outcome
- Either include projects (and their tasks) that existed during the window but were deleted, or stop describing the project series as exact and document the same approximation as the open-task series.Like workspace-stats, GET /projects/workspace-trend is open to any
authenticated caller and scopes its counts to the caller's projects and
task permissions inside the handler. Add it to the reviewed openRouteGroups
allow-list and cover it with the not-shadowed-by-{projectId} route test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the router open-route allowlist failure from the previous review is fixed.
Reviewed changes
Reviewed the single commit since the prior pullfrog review (60ed81c): a test-only change that admits the new endpoint to the reviewed allowlist and covers its routing.
- Workspace-trend route allowlisted:
GET /api/v1/projects/workspace-trendnow sits inopenRouteGroupsbesideworkspace-stats, and the coverage comment enumerates it with the other handler-scoped routes. - Route-shadowing test: added
TestProjectsRoute_WorkspaceTrend_NotShadowedByProjectIDRoute, the sibling guard proving the static path is not captured by the{projectId}route.
I ran the router package locally: TestEveryRouteIsGuarded, TestRouteCoverage_EveryNonOpenRouteDeclaresAGate and TestRouteCoverage_Behaviour all pass now, as do both NotShadowedByProjectIDRoute tests and TestProjectsRoute_GetByID_StillParsesProjectID.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
pikann
left a comment
There was a problem hiding this comment.
LGTM! Thank you for the contribution! 🚀

Summary
The home page now shows what needs attention instead of a large banner and big, sparse cards.
Web
API:
GET /projects/workspace-trend?days=N(7–90, default 30)workspace-statscounters as daily series over the last N UTC days. Each value is the count at the end of that day, so the last value equals the live count.created_at/deleted_at(exact).statusentries of itstask.updatedactivities. After the last recorded change, the task's current status is used, so today's value matchesworkspace-stats. Older values are approximate: status changes made outside the task update endpoint aren't logged, and a status renamed or deleted since then counts as open.iam.WithProjectScopes) asworkspace-stats. The project listing and scope setup are moved into helpers that both handlers share.docs/architecture/authorization.mdnow lists the new endpoint with the other cross-project task reads.Screenshots
These were taken against a dev stack. To show the filter tabs and the Due soon card, the browser replaced the
/users/me/tasksresponse with six sample tasks that use the project's real statuses. The sparklines and every other part of the page show real data. They rise in one step because all of that dev data was created on the same day.Dark

Light

My Tasks filtered to one status

Test plan
tsc -bclean, Biome clean for the changed filesGitSettings.test.tsxfailed once under full-suite load, then passed three times on its own; that file isn't touched here.go build,go vet,gofmtcleandaysvalue, and empty series when no source is wired; Postgres tests for the open-task timeline (status changes, reopening, deletion, a status name no longer in the project, case-insensitive names), per-project task scope, projects and usersgo test ./...withPACA_TEST_PG_DSN: passes apart from sixtest/integrationtests (TestIAMMigrationKeyMapping,TestPluginManifestActionsMigration,TestProjectRoleResourcesMigration,TestRolesAPI_EndToEnd,TestRolesAssignMigration,TestServiceAccountsAPI_EndToEnd). They fail the same way on an untouchedmaster.projects/management.spec.tsandiam/list-scoping.spec.tsread the home page. The text and roles they assert on are unchanged, but they should be run.🤖 Generated with Claude Code