fix(ui): keep the chat dock open across navigation
Clicking any navigation control counted as an outside click, so the dock collapsed on every route change and the conversation disappeared. Hide and Escape remain the only ways to collapse it. The e2e accessibility check referenced the removed outside-click launcher and the old Close chat label; both now use the dock's real controls.
This commit is contained in:
20 files changed
+124
-130
No files matched your search
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ChevronDown, ChevronUp } from "@lucide/vue";
|
||||
import { onClickOutside } from "@vueuse/core";
|
||||
import { onUnmounted, ref, watch } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -29,13 +28,10 @@ useChat();
|
||||
|
||||
const expanded = ref(false);
|
||||
const composer = ref<InstanceType<typeof ChatComposer> | null>(null);
|
||||
const dock = ref<HTMLElement | null>(null);
|
||||
|
||||
// Selects and popovers inside the bar render in a portal, so a click on one is
|
||||
// outside the bar in the DOM but not for the operator.
|
||||
onClickOutside(dock, () => (expanded.value = false), {
|
||||
ignore: ['[data-slot="select-content"]', '[data-slot="popover-content"]', '[data-slot="dropdown-menu-content"]'],
|
||||
});
|
||||
// Nothing outside the dock closes it: every navigation control is outside it,
|
||||
// so a click-outside dismissal turned navigation into a collapse and read as a
|
||||
// lost conversation. Hide and Escape are the only ways to collapse.
|
||||
|
||||
watch(isSending, (sending) => {
|
||||
if (sending) expanded.value = true;
|
||||
@@ -64,7 +60,6 @@ function usePrompt(text: string): void {
|
||||
<template>
|
||||
<div class="pointer-events-none fixed inset-x-0 bottom-4 z-40 flex justify-center px-3 max-md:bottom-2">
|
||||
<aside
|
||||
ref="dock"
|
||||
aria-label="Chat with Archie"
|
||||
:class="
|
||||
cn(
|
||||
|
||||
Reference in new issue
Block a user