Skip to content

Fixes #36393: Sort the task list newest or oldest first, and merge a user's tasks in that order - #36439

Merged
harsh-vador merged 3 commits into
mainfrom
fix/user-tasks-newest-first
Oct 28, 2026
Merged

harsh-vador merged 3 commits into
mainfrom
fix/user-tasks-newest-first

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #36393

Describe your changes:

#36395 made the task list endpoints page by (createdAt, id), newest first, with a sortOrder=asc|desc param. This PR does two things on top of it.

1. A user's Tasks tab merges in the server's order. The backend ANDs its filters, so useUserTasks builds "assigned to or created by the user" from two list calls and merges them. The merge comparator still assumed (name, id) ascending. Against the new server order it:

  • sorted each page oldest first again;
  • held back almost every task, so "Load more" showed a task or two at a time and the newest tasks came last;
  • could show a task the user both created and is assigned to twice, on different pages.

The comparator now orders by createdAt, then id, the same keyset and tie-break the server uses, in whichever direction was asked for.

2. A sort menu on the task list. An icon button after the Type filter opens Sort by → Newest first / Oldest first. Its tooltip names the current order ("Sort: Newest first").

  • The choice is sent as sortOrder, so the order holds across cursor pages. It is also part of the list's cache key.
  • ActivityToolbarMenu gains an iconOnly trigger. The trigger text becomes its tooltip and accessible name.
  • New keys label.newest-first / label.oldest-first, translated in every locale.

With Group: Type the groups keep their urgency order and the sort applies within each group. With Group: None the list is fully in date order.

Recently updated, priority and assignee sorts are left out. They need server-side keysets, and product agreed to add them when customers ask.

The sort scope and how it combines with grouping are recorded in ADR:2026-10-28-inbox-task-list-sorts-only-by-creation-time.

Type of change:

  • Bug fix
  • New feature

Tests:

  • useUserTasks.test.ts: the merge tests use newest-first server pages. New tests cover two tasks created in the same millisecond (ordered by id) and an oldest-first merge that holds back a task the other source's next page may precede.
  • InboxTaskListToolbar, ActivityToolbarMenu and TasksTab tests cover the sort trigger's name, the choice reaching the server as sortOrder, and its cache key.
  • All 43 InboxPage suites pass (720 tests). ESLint and Prettier are clean, tsc reports nothing in the changed files, and yarn ui-checkstyle:changed reports 0 errors.
  • Checked locally against a server with Fixes #36393: List tasks newest first by creation time #36395: the tooltip shows on hover and focus, and Oldest first requests sortOrder=asc and reorders the Inbox.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.

🤖 Generated with Claude Code

@harsh-vador
harsh-vador requested a review from a team as a code owner October 28, 2026 10:48
@harsh-vador
harsh-vador requested a review from sweta1308 October 28, 2026 10:48
@github-actions github-actions Bot added the UI UI specific issues label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 80%
79.96% (131666/164656) 66.44% (46438/69885) 69.51% (26393/37966)

@harsh-vador harsh-vador self-assigned this Oct 28, 2026
@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 28, 2026
@harsh-vador
harsh-vador removed this pull request from the merge queue due to a manual request Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-28T12:02:58Z)

The entry left the queue before it was built, so no checks ran against it.

The task list endpoints now page by (createdAt, id), newest first (#36395). The user Tasks tab merges its assigned and created lists with a comparator that still assumed (name, id) ascending, so it showed the oldest tasks first and held back most of each page.
Adds a Sort by menu (Newest first / Oldest first) beside the Inbox task
filters. The choice is sent as the list endpoints' sortOrder, so the order
holds across cursor pages, and the profile Tasks tab merges its assigned
and created sources in the same order.
@harsh-vador
harsh-vador force-pushed the fix/user-tasks-newest-first branch from 95602b4 to a1250dd Compare October 28, 2026 12:53
@harsh-vador harsh-vador changed the title Fixes #36393: Merge a user's tasks newest first, matching the task list order Fixes #36393: Sort the task list newest or oldest first, and merge a user's tasks in that order Oct 28, 2026
@harsh-vador harsh-vador added the To release Will cherry-pick this PR into the release branch label Oct 28, 2026
@gitar-bot

gitar-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Changing Inbox task sorting and pagination merges could misorder or omit user tasks if client comparison diverges from server ordering.

Adds a Newest/Oldest first sort menu to the Inbox task list and fixes the user Tasks tab merge to follow the server's createdAt/id order, so "Load more" and cross-source ordering stay correct. The sort scope is now recorded in the decision record docs/decisions/2026-10-28-inbox-task-list-sorts-only-by-creation-time.md, addressing the missing-decision finding. No open issues found.

✅ 1 closed
✅ Quality: Task list sort scope is decided in the PR body but never recorded

📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/InboxTaskListToolbar.tsx:96-102 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/components/InboxTaskListToolbar.tsx:187-199 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/tabs/TasksTab.tsx:574 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/InboxPage/tabs/TasksTab.tsx:705
The description sets a product rule that appears nowhere in the tree: "Recently updated, priority and assignee sorts are left out. They need server-side keysets, and product agreed to add them when customers ask." It also sets a behavior rule: "With Group: Type the groups keep their urgency order and the sort applies within each group." docs/decisions/2026-10-28-task-lists-page-newest-first-by-creation-time.md covers the server's (createdAt, id) keyset and sortOrder=asc|desc, and this PR follows it. That record says nothing about which sort options the Inbox task list offers, or how the sort combines with type grouping. The repo squash-merges, so this reasoning will be lost. Without it, a later PR could add a client-side priority or recently-updated sort that breaks across cursor pages.

The record would assert: "The Inbox task list offers only creation-time order (newest or oldest first), sent to the server as sortOrder and kept in the list's cache key. Sorts on other fields wait for a server-side keyset. Under Group: Type, groups keep their urgency order and the chosen order applies within each group."

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador
harsh-vador enabled auto-merge October 28, 2026 13:00
@sonarqubecloud

Copy link
Copy Markdown

@harsh-vador
harsh-vador added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit bb41b64 Oct 28, 2026
76 checks passed
@harsh-vador
harsh-vador deleted the fix/user-tasks-newest-first branch October 28, 2026 16:04
harsh-vador added a commit that referenced this pull request Oct 29, 2026
…user's tasks in that order (#36439) (#36512)

* fix(ui): merge a user's tasks newest first, matching the task list order

The task list endpoints now page by (createdAt, id), newest first (#36395). The user Tasks tab merges its assigned and created lists with a comparator that still assumed (name, id) ascending, so it showed the oldest tasks first and held back most of each page.

* feat(ui): sort the task list newest or oldest first

Adds a Sort by menu (Newest first / Oldest first) beside the Inbox task
filters. The choice is sent as the list endpoints' sortOrder, so the order
holds across cursor pages, and the profile Tasks tab merges its assigned
and created sources in the same order.

* docs(decisions): record that the Inbox task list sorts only by creation time

(cherry picked from commit bb41b64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inbox Triage lists tasks oldest first: task list API pages by task name

2 participants