fix(webui): refine mobile actions and avoid duplicate settings loads
This commit is contained in:
1 parent
f8d655d612
commit
c370e2a5a5
6 files changed
+50
-8
No files matched your search
@@ -432,12 +432,12 @@ function MessageBlockMenu({
|
||||
onViewLinks={links.length > 0 ? () => setLinksShown(true) : undefined}
|
||||
/>;
|
||||
if (mobileActions) {
|
||||
return <div data-message-mobile-actions className={cn("mt-1 flex items-center gap-0.5", message.role === "user" && "justify-end")}>
|
||||
<MessageCopyButton message={message} className="h-11 w-11" />
|
||||
return <div data-message-mobile-actions className={cn("mt-1 flex items-center", message.role === "user" ? "me-2 justify-end" : "-ms-2")}>
|
||||
<MessageCopyButton message={message} className="h-11 w-8 [&_svg]:h-4 [&_svg]:w-4" />
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogTrigger asChild>
|
||||
<button ref={triggerRef} type="button" data-message-block-menu-trigger aria-label={label}
|
||||
className="inline-flex h-11 w-11 items-center justify-center rounded-control text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
||||
className="inline-flex h-11 w-8 items-center justify-center rounded-control text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
||||
<MoreHorizontal className="h-4 w-4" strokeWidth={1.75} aria-hidden />
|
||||
</button>
|
||||
</DialogTrigger>
|
||||
|
||||
@@ -447,6 +447,7 @@ interface ThreadShellProps {
|
||||
workspaceError?: string | null;
|
||||
onWorkspaceScopeChange?: (scope: WorkspaceScopePayload) => void;
|
||||
settingsSnapshot?: SettingsPayload | null;
|
||||
settingsLoading?: boolean;
|
||||
onOpenModelSettings?: () => void;
|
||||
skills?: SkillSummary[];
|
||||
}
|
||||
@@ -657,6 +658,7 @@ export function ThreadShell({
|
||||
workspaceError = null,
|
||||
onWorkspaceScopeChange,
|
||||
settingsSnapshot = null,
|
||||
settingsLoading = false,
|
||||
onOpenModelSettings,
|
||||
skills = [],
|
||||
}: ThreadShellProps) {
|
||||
@@ -1094,8 +1096,8 @@ export function ThreadShell({
|
||||
setSettings(settingsSnapshot);
|
||||
return;
|
||||
}
|
||||
void refreshModelSettings();
|
||||
}, [refreshModelSettings, settingsSnapshot]);
|
||||
if (!settingsLoading) void refreshModelSettings();
|
||||
}, [refreshModelSettings, settingsLoading, settingsSnapshot]);
|
||||
|
||||
useEffect(() => {
|
||||
return client.onRuntimeModelUpdate(() => {
|
||||
|
||||
@@ -312,6 +312,7 @@ export function WorkspaceAccessMenu({
|
||||
onChange?: (scope: WorkspaceScopePayload) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const dismissedByPointerRef = useRef(false);
|
||||
const mode = scope.access_mode;
|
||||
const isFull = mode === "full";
|
||||
const accessLabel = t(
|
||||
@@ -358,7 +359,15 @@ export function WorkspaceAccessMenu({
|
||||
<ChevronDown className={cn("thread-composer-access-chevron ml-1.5 shrink-0", isHero ? "h-3 w-3" : "h-3 w-3")} />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start" className="w-56">
|
||||
<DropdownMenuContent
|
||||
align="start"
|
||||
className="w-56"
|
||||
onPointerDownOutside={() => { dismissedByPointerRef.current = true; }}
|
||||
onCloseAutoFocus={(event) => {
|
||||
if (dismissedByPointerRef.current) event.preventDefault();
|
||||
dismissedByPointerRef.current = false;
|
||||
}}
|
||||
>
|
||||
<AccessMenuItem
|
||||
icon={<Hand className="h-4 w-4" />}
|
||||
label={t("thread.composer.workspace.default")}
|
||||
|
||||
Reference in new issue
Block a user