fix(stacks): keep stack breadcrumb on container Quick Actions

The stack container list reuses the shared containers datatable, whose
Quick Actions column linked to the global docker.containers.container.*
states with only {id,nodeName}. Clicking Logs/Stats/Console/Inspect/Attach
from within a stack therefore jumped to the global route and collapsed the
breadcrumb to "Containers > <name> > Logs", losing the stack trail that
PR #7 added.

Thread the current stack route params (via RowContext) down to
ContainerQuickActions so, when rendered inside a stack, its links target the
stack-scoped docker.stacks.stack.container.* sub-tab states (reusing #7's
buildStackContainerLinkParams / STACK_CONTAINER_STATE_NAME helpers). The
global containers list and service tasks pass no stack params and keep the
global links unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
agent_coder
2026-07-01 18:52:44 +03:00
parent 0e572f4ccc
commit f379e8057e
5 changed files with 184 additions and 11 deletions
@@ -1,4 +1,5 @@
import { Box } from 'lucide-react';
import { useCurrentStateAndParams } from '@uirouter/react';
import { ContainerListViewModel } from '@/react/docker/containers/types';
import { createStore } from '@/react/docker/containers/ListView/ContainersDatatable/datatable-store';
@@ -42,6 +43,9 @@ export interface Props {
export function StackContainersDatatable({ stackName }: Props) {
const environmentQuery = useCurrentEnvironment();
const tableState = useTableState(settingsStore, storageKey);
// Current stack route params, forwarded to the Quick Actions column so it can
// link to the stack-scoped container sub-tab states and keep the stack trail.
const { params: stackRouteParams } = useCurrentStateAndParams();
const isGPUsColumnVisible = useShowGPUsColumn(environmentQuery.data);
const columns = useColumns(false, isGPUsColumnVisible);
@@ -60,7 +64,7 @@ export function StackContainersDatatable({ stackName }: Props) {
const environment = environmentQuery.data;
return (
<RowProvider context={{ environment }}>
<RowProvider context={{ environment, stackRouteParams }}>
<TableSettingsProvider settings={settingsStore}>
<Datatable
title="Containers"