fix(webui): simplify mobile composer controls and context sheet
This commit is contained in:
1 parent
3a14935eb1
commit
827dbe137b
7 files changed
+395
-219
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
import { Fragment, useMemo, useRef } from "react";
|
import { Fragment, useMemo, useRef, type ReactNode } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
|
import { Sheet, SheetContent, SheetTitle, SheetTrigger } from "@/components/ui/sheet";
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
TooltipContent,
|
TooltipContent,
|
||||||
@@ -55,12 +56,15 @@ function normalizeRounds(
|
|||||||
export function ComposerUsagePopover({
|
export function ComposerUsagePopover({
|
||||||
context,
|
context,
|
||||||
rounds,
|
rounds,
|
||||||
|
showLabel = false,
|
||||||
|
bottomSheet = false,
|
||||||
}: {
|
}: {
|
||||||
context: ComposerContextUsage | null;
|
context: ComposerContextUsage | null;
|
||||||
rounds: readonly ComposerRoundUsage[];
|
rounds: readonly ComposerRoundUsage[];
|
||||||
|
showLabel?: boolean;
|
||||||
|
bottomSheet?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const panelRef = useRef<HTMLDivElement>(null);
|
|
||||||
const normalizedRounds = useMemo(() => normalizeRounds(rounds), [rounds]);
|
const normalizedRounds = useMemo(() => normalizeRounds(rounds), [rounds]);
|
||||||
const hasContext = !!context
|
const hasContext = !!context
|
||||||
&& Number.isFinite(context.contextTokens)
|
&& Number.isFinite(context.contextTokens)
|
||||||
@@ -110,109 +114,104 @@ export function ComposerUsagePopover({
|
|||||||
minute: "2-digit",
|
minute: "2-digit",
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
const Root = bottomSheet ? Sheet : Popover;
|
||||||
<Popover>
|
const Trigger = bottomSheet ? SheetTrigger : PopoverTrigger;
|
||||||
<TooltipProvider>
|
const trigger = (
|
||||||
<Tooltip>
|
<Trigger asChild>
|
||||||
<TooltipTrigger asChild>
|
<button
|
||||||
<PopoverTrigger asChild>
|
type="button"
|
||||||
<button
|
data-testid="composer-context-usage"
|
||||||
type="button"
|
aria-label={triggerLabel}
|
||||||
data-testid="composer-context-usage"
|
className={cn(
|
||||||
aria-label={triggerLabel}
|
"touch-target inline-flex size-5 shrink-0 items-center justify-center rounded-full",
|
||||||
className={cn(
|
"text-muted-foreground/75 transition-colors hover:text-foreground/85",
|
||||||
"touch-target inline-flex size-5 shrink-0 items-center justify-center rounded-full",
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
||||||
"text-muted-foreground/75 transition-colors hover:text-foreground/85",
|
showLabel && "w-auto gap-1.5 px-2 text-xs",
|
||||||
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
)}
|
||||||
)}
|
>
|
||||||
>
|
{contextPercentage === null ? (
|
||||||
{contextPercentage === null ? (
|
<svg viewBox="0 0 16 16" aria-hidden="true" className="size-[15px]">
|
||||||
<svg viewBox="0 0 16 16" aria-hidden="true" className="size-[15px]">
|
<path
|
||||||
<path
|
d="M3 12V9m5 3V5m5 7V2"
|
||||||
d="M3 12V9m5 3V5m5 7V2"
|
fill="none"
|
||||||
fill="none"
|
stroke="currentColor"
|
||||||
stroke="currentColor"
|
strokeWidth="1.5"
|
||||||
strokeWidth="1.5"
|
strokeLinecap="round"
|
||||||
strokeLinecap="round"
|
/>
|
||||||
/>
|
</svg>
|
||||||
</svg>
|
) : (
|
||||||
) : (
|
<svg
|
||||||
<svg
|
viewBox="0 0 16 16"
|
||||||
viewBox="0 0 16 16"
|
aria-hidden="true"
|
||||||
aria-hidden="true"
|
className={cn(
|
||||||
className={cn(
|
"size-[15px] shrink-0 -rotate-90",
|
||||||
"size-[15px] shrink-0 -rotate-90",
|
status === "critical" && "text-destructive",
|
||||||
status === "critical" && "text-destructive",
|
status === "caution" && "text-amber-600 dark:text-amber-400",
|
||||||
status === "caution" && "text-amber-600 dark:text-amber-400",
|
status === "normal" && "text-muted-foreground/75",
|
||||||
status === "normal" && "text-muted-foreground/75",
|
)}
|
||||||
)}
|
|
||||||
>
|
|
||||||
<circle
|
|
||||||
cx="8"
|
|
||||||
cy="8"
|
|
||||||
r="6"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1.5"
|
|
||||||
className="opacity-20"
|
|
||||||
/>
|
|
||||||
<circle
|
|
||||||
cx="8"
|
|
||||||
cy="8"
|
|
||||||
r="6"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1.5"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeDasharray={`${ringLength} ${ringCircumference}`}
|
|
||||||
data-testid="composer-context-meter"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
</TooltipTrigger>
|
|
||||||
<TooltipContent
|
|
||||||
side="top"
|
|
||||||
align="center"
|
|
||||||
sideOffset={8}
|
|
||||||
className="w-fit max-w-[calc(100vw-2rem)] rounded-full border-border/70 px-2.5 py-1 text-xs font-medium shadow-[0_8px_24px_rgba(15,23,42,0.13)]"
|
|
||||||
>
|
>
|
||||||
<span className="whitespace-nowrap tabular-nums">{contextDescription}</span>
|
<circle
|
||||||
</TooltipContent>
|
cx="8"
|
||||||
</Tooltip>
|
cy="8"
|
||||||
|
r="6"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="1.5"
|
||||||
|
className="opacity-20"
|
||||||
|
/>
|
||||||
|
<circle
|
||||||
|
cx="8"
|
||||||
|
cy="8"
|
||||||
|
r="6"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth="1.5"
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeDasharray={`${ringLength} ${ringCircumference}`}
|
||||||
|
data-testid="composer-context-meter"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
)}
|
||||||
|
{showLabel ? <span aria-hidden>{contextDescription}</span> : null}
|
||||||
|
</button>
|
||||||
|
</Trigger>
|
||||||
|
);
|
||||||
|
|
||||||
<PopoverContent
|
return (
|
||||||
ref={panelRef}
|
<Root>
|
||||||
side="top"
|
<TooltipProvider>
|
||||||
align="end"
|
{bottomSheet ? trigger : (
|
||||||
sideOffset={10}
|
<Tooltip>
|
||||||
onOpenAutoFocus={(event) => {
|
<TooltipTrigger asChild>{trigger}</TooltipTrigger>
|
||||||
event.preventDefault();
|
<TooltipContent
|
||||||
panelRef.current?.focus();
|
side="top"
|
||||||
}}
|
align="center"
|
||||||
aria-label={t("thread.composer.context.panelTitle", {
|
sideOffset={8}
|
||||||
defaultValue: "Context usage",
|
className="w-fit max-w-[calc(100vw-2rem)] rounded-full border-border/70 px-2.5 py-1 text-xs font-medium shadow-[0_8px_24px_rgba(15,23,42,0.13)]"
|
||||||
})}
|
>
|
||||||
className="w-[min(22rem,calc(100vw-1.5rem))] p-0"
|
<span className="whitespace-nowrap tabular-nums">{contextDescription}</span>
|
||||||
>
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<UsagePanel bottomSheet={bottomSheet}>
|
||||||
<div className="px-4 pb-4 pt-3.5">
|
<div className="px-4 pb-4 pt-3.5">
|
||||||
{contextPercentage !== null ? (
|
{contextPercentage !== null ? (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-baseline justify-between gap-3">
|
<div className="flex items-baseline justify-between gap-3">
|
||||||
<div className="flex min-w-0 items-baseline gap-2">
|
<div className="flex min-w-0 items-baseline gap-2">
|
||||||
<span className="shrink-0 text-[12px] font-medium text-foreground">
|
<span className={cn("shrink-0 font-medium text-foreground", bottomSheet ? "text-sm" : "text-[12px]")}>
|
||||||
{t("thread.composer.context.contextTitle", {
|
{t("thread.composer.context.contextTitle", {
|
||||||
defaultValue: "Context",
|
defaultValue: "Context",
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
<span className="truncate text-[11px] tabular-nums text-muted-foreground">
|
<span className={cn("truncate tabular-nums text-muted-foreground", bottomSheet ? "text-xs" : "text-[11px]")}>
|
||||||
{formatCompactTokenCount(context!.contextTokens)} / {formatCompactTokenCount(
|
{formatCompactTokenCount(context!.contextTokens)} / {formatCompactTokenCount(
|
||||||
context!.contextWindowTokens!,
|
context!.contextWindowTokens!,
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span className="shrink-0 text-[11px] tabular-nums text-muted-foreground">
|
<span className={cn("shrink-0 tabular-nums text-muted-foreground", bottomSheet ? "text-xs" : "text-[11px]")}>
|
||||||
{contextPercentage}%
|
{contextPercentage}%
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -243,12 +242,12 @@ export function ComposerUsagePopover({
|
|||||||
"flex items-baseline justify-between gap-3",
|
"flex items-baseline justify-between gap-3",
|
||||||
contextPercentage === null ? "mt-0" : "mt-5",
|
contextPercentage === null ? "mt-0" : "mt-5",
|
||||||
)}>
|
)}>
|
||||||
<span className="text-[12px] font-medium text-foreground">
|
<span className={cn("font-medium text-foreground", bottomSheet ? "text-sm" : "text-[12px]")}>
|
||||||
{t("thread.composer.context.recentRounds", {
|
{t("thread.composer.context.recentRounds", {
|
||||||
defaultValue: "Recent rounds",
|
defaultValue: "Recent rounds",
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-[11px] text-muted-foreground">
|
<span className={cn("text-muted-foreground", bottomSheet ? "text-xs" : "text-[11px]")}>
|
||||||
{t("thread.composer.context.inputTrend", {
|
{t("thread.composer.context.inputTrend", {
|
||||||
defaultValue: "Input tokens",
|
defaultValue: "Input tokens",
|
||||||
})}
|
})}
|
||||||
@@ -403,8 +402,56 @@ export function ComposerUsagePopover({
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</PopoverContent>
|
</UsagePanel>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
</Popover>
|
</Root>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function UsagePanel({ bottomSheet, children }: { bottomSheet: boolean; children: ReactNode }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const panelRef = useRef<HTMLDivElement>(null);
|
||||||
|
const title = t("thread.composer.context.panelTitle", { defaultValue: "Context usage" });
|
||||||
|
const focusPanel = (event: Event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
panelRef.current?.focus({ preventScroll: true });
|
||||||
|
};
|
||||||
|
|
||||||
|
if (bottomSheet) {
|
||||||
|
return (
|
||||||
|
<SheetContent
|
||||||
|
ref={panelRef}
|
||||||
|
side="bottom"
|
||||||
|
aria-describedby={undefined}
|
||||||
|
onOpenAutoFocus={focusPanel}
|
||||||
|
className={cn(
|
||||||
|
"mx-auto max-h-[60dvh] w-full max-w-md gap-0 rounded-t-3xl border-t border-border/60 p-0 shadow-xl outline-none",
|
||||||
|
"data-[state=open]:duration-300 data-[state=open]:ease-out data-[state=closed]:duration-200 data-[state=closed]:ease-in",
|
||||||
|
)}
|
||||||
|
closeButtonClassName="right-3 top-5 flex size-11 items-center justify-center rounded-full"
|
||||||
|
>
|
||||||
|
<div aria-hidden="true" className="mx-auto mt-2.5 h-1 w-8 shrink-0 rounded-full bg-foreground/15" />
|
||||||
|
<div className="shrink-0 px-5 pb-2 pt-5 pr-16">
|
||||||
|
<SheetTitle className="text-base font-medium">{title}</SheetTitle>
|
||||||
|
</div>
|
||||||
|
<div className="min-h-0 overflow-y-auto overscroll-contain px-1 pb-[max(0.75rem,env(safe-area-inset-bottom))]">
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</SheetContent>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PopoverContent
|
||||||
|
ref={panelRef}
|
||||||
|
side="top"
|
||||||
|
align="end"
|
||||||
|
sideOffset={10}
|
||||||
|
onOpenAutoFocus={focusPanel}
|
||||||
|
aria-label={title}
|
||||||
|
className="w-[min(22rem,calc(100vw-1.5rem))] p-0"
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</PopoverContent>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -483,7 +483,7 @@ function PresetOption({
|
|||||||
className={cn(
|
className={cn(
|
||||||
floatingItemClassName,
|
floatingItemClassName,
|
||||||
floatingItemFocusClassName,
|
floatingItemFocusClassName,
|
||||||
"flex min-h-9 w-full cursor-pointer gap-2.5 px-2.5 py-1.5 text-left hover:bg-muted/55",
|
"flex min-h-9 w-full cursor-pointer gap-2.5 px-2.5 py-1.5 text-left hover:bg-muted/55 max-sm:min-h-11",
|
||||||
selected && "bg-muted/55 text-foreground",
|
selected && "bg-muted/55 text-foreground",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -493,8 +493,8 @@ function PresetOption({
|
|||||||
provider={preset.provider}
|
provider={preset.provider}
|
||||||
isHero={false}
|
isHero={false}
|
||||||
/>
|
/>
|
||||||
<span className="flex min-w-0 flex-1 items-baseline gap-1.5 overflow-hidden whitespace-nowrap">
|
<span className="flex min-w-0 flex-1 items-baseline gap-1.5 overflow-hidden whitespace-nowrap max-sm:flex-col max-sm:items-start max-sm:gap-0.5 max-sm:whitespace-normal">
|
||||||
<span className="shrink-0 text-[13px] font-medium text-foreground">{preset.name}</span>
|
<span className="shrink-0 text-[13px] font-medium text-foreground max-sm:max-w-full max-sm:break-words">{preset.name}</span>
|
||||||
{detail && detail !== preset.name ? (
|
{detail && detail !== preset.name ? (
|
||||||
<span className="truncate text-[12px] text-muted-foreground">{detail}</span>
|
<span className="truncate text-[12px] text-muted-foreground">{detail}</span>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -963,6 +963,32 @@ export function ThreadComposer({
|
|||||||
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
||||||
const mentionOverlayRef = useRef<HTMLDivElement>(null);
|
const mentionOverlayRef = useRef<HTMLDivElement>(null);
|
||||||
const formRef = useRef<HTMLFormElement>(null);
|
const formRef = useRef<HTMLFormElement>(null);
|
||||||
|
const [compactControls, setCompactControls] = useState(false);
|
||||||
|
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
const form = formRef.current;
|
||||||
|
if (!form) return;
|
||||||
|
let previousWidth = 0;
|
||||||
|
const update = () => {
|
||||||
|
const width = form.getBoundingClientRect().width;
|
||||||
|
if (width <= 0 || width === previousWidth) return;
|
||||||
|
previousWidth = width;
|
||||||
|
setCompactControls(width <= 512);
|
||||||
|
const input = textareaRef.current;
|
||||||
|
if (input) {
|
||||||
|
input.style.height = "auto";
|
||||||
|
input.style.height = `${Math.min(input.scrollHeight, 260)}px`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
update();
|
||||||
|
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(update);
|
||||||
|
observer?.observe(form);
|
||||||
|
window.addEventListener("resize", update);
|
||||||
|
return () => {
|
||||||
|
observer?.disconnect();
|
||||||
|
window.removeEventListener("resize", update);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||||
const chipRefs = useRef(new Map<string, HTMLButtonElement>());
|
const chipRefs = useRef(new Map<string, HTMLButtonElement>());
|
||||||
const queuedPromptCounterRef = useRef(0);
|
const queuedPromptCounterRef = useRef(0);
|
||||||
@@ -1524,7 +1550,7 @@ export function ThreadComposer({
|
|||||||
el.style.height = "auto";
|
el.style.height = "auto";
|
||||||
el.style.height = `${Math.min(el.scrollHeight, 260)}px`;
|
el.style.height = `${Math.min(el.scrollHeight, 260)}px`;
|
||||||
if (mentionOverlayRef.current) mentionOverlayRef.current.scrollTop = el.scrollTop;
|
if (mentionOverlayRef.current) mentionOverlayRef.current.scrollTop = el.scrollTop;
|
||||||
}, [mentionInput.isComposing, mentionInput.value]);
|
}, [compactControls, mentionInput.isComposing, mentionInput.value]);
|
||||||
|
|
||||||
// Runs before paint so switching sessions never flashes stale draft text.
|
// Runs before paint so switching sessions never flashes stale draft text.
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
@@ -2201,12 +2227,12 @@ export function ThreadComposer({
|
|||||||
: t("thread.composer.voice.hint");
|
: t("thread.composer.voice.hint");
|
||||||
const showStopButton = isStreaming && !!onStop;
|
const showStopButton = isStreaming && !!onStop;
|
||||||
const relaxedHeroInput = isHero && images.length === 0 && !isStreaming;
|
const relaxedHeroInput = isHero && images.length === 0 && !isStreaming;
|
||||||
const compactIdle = compactWhenIdle && !isHero && !composerFocused
|
const compactIdle = compactWhenIdle && !compactControls && !isHero && !composerFocused
|
||||||
&& value.length === 0 && images.length === 0 && !inlineError
|
&& value.length === 0 && images.length === 0 && !inlineError
|
||||||
&& !normalizedQuotedContext && !queuedPrompts.length && !goalState?.active
|
&& !normalizedQuotedContext && !queuedPrompts.length && !goalState?.active
|
||||||
&& !isDragging && !sessionDragPreview && !voiceRecorder.isRecording && !showProjectPicker;
|
&& !isDragging && !sessionDragPreview && !voiceRecorder.isRecording && !showProjectPicker;
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (!compactWhenIdle) return;
|
if (!compactWhenIdle || compactControls) return;
|
||||||
const form = formRef.current;
|
const form = formRef.current;
|
||||||
const primary = form?.querySelector<HTMLElement>(".thread-composer-footer-primary");
|
const primary = form?.querySelector<HTMLElement>(".thread-composer-footer-primary");
|
||||||
const actions = form?.querySelector<HTMLElement>(".thread-composer-footer-actions");
|
const actions = form?.querySelector<HTMLElement>(".thread-composer-footer-actions");
|
||||||
@@ -2225,20 +2251,53 @@ export function ThreadComposer({
|
|||||||
controls.forEach((control) => observer?.observe(control));
|
controls.forEach((control) => observer?.observe(control));
|
||||||
observer?.observe(actions);
|
observer?.observe(actions);
|
||||||
return () => observer?.disconnect();
|
return () => observer?.disconnect();
|
||||||
}, [compactWhenIdle, modelLabel, voiceRecorder.isRecording, workspaceScope]);
|
}, [compactControls, compactWhenIdle, modelLabel, voiceRecorder.isRecording, workspaceScope]);
|
||||||
|
const accessControl = workspaceScope && !workspaceControlsHidden ? (
|
||||||
|
<WorkspaceAccessMenu
|
||||||
|
scope={workspaceScope}
|
||||||
|
disabled={interactionDisabled || workspaceScopeDisabled}
|
||||||
|
canUseFullAccess={workspaceControls?.can_use_full_access !== false}
|
||||||
|
isHero={isHero}
|
||||||
|
onChange={onWorkspaceScopeChange}
|
||||||
|
/>
|
||||||
|
) : null;
|
||||||
|
const modelControl = modelLabel && !voiceRecorder.isRecording ? (
|
||||||
|
<ModelPresetBadge
|
||||||
|
label={modelLabel}
|
||||||
|
modelDetail={modelDetail}
|
||||||
|
modelPreset={modelPreset}
|
||||||
|
modelPresets={modelPresets}
|
||||||
|
onPresetChange={onModelPresetChange}
|
||||||
|
onManageModels={onManageModels}
|
||||||
|
onRequestComposerFocus={() => textareaRef.current?.focus()}
|
||||||
|
provider={modelProvider}
|
||||||
|
providerLabel={modelProviderLabel}
|
||||||
|
needsSetup={modelNeedsSetup}
|
||||||
|
attentionRequest={modelSetupAttentionRequest}
|
||||||
|
fallbackModelName={fallbackModelName}
|
||||||
|
isHero={isHero && !compactControls}
|
||||||
|
onClick={modelNeedsSetup ? onModelBadgeClick : undefined}
|
||||||
|
/>
|
||||||
|
) : null;
|
||||||
|
const usageControl = !voiceRecorder.isRecording ? (
|
||||||
|
<ComposerUsagePopover context={contextUsage} rounds={recentRoundUsage} showLabel={compactControls} bottomSheet={compactControls} />
|
||||||
|
) : null;
|
||||||
const inputTextClasses = cn(
|
const inputTextClasses = cn(
|
||||||
"w-full resize-none bg-transparent",
|
"w-full resize-none bg-transparent",
|
||||||
isHero
|
compactControls
|
||||||
? cn(
|
? "min-h-[52px] px-4 pb-2 pt-3 text-[16px] leading-6"
|
||||||
"min-h-[78px] px-4 text-[16px] leading-6 sm:px-5",
|
: isHero
|
||||||
relaxedHeroInput ? "pb-2 pt-[27px]" : "pb-1.5 pt-4",
|
? cn(
|
||||||
)
|
"min-h-[78px] px-4 text-[16px] leading-6 sm:px-5",
|
||||||
: "min-h-[50px] px-3.5 pb-1.5 pt-3 text-[16px] leading-5 sm:px-4",
|
relaxedHeroInput ? "pb-2 pt-[27px]" : "pb-1.5 pt-4",
|
||||||
|
)
|
||||||
|
: "min-h-[50px] px-3.5 pb-1.5 pt-3 text-[16px] leading-5 sm:px-4",
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form
|
<form
|
||||||
ref={formRef}
|
ref={formRef}
|
||||||
|
data-compact-controls={compactControls ? "true" : undefined}
|
||||||
onFocusCapture={() => {
|
onFocusCapture={() => {
|
||||||
if (!compactWhenIdle) return;
|
if (!compactWhenIdle) return;
|
||||||
// Portaled model controls belong to this composer too: keep its layout
|
// Portaled model controls belong to this composer too: keep its layout
|
||||||
@@ -2488,7 +2547,7 @@ export function ThreadComposer({
|
|||||||
aria-label={t("thread.composer.attachImage")}
|
aria-label={t("thread.composer.attachImage")}
|
||||||
onClick={() => fileInputRef.current?.click()}
|
onClick={() => fileInputRef.current?.click()}
|
||||||
className={cn(
|
className={cn(
|
||||||
"thread-composer-action touch-target rounded-full text-muted-foreground hover:text-foreground",
|
"thread-composer-action thread-composer-round-action touch-target rounded-full text-muted-foreground hover:text-foreground",
|
||||||
isHero
|
isHero
|
||||||
? "h-8 w-8 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card"
|
? "h-8 w-8 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card"
|
||||||
: "h-9 w-9 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card",
|
: "h-9 w-9 border border-border/55 bg-card shadow-[0_2px_8px_rgba(15,23,42,0.05)] hover:bg-card",
|
||||||
@@ -2504,15 +2563,7 @@ export function ThreadComposer({
|
|||||||
isHero={isHero}
|
isHero={isHero}
|
||||||
levels={voiceRecorder.levels}
|
levels={voiceRecorder.levels}
|
||||||
/>
|
/>
|
||||||
) : workspaceScope && !workspaceControlsHidden ? (
|
) : compactControls ? modelControl : accessControl}
|
||||||
<WorkspaceAccessMenu
|
|
||||||
scope={workspaceScope}
|
|
||||||
disabled={interactionDisabled || workspaceScopeDisabled}
|
|
||||||
canUseFullAccess={workspaceControls?.can_use_full_access !== false}
|
|
||||||
isHero={isHero}
|
|
||||||
onChange={onWorkspaceScopeChange}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
@@ -2520,30 +2571,8 @@ export function ThreadComposer({
|
|||||||
isHero ? "gap-1.5" : "gap-2",
|
isHero ? "gap-1.5" : "gap-2",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{modelLabel && !voiceRecorder.isRecording ? (
|
{!compactControls ? modelControl : null}
|
||||||
<ModelPresetBadge
|
{!compactControls ? usageControl : null}
|
||||||
label={modelLabel}
|
|
||||||
modelDetail={modelDetail}
|
|
||||||
modelPreset={modelPreset}
|
|
||||||
modelPresets={modelPresets}
|
|
||||||
onPresetChange={onModelPresetChange}
|
|
||||||
onManageModels={onManageModels}
|
|
||||||
onRequestComposerFocus={() => textareaRef.current?.focus()}
|
|
||||||
provider={modelProvider}
|
|
||||||
providerLabel={modelProviderLabel}
|
|
||||||
needsSetup={modelNeedsSetup}
|
|
||||||
attentionRequest={modelSetupAttentionRequest}
|
|
||||||
fallbackModelName={fallbackModelName}
|
|
||||||
isHero={isHero}
|
|
||||||
onClick={modelNeedsSetup ? onModelBadgeClick : undefined}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{!voiceRecorder.isRecording ? (
|
|
||||||
<ComposerUsagePopover
|
|
||||||
context={contextUsage}
|
|
||||||
rounds={recentRoundUsage}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{showVoiceButton ? (
|
{showVoiceButton ? (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
@@ -2604,7 +2633,7 @@ export function ThreadComposer({
|
|||||||
}
|
}
|
||||||
onClick={showStopButton ? handleStop : modelNeedsSetup ? onModelBadgeClick : undefined}
|
onClick={showStopButton ? handleStop : modelNeedsSetup ? onModelBadgeClick : undefined}
|
||||||
className={cn(
|
className={cn(
|
||||||
"thread-composer-action touch-target rounded-full transition-transform",
|
"thread-composer-action thread-composer-round-action touch-target rounded-full transition-transform",
|
||||||
showStopButton
|
showStopButton
|
||||||
? "border border-border/70 bg-card text-foreground/85 shadow-[0_3px_10px_rgba(15,23,42,0.08)] hover:bg-muted/65 hover:text-foreground disabled:text-muted-foreground/50"
|
? "border border-border/70 bg-card text-foreground/85 shadow-[0_3px_10px_rgba(15,23,42,0.08)] hover:bg-muted/65 hover:text-foreground disabled:text-muted-foreground/50"
|
||||||
: isHero
|
: isHero
|
||||||
@@ -2648,6 +2677,12 @@ export function ThreadComposer({
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
{compactControls ? (
|
||||||
|
<div className="thread-composer-meta mx-auto flex w-full max-w-[58rem] items-center justify-between gap-2 px-2">
|
||||||
|
{accessControl}
|
||||||
|
<div className="ml-auto">{usageControl}</div>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ function AccessMenuItem({
|
|||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex h-10 items-center gap-3 px-3 text-[13.5px] font-semibold",
|
"flex h-10 items-center gap-3 px-3 text-[13.5px] font-semibold max-sm:min-h-11",
|
||||||
warning && "text-orange-600 focus:text-orange-600 dark:text-orange-300 dark:focus:text-orange-300",
|
warning && "text-orange-600 focus:text-orange-600 dark:text-orange-300 dark:focus:text-orange-300",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
const Sheet = DialogPrimitive.Root;
|
const Sheet = DialogPrimitive.Root;
|
||||||
|
const SheetTrigger = DialogPrimitive.Trigger;
|
||||||
const SheetPortal = DialogPrimitive.Portal;
|
const SheetPortal = DialogPrimitive.Portal;
|
||||||
|
|
||||||
const SheetOverlay = React.forwardRef<
|
const SheetOverlay = React.forwardRef<
|
||||||
@@ -19,6 +20,7 @@ const SheetOverlay = React.forwardRef<
|
|||||||
"fixed inset-0 z-50 bg-black/40",
|
"fixed inset-0 z-50 bg-black/40",
|
||||||
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
||||||
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
||||||
|
"motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
@@ -85,7 +87,8 @@ const SheetContent = React.forwardRef<
|
|||||||
className={cn(
|
className={cn(
|
||||||
sheetVariants({ side }),
|
sheetVariants({ side }),
|
||||||
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
||||||
"duration-300",
|
"duration-300 motion-reduce:transition-none",
|
||||||
|
"motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
@@ -134,4 +137,4 @@ const SheetDescription = React.forwardRef<
|
|||||||
));
|
));
|
||||||
SheetDescription.displayName = DialogPrimitive.Description.displayName;
|
SheetDescription.displayName = DialogPrimitive.Description.displayName;
|
||||||
|
|
||||||
export { Sheet, SheetContent, SheetDescription, SheetTitle };
|
export { Sheet, SheetTrigger, SheetContent, SheetDescription, SheetTitle };
|
||||||
+58
-75
@@ -758,9 +758,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Composer controls compress against their actual container, not the viewport.
|
* Composer controls adapt to their actual container, not just the viewport.
|
||||||
* Permission state has priority over the model label; both retain their full
|
* Narrow layouts move access and usage into a separate metadata row.
|
||||||
* accessible names and tooltip text when their visible labels are shortened.
|
|
||||||
*/
|
*/
|
||||||
.thread-composer-surface {
|
.thread-composer-surface {
|
||||||
container-name: thread-composer;
|
container-name: thread-composer;
|
||||||
@@ -919,84 +918,68 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@container thread-composer (max-width: 21rem) {
|
/* Narrow composers separate message actions from permissions and usage instead
|
||||||
.thread-composer-footer {
|
* of shrinking touch targets or hiding the active model and access state. */
|
||||||
column-gap: 0.25rem;
|
[data-compact-controls] .thread-composer-footer {
|
||||||
padding-inline: 0.5rem;
|
column-gap: 0.25rem;
|
||||||
}
|
padding: 0 0.5rem 0.5rem;
|
||||||
|
|
||||||
.thread-composer-footer-primary,
|
|
||||||
.thread-composer-footer-actions {
|
|
||||||
gap: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-access {
|
|
||||||
max-width: 6.5rem;
|
|
||||||
padding-inline: 0.5rem;
|
|
||||||
font-size: 0.71875rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-access-icon {
|
|
||||||
margin-right: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-access-chevron {
|
|
||||||
margin-left: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-access-label-full {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-access-label-short {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@container thread-composer (max-width: 19rem) {
|
[data-compact-controls] .thread-composer-footer-primary,
|
||||||
.thread-composer-model-badge {
|
[data-compact-controls] .thread-composer-footer-actions {
|
||||||
width: 2rem;
|
gap: 0.25rem;
|
||||||
flex: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-model-badge .composer-model-pill {
|
|
||||||
width: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 0;
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-model-label {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@container thread-composer (max-width: 16rem) {
|
[data-compact-controls] .thread-composer-footer-actions {
|
||||||
.thread-composer-access {
|
flex: none;
|
||||||
width: 2rem;
|
max-width: none;
|
||||||
flex: none;
|
|
||||||
justify-content: center;
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-access-icon {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thread-composer-access-label-short,
|
|
||||||
.thread-composer-access-chevron {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@container thread-composer (max-width: 15rem) {
|
[data-compact-controls] .thread-composer-action.touch-target {
|
||||||
.thread-composer-action.touch-target,
|
flex: none;
|
||||||
.thread-composer-access.touch-target {
|
width: 2.75rem;
|
||||||
width: 2rem;
|
height: 2.75rem;
|
||||||
min-width: 2rem;
|
min-width: 2.75rem;
|
||||||
height: 2rem;
|
min-height: 2.75rem;
|
||||||
min-height: 2rem;
|
}
|
||||||
}
|
|
||||||
|
[data-compact-controls] .thread-composer-model-badge {
|
||||||
|
max-width: 100%;
|
||||||
|
min-height: 2.75rem;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Keep a 44px hit area around the quieter 36px attachment/send circles.
|
||||||
|
* The transparent pseudo-element belongs to the button, including its disabled
|
||||||
|
* state; margins reserve its space so adjacent controls never overlap it. */
|
||||||
|
[data-compact-controls] .thread-composer-round-action.touch-target {
|
||||||
|
position: relative;
|
||||||
|
width: 2.25rem;
|
||||||
|
height: 2.25rem;
|
||||||
|
min-width: 2.25rem;
|
||||||
|
min-height: 2.25rem;
|
||||||
|
margin: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-compact-controls] .thread-composer-round-action::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -0.3125rem;
|
||||||
|
border-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-compact-controls] .composer-model-pill {
|
||||||
|
height: 2.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thread-composer-meta .touch-target {
|
||||||
|
min-height: 2.75rem;
|
||||||
|
min-width: 2.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thread-composer-meta .thread-composer-access {
|
||||||
|
max-width: 100%;
|
||||||
|
padding-inline: 0.5rem;
|
||||||
}
|
}
|
||||||
@media (forced-colors: active) {
|
@media (forced-colors: active) {
|
||||||
[data-workbench-move-handle]:focus-visible {
|
[data-workbench-move-handle]:focus-visible {
|
||||||
|
|||||||
@@ -1141,6 +1141,114 @@ describe("ThreadComposer", () => {
|
|||||||
expect(screen.getByDisplayValue("voice text")).toBeInTheDocument();
|
expect(screen.getByDisplayValue("voice text")).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each(["thread", "hero"] as const)("separates narrow %s actions from access and usage without losing the draft", async (variant) => {
|
||||||
|
let width = 390;
|
||||||
|
vi.spyOn(HTMLFormElement.prototype, "getBoundingClientRect").mockImplementation(
|
||||||
|
() => rect({ width, height: 160 }),
|
||||||
|
);
|
||||||
|
const onSend = vi.fn();
|
||||||
|
const onWorkspaceScopeChange = vi.fn();
|
||||||
|
const { container } = render(
|
||||||
|
<ThreadComposer
|
||||||
|
variant={variant}
|
||||||
|
compactWhenIdle
|
||||||
|
onSend={onSend}
|
||||||
|
modelLabel="codex"
|
||||||
|
workspaceScope={{ project_path: "/tmp/project", project_name: "project", access_mode: "full", restrict_to_workspace: false }}
|
||||||
|
onWorkspaceScopeChange={onWorkspaceScopeChange}
|
||||||
|
contextUsage={{ contextTokens: 500, contextWindowTokens: 1000 }}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
const form = container.querySelector("form")!;
|
||||||
|
const input = screen.getByRole("textbox");
|
||||||
|
const access = screen.getByRole("button", { name: "Workspace access mode: Full Access" });
|
||||||
|
const meta = container.querySelector(".thread-composer-meta")!;
|
||||||
|
expect(form).toHaveAttribute("data-compact-controls", "true");
|
||||||
|
expect(container.querySelector(".thread-composer-surface")).not.toHaveAttribute("data-compact");
|
||||||
|
expect(meta).toContainElement(access);
|
||||||
|
expect(meta).toContainElement(screen.getByTestId("composer-context-usage"));
|
||||||
|
expect(within(meta as HTMLElement).getByText("Context 50%")).toBeVisible();
|
||||||
|
expect(container.querySelector(".thread-composer-footer-primary")).toContainElement(screen.getByLabelText("codex"));
|
||||||
|
fireEvent.change(input, { target: { value: "keep this draft" } });
|
||||||
|
|
||||||
|
// A narrow desktop panel uses the same layout; resizing must not replace the textarea.
|
||||||
|
width = 800;
|
||||||
|
fireEvent(window, new Event("resize"));
|
||||||
|
expect(form).not.toHaveAttribute("data-compact-controls");
|
||||||
|
expect(container.querySelector(".thread-composer-meta")).not.toBeInTheDocument();
|
||||||
|
expect(screen.getByRole("textbox")).toBe(input);
|
||||||
|
expect(input).toHaveValue("keep this draft");
|
||||||
|
expect(container.querySelector(".thread-composer-footer-actions")).toContainElement(screen.getByLabelText("codex"));
|
||||||
|
expect(screen.getAllByRole("button", { name: "Workspace access mode: Full Access" })).toHaveLength(1);
|
||||||
|
|
||||||
|
width = 320;
|
||||||
|
fireEvent(window, new Event("resize"));
|
||||||
|
expect(form).toHaveAttribute("data-compact-controls", "true");
|
||||||
|
expect(input).toHaveValue("keep this draft");
|
||||||
|
fireEvent.click(screen.getByRole("button", { name: "Send message" }));
|
||||||
|
await waitFor(() => expect(onSend).toHaveBeenCalledWith("keep this draft", undefined, undefined));
|
||||||
|
expect(onWorkspaceScopeChange).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each(["close button", "Escape"])("opens narrow context usage as a bottom sheet and restores interaction after %s", async (dismissal) => {
|
||||||
|
vi.spyOn(HTMLFormElement.prototype, "getBoundingClientRect").mockReturnValue(
|
||||||
|
rect({ width: 390, height: 160 }),
|
||||||
|
);
|
||||||
|
const user = userEvent.setup();
|
||||||
|
const onSend = vi.fn();
|
||||||
|
render(
|
||||||
|
<ThreadComposer
|
||||||
|
onSend={onSend}
|
||||||
|
contextUsage={{ contextTokens: 10000, contextWindowTokens: 200000 }}
|
||||||
|
recentRoundUsage={[{
|
||||||
|
id: "turn-1",
|
||||||
|
timestamp: Date.UTC(2026, 8, 13, 7, 20),
|
||||||
|
inputTokens: 10000,
|
||||||
|
outputTokens: 280,
|
||||||
|
cachedTokens: 8000,
|
||||||
|
}]}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
const trigger = screen.getByTestId("composer-context-usage");
|
||||||
|
await user.click(trigger);
|
||||||
|
const sheet = screen.getByRole("dialog", { name: "Context usage" });
|
||||||
|
expect(sheet).toHaveClass("bottom-0", "max-h-[60dvh]");
|
||||||
|
expect(sheet).toHaveFocus();
|
||||||
|
expect(within(sheet).getByRole("heading", { name: "Context usage" })).toBeVisible();
|
||||||
|
expect(within(sheet).getByText("10K / 200K")).toBeVisible();
|
||||||
|
expect(within(sheet).getByTestId("round-usage-bar")).toBeVisible();
|
||||||
|
expect(sheet).toContainElement(within(sheet).getByRole("group", { name: "Input tokens" }));
|
||||||
|
expect(document.body).toHaveStyle({ pointerEvents: "none" });
|
||||||
|
|
||||||
|
if (dismissal === "Escape") await user.keyboard("{Escape}");
|
||||||
|
else await user.click(within(sheet).getByRole("button", { name: "Close" }));
|
||||||
|
await waitFor(() => expect(screen.queryByRole("dialog")).not.toBeInTheDocument());
|
||||||
|
expect(document.body).not.toHaveStyle({ pointerEvents: "none" });
|
||||||
|
expect(trigger).toHaveFocus();
|
||||||
|
await user.type(screen.getByRole("textbox"), "still works");
|
||||||
|
await user.click(screen.getByRole("button", { name: "Send message" }));
|
||||||
|
expect(onSend).toHaveBeenCalledWith("still works", undefined, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("releases the mobile sheet when resizing to desktop and keeps the desktop popover", async () => {
|
||||||
|
let width = 390;
|
||||||
|
vi.spyOn(HTMLFormElement.prototype, "getBoundingClientRect").mockImplementation(
|
||||||
|
() => rect({ width, height: 160 }),
|
||||||
|
);
|
||||||
|
const user = userEvent.setup();
|
||||||
|
render(<ThreadComposer onSend={vi.fn()} contextUsage={{ contextTokens: 500, contextWindowTokens: 1000 }} />);
|
||||||
|
await user.click(screen.getByTestId("composer-context-usage"));
|
||||||
|
expect(screen.getByRole("dialog")).toHaveClass("bottom-0");
|
||||||
|
|
||||||
|
width = 800;
|
||||||
|
fireEvent(window, new Event("resize"));
|
||||||
|
await waitFor(() => expect(screen.queryByRole("dialog")).not.toBeInTheDocument());
|
||||||
|
expect(document.body).not.toHaveStyle({ pointerEvents: "none" });
|
||||||
|
await user.click(screen.getByTestId("composer-context-usage"));
|
||||||
|
expect(screen.getByRole("dialog", { name: "Context usage" })).not.toHaveClass("bottom-0");
|
||||||
|
expect(screen.getByRole("progressbar", { name: "Context 50%" })).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
it("renders and changes workspace access mode", async () => {
|
it("renders and changes workspace access mode", async () => {
|
||||||
const onWorkspaceScopeChange = vi.fn();
|
const onWorkspaceScopeChange = vi.fn();
|
||||||
render(
|
render(
|
||||||
|
|||||||
Reference in new issue
Block a user