feat(ui): show metadata for recently viewed tasks and task groups by nitishagar · Pull Request #8755 · taskcluster/taskcluster · GitHub
Skip to content

feat(ui): show metadata for recently viewed tasks and task groups#8755

Open
nitishagar wants to merge 2 commits into
taskcluster:mainfrom
nitishagar:feat/8711-recent-tasks-metadata
Open

feat(ui): show metadata for recently viewed tasks and task groups#8755
nitishagar wants to merge 2 commits into
taskcluster:mainfrom
nitishagar:feat/8711-recent-tasks-metadata

Conversation

@nitishagar

Copy link
Copy Markdown
Contributor

Summary

The /tasks and /tasks/groups pages previously listed the last 5 recently-viewed items as bare IDs with no context. This PR stores richer metadata at view time and displays up to 20 entries ordered by recency.

Before

  • 5 bare task/group IDs with no context about what they were

After

  • Up to 20 entries, ordered by when you last visited
  • Tasks: shows task name (falls back to ID), status label, task queue, age, and truncated source URL
  • Task groups: shows decision-task name, task queue, age, source URL, task count breakdown (completed/failed/running/pending), and a resolved/running indicator

Design decisions

  • Store-at-view-time snapshot: metadata is captured when the page is first loaded, not refreshed in the background. Keeps browser storage small and avoids replicating live task tracking (Treeherder territory).
  • 20-item limit: up from 5; a viewedAt secondary index on both Dexie tables makes orderBy('viewedAt').reverse().limit(20) efficient.
  • Legacy record graceful degradation: existing v1 records lack viewedAt and are excluded by the index query — they age out naturally as the user browses and new rich records fill in. Mentioned in tests.
  • Snapshot counts for task groups: status counts may be partial if not all pages were fetched when the group was viewed — acceptable for a history snapshot.

Possible follow-up (out of scope)

A comment on the issue suggested a "my recent tasks" filtered by owner. That would require storing task.metadata.owner and filtering; noted here for future work.

Changes

  • ui/src/utils/db.js: db.version(2) adds viewedAt secondary index
  • ui/src/views/Tasks/ViewTask/index.jsx: updateTaskIdHistory stores name, source, taskQueueId, created, deadline, state, viewedAt
  • ui/src/views/Tasks/TaskGroup/index.jsx: updateTaskGroupIdHistory stores decision-task metadata + statusCount + viewedAt
  • ui/src/views/Tasks/NoTask/index.jsx: queries by viewedAt, renders rich list
  • ui/src/views/Tasks/NoTaskGroup/index.jsx: queries by viewedAt, renders rich list with status counts
  • Tests added for both display components (jest.mock for IndexedDB, covers rich + legacy + empty states)

Fixes #8711

@nitishagar nitishagar requested a review from a team as a code owner June 12, 2026 15:32
@nitishagar nitishagar requested review from Eijebong, lotas and petemoore and removed request for a team June 12, 2026 15:32
@github-project-automation github-project-automation Bot moved this to Backlog / Inbox in TC intake board Jun 12, 2026
…s/groups

- renderSecondary returns null (not the ID) when no metadata is stored,
  avoiding duplicate ID display for legacy records
- renderStatusSummary labels a resolved group FAILED when failures exist,
  rather than always using COMPLETED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog / Inbox

Development

Successfully merging this pull request may close these issues.

Improve Tasks/Task Group UI pages

1 participant