diff --git a/.server-changes/esc-to-close-fixes.md b/.server-changes/esc-to-close-fixes.md new file mode 100644 index 00000000000..70e464ba106 --- /dev/null +++ b/.server-changes/esc-to-close-fixes.md @@ -0,0 +1,6 @@ +--- +area: webapp +type: fix +--- + +Esc now closes the authenticator app setup window and the chat panel, and side sheets now show a close button with their Esc shortcut. Esc in the chat panel's message box just leaves the box, so an unsent message survives and a second Esc closes the panel. Closing a dialog with Esc no longer also closes the panel behind it, and the Vercel setup modal no longer shows a close button that does nothing. diff --git a/apps/webapp/app/components/dashboard-agent/DashboardAgentComposer.tsx b/apps/webapp/app/components/dashboard-agent/DashboardAgentComposer.tsx index 308a87ebab1..32f56c11a27 100644 --- a/apps/webapp/app/components/dashboard-agent/DashboardAgentComposer.tsx +++ b/apps/webapp/app/components/dashboard-agent/DashboardAgentComposer.tsx @@ -31,6 +31,11 @@ export function DashboardAgentComposer({ e.preventDefault(); onSubmit(); } + // Esc leaves the composer, so a second Esc closes the panel and an + // unsent message survives the first one. + if (e.key === "Escape") { + e.currentTarget.blur(); + } }} placeholder="Type a message…" className={cn( diff --git a/apps/webapp/app/components/dashboard-agent/DashboardAgentHeader.tsx b/apps/webapp/app/components/dashboard-agent/DashboardAgentHeader.tsx index 11d486bc1d3..fb125aedd7a 100644 --- a/apps/webapp/app/components/dashboard-agent/DashboardAgentHeader.tsx +++ b/apps/webapp/app/components/dashboard-agent/DashboardAgentHeader.tsx @@ -1,4 +1,5 @@ import { ClockIcon, PencilSquareIcon, XMarkIcon } from "@heroicons/react/20/solid"; +import { Button } from "~/components/primitives/Buttons"; import { cn } from "~/utils/cn"; export function DashboardAgentHeader({ @@ -23,7 +24,15 @@ export function DashboardAgentHeader({ onClick={onToggleHistory} active={view === "history"} /> - +