Skip to content

Commit 28a66ac

Browse files
authored
fix(ui): respect rootOnlyDefault, disable adjacent run navigation in inspector views (#2781)
## Changelog - Add disableAdjacentRows prop to TaskRunsTable component to control table state encoding - Pass rootOnlyDefault prop from loader to TaskRunsTable for proper state management - Disable adjacent run navigation in schedule, waitpoint, and other inspector views - Preserve adjacent run navigation on main runs list page with rootOnly filter support
1 parent 7d34817 commit 28a66ac

File tree

4 files changed

+13
-1
lines changed
  • apps/webapp/app
    • components/runs/v3
    • routes
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.$scheduleParam
      • _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.tokens.$waitpointParam

4 files changed

+13
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,28 @@ import {
5656
TaskRunStatusCombo,
5757
} from "./TaskRunStatus";
5858
import { useOptimisticLocation } from "~/hooks/useOptimisticLocation";
59+
import { useSearchParams } from "~/hooks/useSearchParam";
5960

6061
type RunsTableProps = {
6162
total: number;
6263
hasFilters: boolean;
6364
filters: NextRunListAppliedFilters;
6465
showJob?: boolean;
6566
runs: NextRunListItem[];
67+
rootOnlyDefault?: boolean;
6668
isLoading?: boolean;
6769
allowSelection?: boolean;
6870
variant?: TableVariant;
71+
disableAdjacentRows?: boolean;
6972
};
7073

7174
export function TaskRunsTable({
7275
total,
7376
hasFilters,
7477
filters,
7578
runs,
79+
rootOnlyDefault,
80+
disableAdjacentRows = false,
7681
isLoading = false,
7782
allowSelection = false,
7883
variant = "dimmed",
@@ -82,8 +87,12 @@ export function TaskRunsTable({
8287
const checkboxes = useRef<(HTMLInputElement | null)[]>([]);
8388
const { has, hasAll, select, deselect, toggle } = useSelectedItems(allowSelection);
8489
const { isManagedCloud } = useFeatures();
90+
const { value } = useSearchParams();
8591
const location = useOptimisticLocation();
86-
const tableStateParam = encodeURIComponent(location.search ? `${location.search}&rt=1` : "rt=1");
92+
const rootOnly = value("rootOnly") ? `` : `rootOnly=${rootOnlyDefault}`;
93+
const search = rootOnly ? `${rootOnly}&${location.search}` : location.search;
94+
/** TableState has to be encoded as a separate URI component, so it's merged under one, 'tableState' param */
95+
const tableStateParam = disableAdjacentRows ? '' : encodeURIComponent(search);
8796

8897
const showCompute = isManagedCloud;
8998

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ function RunsList({
298298
runs={list.runs}
299299
isLoading={isLoading}
300300
allowSelection
301+
rootOnlyDefault={rootOnlyDefault}
301302
/>
302303
</div>
303304
)}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.$scheduleParam/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ export default function Page() {
318318
runs={schedule.runs}
319319
isLoading={false}
320320
variant="bright"
321+
disableAdjacentRows
321322
/>
322323
</div>
323324
<div className="flex flex-col gap-1 pt-2">

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.tokens.$waitpointParam/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export default function Page() {
126126
runs={waitpoint.connectedRuns}
127127
isLoading={false}
128128
variant="bright"
129+
disableAdjacentRows
129130
/>
130131
</div>
131132
</div>

0 commit comments

Comments
 (0)