tanishqgandhi1908 opened a new pull request, #6320:
URL: https://github.com/apache/texera/pull/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.
   
   <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";
 />
   
   <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)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to