Skip to content

Commit 249878e

Browse files
authored
feat(webapp): link to task-specific test page from filtered runs table (#2741)
When viewing runs filtered to a single task, the "Create a test run" and "Run a test" buttons now navigate directly to the task-specific test page instead of the generic test page. This improves UX by pre-populating the test form with the filtered task, saving users from having to manually select it again. ## ✅ Checklist - [x] I have followed every step in the [contributing guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md) - [x] The PR title follows the convention. - [x] I ran and tested the code works ## Screenshots <img width="1706" height="1392" alt="image" src="https://github.com/user-attachments/assets/d8b5d445-73b5-426c-83a4-90ac2a95b955" />
1 parent 117b1d5 commit 249878e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/webapp/app/components/runs/v3/TaskRunsTable.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
type NextRunListItem,
3232
} from "~/presenters/v3/NextRunListPresenter.server";
3333
import { formatCurrencyAccurate } from "~/utils/numberFormatter";
34-
import { docsPath, v3RunSpanPath, v3TestPath } from "~/utils/pathBuilder";
34+
import { docsPath, v3RunSpanPath, v3TestPath,v3TestTaskPath } from "~/utils/pathBuilder";
3535
import { DateTime } from "../../primitives/DateTime";
3636
import { Paragraph } from "../../primitives/Paragraph";
3737
import { Spinner } from "../../primitives/Spinner";
@@ -565,6 +565,8 @@ function BlankState({ isLoading, filters }: Pick<RunsTableProps, "isLoading" | "
565565
if (isLoading) return <TableBlankRow colSpan={15}></TableBlankRow>;
566566

567567
const { tasks, from, to, ...otherFilters } = filters;
568+
const singleTaskFromFilters = filters.tasks.length === 1 ? filters.tasks[0] : null;
569+
const testPath = singleTaskFromFilters ? v3TestTaskPath(organization, project, environment, {taskIdentifier: singleTaskFromFilters}) : v3TestPath(organization, project, environment);
568570

569571
if (
570572
filters.tasks.length === 1 &&
@@ -579,7 +581,7 @@ function BlankState({ isLoading, filters }: Pick<RunsTableProps, "isLoading" | "
579581
</Paragraph>
580582
<div className="mt-6 flex items-center justify-center gap-2">
581583
<LinkButton
582-
to={v3TestPath(organization, project, environment)}
584+
to={testPath}
583585
variant="tertiary/medium"
584586
LeadingIcon={BeakerIcon}
585587
className="inline-flex"
@@ -620,7 +622,7 @@ function BlankState({ isLoading, filters }: Pick<RunsTableProps, "isLoading" | "
620622
<LinkButton
621623
LeadingIcon={BeakerIcon}
622624
variant="tertiary/medium"
623-
to={v3TestPath(organization, project, environment)}
625+
to={testPath}
624626
>
625627
Run a test
626628
</LinkButton>

0 commit comments

Comments
 (0)