chore(release): v0.3.41
智能体抽屉读 ?open= 上下文、回复链接用抽屉地址;抽屉打开不亮焦点框;语句统计重复 key。 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
78a4d562f0
commit
1ade49fe8e
22 files changed
+62
-33
No files matched your search
@@ -30,16 +30,16 @@ export function useActiveAgentRuns() {
|
||||
|
||||
/** 全局快捷键:Ctrl/⌘+J 切换抽屉(Esc 关闭由抽屉自身处理) */
|
||||
function useAgentHotkey() {
|
||||
const { pathname } = useLocation();
|
||||
const { pathname, search } = useLocation();
|
||||
useEffect(() => {
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.repeat || !isAgentShortcut(e)) return;
|
||||
e.preventDefault();
|
||||
toggleAgentDrawer(pathname);
|
||||
toggleAgentDrawer(pathname, search);
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [pathname]);
|
||||
}, [pathname, search]);
|
||||
}
|
||||
|
||||
/** 全局快捷键 Ctrl/⌘+J(没有界面,挂在 console layout 里一次) */
|
||||
@@ -74,12 +74,12 @@ function CountBadge({ count, className }: { count: number; className?: string })
|
||||
|
||||
/** 侧栏最上方的 Agent 主入口:强调样式(棱镜环),显示进行中会话数 */
|
||||
export function AgentNavEntry({ collapsed = false, onNavigate }: { collapsed?: boolean; onNavigate?: () => void }) {
|
||||
const { pathname } = useLocation();
|
||||
const { pathname, search } = useLocation();
|
||||
const { count, summary } = useActiveAgentRuns();
|
||||
const shortcut = agentShortcutLabel();
|
||||
const activate = () => {
|
||||
onNavigate?.();
|
||||
toggleAgentDrawer(pathname);
|
||||
toggleAgentDrawer(pathname, search);
|
||||
};
|
||||
const title = `智能体(${shortcut})${summary ? `\n${summary}` : ""}`;
|
||||
|
||||
|
||||
@@ -77,6 +77,11 @@ function RootSheet({
|
||||
<SheetContent
|
||||
side="right"
|
||||
className={cn("w-full gap-0 p-0", WIDTH[width], className)}
|
||||
// 打开时焦点落在抽屉本身而不是第一个按钮 / 标签,避免一打开就亮焦点框;Tab 仍从抽屉内开始
|
||||
onOpenAutoFocus={(e) => {
|
||||
e.preventDefault();
|
||||
(e.currentTarget as HTMLElement | null)?.focus({ preventScroll: true });
|
||||
}}
|
||||
onEscapeKeyDown={(e) => {
|
||||
// 有子视图时 Esc 先回到上一层
|
||||
const top = stack.current.at(-1);
|
||||
|
||||
Reference in new issue
Block a user