Skip to content

fix(dashboard): order ListDashboards newest-first by default - #1298

Merged
andrzejfudro merged 2 commits into
mainfrom
grain/eu/task-4790
Oct 19, 2026
Merged

andrzejfudro merged 2 commits into
mainfrom
grain/eu/task-4790

Conversation

@andrzejfudro

Copy link
Copy Markdown
Collaborator

fix(dashboard): order ListDashboards newest-first by default

DashboardsListPage requests a single page of up to 100 dashboards without
pagination controls and filters them client-side. Because dashboardsTableView
omitted OrderByFieldsWithSortDirection, ListDashboards defaulted to ordering
by primary key (dashboard_id ASC). Once the shared nightly environment
accumulated more than 100 dashboards across runs, newly created dashboards
such as exp_overview sorted after older exp<lower_xid>_* entries with
smaller leading digits (e.g. exp_1*..exp_77*) and were truncated from the
100-item response, causing the Metrics Dashboard UI E2E test to fail with a
missing row in /dashboards.

Set OrderByFieldsWithSortDirection on dashboardsTableView to order by
created DESC with dashboard_id ASC as a deterministic tie-breaker so
recently created dashboards are returned first.

Refs #1296


Automated change for grain task 4790.

DashboardsListPage requests a single page of up to 100 dashboards without
pagination controls and filters them client-side. Because dashboardsTableView
omitted OrderByFieldsWithSortDirection, ListDashboards defaulted to ordering
by primary key (dashboard_id ASC). Once the shared nightly environment
accumulated more than 100 dashboards across runs, newly created dashboards
such as exp_<xid>_overview sorted after older exp_<lower_xid>_* entries with
smaller leading digits (e.g. exp_1*..exp_77*) and were truncated from the
100-item response, causing the Metrics Dashboard UI E2E test to fail with a
missing row in /dashboards.

Set OrderByFieldsWithSortDirection on dashboardsTableView to order by
created DESC with dashboard_id ASC as a deterministic tie-breaker so
recently created dashboards are returned first.

Refs #1296
@github-actions
github-actions Bot requested a review from VLukiantsev October 19, 2026 06:21

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces default ordering by creation time (descending) and dashboard ID (ascending) to the dashboard schema, and updates the test suite to verify this ordering. Feedback highlights a potential performance issue where sorting by the non-indexed CreatedTableField could trigger expensive full table scans and top-N sorts in Spanner, recommending the use of a secondary index instead.

VLukiantsev
VLukiantsev previously approved these changes Oct 19, 2026
@andrzejfudro

Copy link
Copy Markdown
Collaborator Author

grain has stopped watching #1298.

Task 4790 is closed, and grain only ever merges a pull request belonging to a task that completed -- so it will not merge this one, will not update it, and will not look at it again.

Nothing has been done to the branch: the commits are real work, and grain closes a pull request only when whoever closes its task asks for that in the same breath. #1298 is still open for a human to merge or close by hand, and reopening task 4790 is what puts it back under grain's watch.

1 similar comment
@andrzejfudro

Copy link
Copy Markdown
Collaborator Author

grain has stopped watching #1298.

Task 4790 is closed, and grain only ever merges a pull request belonging to a task that completed -- so it will not merge this one, will not update it, and will not look at it again.

Nothing has been done to the branch: the commits are real work, and grain closes a pull request only when whoever closes its task asks for that in the same breath. #1298 is still open for a human to merge or close by hand, and reopening task 4790 is what puts it back under grain's watch.

…ering

Document the default ordering override on dashboardsTableView and exercise
multi-page pagination under the default newest-first order (empty orderBy)
in TestListDashboards_Pagination.

TAG=agy
CONV=07d92817-86db-4f94-be39-143d8bb7dd96

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Incremental PR Approval

PR author is a code owner and changes since last approval (2 lines, excluding 81 test file lines) are within the 50-line grace delta.

Preserving prior approval by @VLukiantsev on commit 8469519.

@andrzejfudro
andrzejfudro added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 0295d24 Oct 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants