Skip to content

fix(dashboard): sort datasets by creation time (newest first)#6320

Merged
aglinxinyuan merged 6 commits into
apache:mainfrom
tanishqgandhi1908:fix/dataset-sort-newest-first
Jul 10, 2026
Merged

fix(dashboard): sort datasets by creation time (newest first)#6320
aglinxinyuan merged 6 commits into
apache:mainfrom
tanishqgandhi1908:fix/dataset-sort-newest-first

Conversation

@tanishqgandhi1908

@tanishqgandhi1908 tanishqgandhi1908 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

The Datasets listing did not show newly created datasets first — they appeared in an effectively undefined order.

Root cause: the datasets listing defaulted to EditTimeDesc, but datasets have no "last modified" timestamp. DatasetSearchQueryBuilder never maps
lastModifiedTime, so it falls back to NULL for every dataset in
UnifiedResourceSchema. The resulting ORDER BY resourceLastModifiedTime DESC NULLS LAST ties on NULL for all rows, so the database returns datasets in an arbitrary order and creation time has no effect. The "Your Work" datasets page
also had no sort control at all, so there was no way to notice or work around it. The Hub's dataset view shared the same latent bug.

This PR:

  1. Default the datasets listing to CreateTimeDesc (newest first) on both the "Your Work" datasets page and the Hub dataset view — datasets do have a populated creation_time.
  2. Add the shared sort button to the "Your Work" datasets page, which previously had none, laid out consistently with the Workflows page (Create Dataset → [ Sort · List · Card ] → Filters).
  3. Make SortButtonComponent reusable by adding showEditTime and showExecutionTime inputs (both default true). Datasets have neither an edit nor an execution time, so those two options are hidden for datasets to prevent them from re-introducing the NULL-ordering behavior. Workflows, Search, and the Hub's workflow view are unchanged.

No backend or schema changes.

Any related issues, documentation, discussions?

Closes #6215

How was this PR tested?

  • Updated/added frontend unit tests:
    • SortButtonComponent — new tests covering the showEditTime / showExecutionTime inputs and their defaults.
    • UserDatasetComponent — asserts the default sort is CreateTimeDesc.
    • All affected specs pass (sort-button 8/8, user-dataset 18/18).
  • Full production build (ng build) passes with no template/type errors.
  • Manually verified on the datasets page and also Confirmed the same on the Hub dataset view, and that Workflows / Search still show all sort options.

Screenshot shows the datasets page in Your Work section
Screenshot 2026-07-10 at 2 01 08 PM

Screenshot shows the datasets page in Hub's section
Screenshot 2026-07-10 at 1 59 28 PM

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 4.8)

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @xuang7, @roshiiiz
    You can notify them by mentioning @xuang7, @roshiiiz in a comment.

Align @if block indentation with the repo's prettier-eslint config to
satisfy the frontend format:ci check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 31.57895% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.01%. Comparing base (3e08ebb) to head (1ae5bb7).

Files with missing lines Patch % Lines
...nent/user/user-dataset/user-dataset.component.html 0.00% 13 Missing ⚠️

❌ Your patch status has failed because the patch coverage (31.57%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6320      +/-   ##
============================================
- Coverage     61.03%   61.01%   -0.03%     
  Complexity     3378     3378              
============================================
  Files          1140     1140              
  Lines         44923    44932       +9     
  Branches       4942     4944       +2     
============================================
- Hits          27419    27415       -4     
- Misses        15992    16003      +11     
- Partials       1512     1514       +2     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 3e08ebb
agent-service 44.59% <ø> (ø) Carriedforward from 3e08ebb
amber 66.44% <ø> (ø) Carriedforward from 3e08ebb
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 3e08ebb
config-service 52.30% <ø> (ø) Carriedforward from 3e08ebb
file-service 63.97% <ø> (ø) Carriedforward from 3e08ebb
frontend 53.28% <31.57%> (-0.04%) ⬇️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 3e08ebb
pyamber 91.18% <ø> (ø) Carriedforward from 3e08ebb
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 3e08ebb

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI 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.

Pull request overview

This PR fixes dataset listings being returned in an effectively undefined order by switching the default dataset sort to creation-time-desc (newest first) and preventing users from selecting sort options that would produce NULL-based ordering for datasets. It also makes the existing sort button reusable across resource types by allowing edit-time and execution-time options to be hidden.

Changes:

  • Default dataset views (Your Work + Hub dataset view) to SortMethod.CreateTimeDesc.
  • Add the shared sort button to the Your Work datasets page and align the utility controls layout with the workflows page.
  • Make SortButtonComponent configurable via showEditTime / showExecutionTime inputs and hide invalid options for datasets.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/app/hub/component/hub-search-result/hub-search-result.component.ts Defaults Hub dataset view sorting to CreateTimeDesc when browsing datasets.
frontend/src/app/hub/component/hub-search-result/hub-search-result.component.html Hides edit/execution sort options for dataset search results via SortButtonComponent inputs.
frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.ts Defaults Your Work datasets sort to CreateTimeDesc and wires in SortButtonComponent import.
frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.html Adds the sort button to the datasets page UI and groups it with view-mode controls.
frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.spec.ts Adds/updates unit assertion for default dataset sort being CreateTimeDesc.
frontend/src/app/dashboard/component/user/sort-button/sort-button.component.ts Adds showEditTime / showExecutionTime inputs to make sort options reusable per resource type.
frontend/src/app/dashboard/component/user/sort-button/sort-button.component.html Conditionally renders edit/execution sort menu items based on the new inputs.
frontend/src/app/dashboard/component/user/sort-button/sort-button.component.spec.ts Adds tests for the new inputs (needs stronger DOM-level assertions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aglinxinyuan aglinxinyuan 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!

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
@aglinxinyuan aglinxinyuan enabled auto-merge July 10, 2026 22:08
auto-merge was automatically disabled July 10, 2026 22:36

Head branch was pushed to by a user without write access

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Merged via the queue into apache:main with commit cc016ad Jul 10, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New datasets don't appear newest-first on the Datasets page

4 participants