[FLINK-38699][ui] Sort jobs by default#27464
Merged
zhuzhurk merged 1 commit intoapache:masterfrom Feb 4, 2026
Merged
Conversation
Collaborator
davidradl
reviewed
Jan 23, 2026
| this.isLoading = false; | ||
| this.listOfJob = data.filter(item => item.completed === this.completed); | ||
|
|
||
| // Apply default sorting based on completed status |
Contributor
There was a problem hiding this comment.
can the this.listOfJob have completed and uncompleted jobs in if so how does the following if handle this?
Contributor
Author
There was a problem hiding this comment.
this.listOfJob won't contain both completed and uncompleted jobs at the same time because we use separate JobListComponent instances for each state, marked by this.completed. And this.listOfJob is filtered to include only those JobsItem whose status matches this.completed.
davidradl
reviewed
Jan 23, 2026
| <tr> | ||
| <th [nzSortFn]="sortJobNameFn" nzWidth="40%">Job Name</th> | ||
| <th [nzSortFn]="sortStartTimeFn">Start Time</th> | ||
| <th [nzSortFn]="sortStartTimeFn" [nzSortOrder]="completed ? null : 'descend'"> |
Contributor
There was a problem hiding this comment.
this makes sense. A couple of thoughs :
- if we are going to default jobs to a sort order ,then does it maker sense to additionally ask the server for a sorted list of completed and uncompleted jobs? So it comes back in the expected default order.
- does this have a big performance impact for a large number of jobs - if there is one this would be a good test to add. I assume we do not paginate.
Contributor
Author
There was a problem hiding this comment.
Thanks @davidradl, these are really inspiring. I'd like to explain why I've opted to handle sorting on the frontend for now:
- Existing frontend capability: The UI already supports user-driven sorting (e.g., clicking column headers to toggle sort order). Adding a default sort order is a natural and lightweight extension of that logic. It also gives us the flexibility to apply different default sorting strategies for completed vs. running jobs without needing separate backend endpoints or complex query parameters.
- Performance considerations: Based on production observations, it’s quite rare for users to have more than a few hundred jobs at once. At that scale, client-side sorting is still performant and acceptable. If we do encounter scenarios with significantly larger job volumes that cause noticeable slowdowns, we can revisit the approach and consider optimizations (e.g., server-side sorting, pagination, or lazy loading). For now, I think we can keep things simple. What do you think?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This pull request updates the UI homepage to sort jobs by default: completed jobs are ordered by end time (newest first), and running jobs by start time (also newest first).
Brief change log
Verifying this change
This change can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (no)Documentation