Skip to content

fix(ui-v2): use expected_start_time for dashboard flow runs filtering#21418

Merged
desertaxle merged 3 commits intomainfrom
devin/OSS-7801-1775247217
Apr 4, 2026
Merged

fix(ui-v2): use expected_start_time for dashboard flow runs filtering#21418
desertaxle merged 3 commits intomainfrom
devin/OSS-7801-1775247217

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Apr 3, 2026

Closes #18041

Overview

The V2 dashboard was filtering flow runs by start_time and sorting by START_TIME_DESC. This meant scheduled and paused flow runs (which have no start_time yet) were invisible in the dashboard time window. The V1 dashboard correctly uses expected_start_time / EXPECTED_START_TIME_DESC.

This PR switches the V2 dashboard to use expected_start_time for filtering and EXPECTED_START_TIME_DESC for sorting, matching V1 behavior.

Changes

All changes are in ui-v2/:

File Change
src/routes/dashboard.tsx buildFlowRunsFilterFromSearch: filter field + sort; loader prefetch sort
src/components/dashboard/flow-runs-card/index.tsx Filter field (expected_start_time) + sort
src/components/dashboard/flow-runs-accordion/index.tsx Base filter sort
src/components/dashboard/flow-runs-accordion/flow-runs-accordion-content.tsx Pagination sort
src/components/dashboard/flow-runs-accordion/flow-runs-accordion-header.tsx Last-run query sort; timestamp fallback to expected_start_time

Test files updated to match new query keys/filters.

Intentionally unchanged: Task runs card and work pools card remain on start_time (matching V1).

Additional: biome lint fixes

Applied biome useOptionalChain auto-fixes in unrelated files that were flagged by the updated biome 2.4.10 linter in CI. Also corrected indentation in dashboard.tsx from merge conflict resolution.

File Fix
src/components/deployments/deployment-details-runs-tab.tsx useOptionalChain
src/components/events/events-line-chart/events-line-chart.tsx useOptionalChain
src/components/ui/flow-run-activity-bar-graph/index.tsx useOptionalChain (×2)

Human review checklist

  1. Accordion header timestamp fallback — The header now renders lastFlowRun?.start_time ?? lastFlowRun?.expected_start_time. For scheduled/paused runs this will show the expected time rather than nothing, which is an improvement but changes what the timestamp represents. The as string cast on the inner expression is guarded by the outer truthiness check. Verify this is the desired UX.
  2. Scope — Confirm work pools card and task runs count filters should stay on start_time.
  3. Biome auto-fixes — The useOptionalChain changes are mechanical but touch unrelated files. Verify no subtle behavioral change (e.g., the !data || !data[0]!data?.[0] rewrite in deployment-details-runs-tab.tsx is safe because data is an array from a query).

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

Link to Devin session: https://app.devin.ai/sessions/5e605d2779f440d9ba197db2d2498dbd
Requested by: @desertaxle

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions github-actions bot added docs ui-replatform Related to the React UI rewrite labels Apr 3, 2026
@desertaxle desertaxle removed the docs label Apr 3, 2026
Switch the V2 dashboard from start_time to expected_start_time and from
START_TIME_DESC to EXPECTED_START_TIME_DESC sort order. This matches V1
behavior and ensures scheduled/paused flow runs (which have no actual
start_time yet) appear within the dashboard time window.

Files changed:
- routes/dashboard.tsx: buildFlowRunsFilterFromSearch + loader prefetch
- flow-runs-card/index.tsx: filter construction
- flow-runs-accordion/index.tsx: base filter sort
- flow-runs-accordion/flow-runs-accordion-content.tsx: pagination sort
- flow-runs-accordion/flow-runs-accordion-header.tsx: last run query sort

Closes #18041

Co-authored-by: Alexander Streed <alexander.streed@gmail.com>
Co-Authored-By: alex.s <ajstreed1@gmail.com>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/OSS-7801-1775247217 branch from 65ceeea to 42aa0f2 Compare April 3, 2026 21:11
@github-actions github-actions bot added the docs label Apr 3, 2026
@desertaxle desertaxle marked this pull request as ready for review April 4, 2026 18:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42aa0f2849

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return {
...flowFilter,
sort: "START_TIME_DESC",
sort: "EXPECTED_START_TIME_DESC",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Render header timestamp from expected start when sorting by it

Sorting the header query by EXPECTED_START_TIME_DESC can now select scheduled/paused runs whose start_time is null, but the header only renders a timestamp when lastFlowRun.start_time is present. In the SCHEDULED/PAUSED tab (or any flow whose newest run has not started), this regresses the header to showing no “last run” time even though a run exists. Consider falling back to expected_start_time (or selecting the most recent run with a non-null start_time) so the header remains informative.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — addressed in a379b12. The header now falls back to expected_start_time when start_time is null, so scheduled/paused runs still show a timestamp.

devin-ai-integration bot and others added 2 commits April 4, 2026 18:59
…stamp

When sorting by EXPECTED_START_TIME_DESC, the last run may be a
scheduled/paused run with null start_time. Fall back to
expected_start_time so the header still shows a timestamp.

Co-authored-by: Alexander Streed <alexander.streed@prefect.io>
Co-Authored-By: alex.s <ajstreed1@gmail.com>
Fix dashboard.tsx indentation from merge conflict resolution and
apply biome useOptionalChain auto-fixes in unrelated files.

Co-authored-by: Alexander Streed <alexander.streed@prefect.io>
Co-Authored-By: alex.s <ajstreed1@gmail.com>
@desertaxle desertaxle merged commit 48105c0 into main Apr 4, 2026
17 checks passed
@desertaxle desertaxle deleted the devin/OSS-7801-1775247217 branch April 4, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs ui-replatform Related to the React UI rewrite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant