The GitHub Actions job "Required Checks" on texera.git/backport/6320-sort-datasets-by-creation-time-newest-fi-v1.2 has failed. Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).
Head commit for run: 89b441e9cf5044a9fa2a07bff107dd35d7fa8580 / Tanishq Gandhi <[email protected]> fix(dashboard): sort datasets by creation time (newest first) (#6320) ### 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 <img width="1220" height="721" alt="Screenshot 2026-07-10 at 2 01 08 PM" src="https://github.com/user-attachments/assets/e6a5c0ac-66a6-45a5-987c-00f4a0b34eb6" /> Screenshot shows the datasets page in Hub's section <img width="1436" height="624" alt="Screenshot 2026-07-10 at 1 59 28 PM" src="https://github.com/user-attachments/assets/97912400-e156-4396-b750-45a8097f5a66" /> ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.8) --------- (backported from commit cc016adb6d5854cd2beca21eb2bedcfe2e486a41) Signed-off-by: Xinyuan Lin <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Xinyuan Lin <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]> Report URL: https://github.com/apache/texera/actions/runs/30512253810 With regards, GitHub Actions via GitBox
