fix(workspace): 创作工作台 - 修复线上样式层级并优化 Agent、菜单与素材密度
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Button } from "antd";
|
||||
import { Button, ConfigProvider } from "antd";
|
||||
import { RotateCcw } from "lucide-react";
|
||||
import type { ReactNode } from "react";
|
||||
import { useState, type ReactNode } from "react";
|
||||
|
||||
/** 内容库的浏览控件,不复用后台表格的筛选外框。 */
|
||||
export function CollectionToolbar({ children, trailing, active, onReset, label = "搜索与筛选" }: {
|
||||
@@ -10,8 +10,23 @@ export function CollectionToolbar({ children, trailing, active, onReset, label =
|
||||
onReset?: () => void;
|
||||
label?: string;
|
||||
}) {
|
||||
return <section className="collection-toolbar" aria-label={label}>
|
||||
<div className="collection-toolbar-controls">{children}</div>
|
||||
const [inputModality, setInputModality] = useState<"keyboard" | "pointer">("keyboard");
|
||||
|
||||
return <section
|
||||
className="collection-toolbar"
|
||||
aria-label={label}
|
||||
data-input-modality={inputModality}
|
||||
onPointerDownCapture={() => setInputModality("pointer")}
|
||||
onKeyDownCapture={(event) => {
|
||||
if (!event.altKey && !event.ctrlKey && !event.metaKey) setInputModality("keyboard");
|
||||
}}
|
||||
onBlurCapture={(event) => {
|
||||
if (!event.currentTarget.contains(event.relatedTarget)) setInputModality("keyboard");
|
||||
}}
|
||||
>
|
||||
<ConfigProvider select={{ variant: "filled", classNames: { popup: { root: "workspace-quiet-popup" } } }}>
|
||||
<div className="collection-toolbar-controls">{children}</div>
|
||||
</ConfigProvider>
|
||||
<div className="collection-toolbar-actions">
|
||||
{active && onReset ? <Button type="text" icon={<RotateCcw />} onClick={onReset}>重置</Button> : null}
|
||||
{trailing}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.workspace-account-popover .ant-popover-container { padding: 6px; border: 0 !important; border-radius: 20px; background: var(--user-surface-raised) !important; box-shadow: none !important; }
|
||||
.workspace-account-popover .ant-popover-container { padding: var(--space-2); }
|
||||
.workspace-account-popover .workspace-topbar-account-menu { width: auto; min-width: 0; padding: 0; }
|
||||
.workspace-account-card { width: min(304px, calc(100vw - 48px)); color: var(--user-ink); padding: 12px; }
|
||||
.workspace-account-card-identity { display: flex; align-items: center; gap: 12px; padding: 4px 0 16px; }
|
||||
@@ -8,7 +8,7 @@
|
||||
.workspace-account-card-identity strong { font-size: 15px; line-height: 24px; }
|
||||
.workspace-account-card-identity span { color: var(--user-ink-muted); font-size: 12px; }
|
||||
.workspace-account-card-identity em { font-style: normal; font-size: 10px; padding: 4px 8px; border-radius: 999px; background: var(--user-surface-muted); color: var(--user-ink-muted); }
|
||||
.workspace-account-card-wallet { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px; margin-bottom: 12px; border-radius: 16px; background: linear-gradient(120deg, var(--user-accent-soft), color-mix(in srgb, var(--product-accent-blue) 10%, var(--user-surface))); }
|
||||
.workspace-account-card-wallet { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px; margin-bottom: 12px; border-radius: var(--user-radius-card); background: var(--user-surface-muted); }
|
||||
.workspace-account-card-balance > span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--user-ink-muted); }
|
||||
.workspace-account-card-balance strong { display: block; margin-top: 4px; font-size: 26px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
|
||||
.workspace-account-card-wallet > button { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--user-accent); white-space: nowrap; padding: 6px 0; }
|
||||
|
||||
@@ -27,6 +27,7 @@ export function WorkspaceAccountMenu() {
|
||||
<><Popover
|
||||
trigger="click"
|
||||
placement="bottomRight"
|
||||
arrow={false}
|
||||
rootClassName="workspace-account-popover"
|
||||
open={menuOpen}
|
||||
onOpenChange={setMenuOpen}
|
||||
|
||||
@@ -81,7 +81,7 @@ function WorkspaceSidebarProfile({ collapsed, user }: { collapsed: boolean; user
|
||||
<WorkspaceSidebarCheckin collapsed={collapsed} />
|
||||
<WorkspaceSidebarStorageMeter collapsed={collapsed} />
|
||||
<div className={cn("app-workspace-sidebar-profile-row", collapsed && "is-collapsed")}>
|
||||
<Popover open={menuOpen} onOpenChange={setMenuOpen} trigger="click" placement="topLeft" rootClassName="workspace-account-popover" content={content}>
|
||||
<Popover open={menuOpen} onOpenChange={setMenuOpen} trigger="click" placement="topLeft" arrow={false} rootClassName="workspace-account-popover" content={content}>
|
||||
<button type="button" className={cn("app-workspace-sidebar-profile", collapsed && "is-collapsed")} aria-label="打开账户菜单" title={profileName}>
|
||||
<span className="app-workspace-sidebar-profile-avatar">{avatar}</span>
|
||||
{!collapsed ? <span className="app-workspace-sidebar-profile-copy"><strong>{profileName}</strong><span>创作工作台</span></span> : null}
|
||||
|
||||
Reference in New Issue
Block a user