@@ -2,7 +2,7 @@ import { useAtomValue } from "@effect/atom-react";
22import { EnvironmentId } from "@t3tools/contracts" ;
33import { Atom } from "effect/reactivity" ;
44import { ChevronRightIcon } from "lucide-react" ;
5- import { Fragment , type RefObject , useRef } from "react" ;
5+ import { Fragment , type RefObject , useId , useRef } from "react" ;
66
77import { environmentThreadShells } from "~/state/threads" ;
88import {
@@ -54,6 +54,7 @@ type UpdateEverythingDialogContentProps = Omit<
5454 "open" | "onOpenChange"
5555> & {
5656 readonly cancelRef : RefObject < HTMLButtonElement | null > ;
57+ readonly descriptionId : string ;
5758} ;
5859
5960export function UpdateEverythingDialog ( {
@@ -62,15 +63,25 @@ export function UpdateEverythingDialog({
6263 ...content
6364} : UpdateEverythingDialogProps ) {
6465 const cancelRef = useRef < HTMLButtonElement > ( null ) ;
66+ const descriptionId = useId ( ) ;
6567 return (
6668 < AlertDialog open = { open } onOpenChange = { onOpenChange } >
6769 { /* Refocusing the trigger after a pointer close shows its focus ring and opens its tooltip. */ }
6870 < AlertDialogPopup
6971 className = "sm:max-w-xl"
72+ aria-describedby = {
73+ content . rows . some ( ( row ) => row . app !== null )
74+ ? `${ descriptionId } ${ descriptionId } -interruption`
75+ : descriptionId
76+ }
7077 initialFocus = { cancelRef }
7178 finalFocus = { ( closeType ) => closeType === "keyboard" }
7279 >
73- < UpdateEverythingDialogContent { ...content } cancelRef = { cancelRef } />
80+ < UpdateEverythingDialogContent
81+ { ...content }
82+ cancelRef = { cancelRef }
83+ descriptionId = { descriptionId }
84+ />
7485 </ AlertDialogPopup >
7586 </ AlertDialog >
7687 ) ;
@@ -89,6 +100,7 @@ function UpdateEverythingDialogContent({
89100 restarts,
90101 onConfirm,
91102 cancelRef,
103+ descriptionId,
92104} : UpdateEverythingDialogContentProps ) {
93105 const stopped = useAtomValue (
94106 runningThreadCountAtom (
@@ -118,7 +130,7 @@ function UpdateEverythingDialogContent({
118130 < AlertDialogTitle >
119131 Update { updating . length } { updating . length === 1 ? "machine" : "machines" } ?
120132 </ AlertDialogTitle >
121- < AlertDialogDescription >
133+ < AlertDialogDescription id = { descriptionId } >
122134 { version !== null ? (
123135 < >
124136 T3 Code < span className = "font-mono text-xs" > { version } </ span >
@@ -199,8 +211,12 @@ function UpdateEverythingDialogContent({
199211 { /* Thread counts come from client snapshots that can still be loading, so the warning
200212 cannot depend on them. */ }
201213 { updating . some ( ( row ) => row . app !== null ) ? (
202- < p className = "self-center text-muted-foreground text-sm max-sm:order-1 max-sm:text-center sm:mr-auto" >
203- Running tasks and tool calls will be interrupted.
214+ < p
215+ id = { `${ descriptionId } -interruption` }
216+ className = "self-center text-muted-foreground text-sm max-sm:order-1 max-sm:text-center sm:mr-auto"
217+ >
218+ Running tasks and tool calls will be interrupted. Tool calls in progress will not
219+ resume.
204220 { running === 0
205221 ? null
206222 : stopped === 0
0 commit comments