From ddbfffc100e1c36a2dea8e38d9cd50ec5fd3d2ff Mon Sep 17 00:00:00 2001 From: Zakk Date: Thu, 1 Oct 2026 04:23:45 +1000 Subject: [PATCH] fix(policies): read a focused group outside the viewport The post-create View group action can focus a card below the fold. A paused resource has no initial group data, leaving that card on Loading without an Edit group action. Keep the focused group active so creation can lead directly to editing. Removing this change makes the Policies create-and-Apply test time out when it opens the new group's More actions menu. Keep it separate from the shared dialog because it changes the card's polling behaviour. --- src/features/policies/usePolicyGroup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/policies/usePolicyGroup.ts b/src/features/policies/usePolicyGroup.ts index ab1098a5..d8725482 100644 --- a/src/features/policies/usePolicyGroup.ts +++ b/src/features/policies/usePolicyGroup.ts @@ -31,7 +31,7 @@ export type PolicyGroupInput = { export function usePolicyGroup(input: PolicyGroupInput) { const {id, health, outbounds, refreshGroups, refreshNodes, source, declaration, selection, paused, focused} = input; const t = useT(); - const control = useGroupControl(id, refreshGroups, refreshNodes, paused); + const control = useGroupControl(id, refreshGroups, refreshNodes, paused && !focused); // A language switch does not repeat the toast. const report = useEffectEvent((error: Error) => toast('negative', t('policy.actionFailed', {name: control.data?.name ?? input.name, error: actionErrorText(error, t, false)}), {