From db8ac52a448907efdd44332312d78be3d1e6a729 Mon Sep 17 00:00:00 2001 From: Clawd Bot Date: Sun, 8 Mar 2026 18:12:10 +0800 Subject: [PATCH 1/3] fix: support token paste on first login (issue #52) --- src/components/LoginScreen.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/LoginScreen.tsx b/src/components/LoginScreen.tsx index 5cdad133..8299d4dd 100644 --- a/src/components/LoginScreen.tsx +++ b/src/components/LoginScreen.tsx @@ -40,9 +40,24 @@ export const LoginScreen: React.FC = () => { } }; - const handleKeyPress = (e: React.KeyboardEvent) => { + const handleKeyPress = async (e: React.KeyboardEvent) => { if (e.key === 'Enter' && !isLoading) { handleConnect(); + return; + } + + // 兼容桌面端首次登录场景下 Ctrl/Cmd + V 无法触发默认粘贴的问题 + if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'v' && !isLoading) { + try { + const text = await navigator.clipboard.readText(); + if (text) { + setToken(text.trim()); + setError(''); + } + } catch (error) { + // 忽略读取剪贴板失败,让浏览器/系统默认行为继续兜底 + console.warn('Clipboard read failed:', error); + } } }; From 6cd279489ac1a86a2209880ec713690c387869e8 Mon Sep 17 00:00:00 2001 From: Clawd Bot Date: Sun, 8 Mar 2026 18:21:23 +0800 Subject: [PATCH 2/3] fix: restore global search shortcuts removed in v0.2.0 flow --- src/components/SearchBar.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index 0b3ecdf8..419a0df2 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'; import { Search, Filter, X, SlidersHorizontal, Monitor, Smartphone, Globe, Terminal, Package, CheckCircle, Bell, BellOff, Apple, Bot } from 'lucide-react'; import { useAppStore } from '../store/useAppStore'; import { AIService } from '../services/aiService'; +import { useSearchShortcuts } from '../hooks/useSearchShortcuts'; export const SearchBar: React.FC = () => { @@ -509,6 +510,23 @@ export const SearchBar: React.FC = () => { const t = (zh: string, en: string) => language === 'zh' ? zh : en; + // 全局快捷键支持(Ctrl/Cmd+K、Ctrl/Cmd+Shift+F、/、Escape) + useSearchShortcuts({ + onFocusSearch: () => { + searchInputRef.current?.focus(); + if (!searchQuery && searchHistory.length > 0) { + setShowSearchHistory(true); + } + }, + onClearSearch: () => { + handleClearSearch(); + searchInputRef.current?.focus(); + }, + onToggleFilters: () => { + setShowFilters(prev => !prev); + }, + }); + return (
{/* Search Input */} From 29227f3e32907c303b1740d0141c9d8b5c057734 Mon Sep 17 00:00:00 2001 From: Clawd Bot Date: Sun, 8 Mar 2026 18:30:16 +0800 Subject: [PATCH 3/3] fix(electron): restore Edit menu shortcuts (copy/paste) in desktop builds --- .github/workflows/build-desktop.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index 265a9ff8..3d0b2c94 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -209,7 +209,7 @@ jobs: ' icon: path.join(__dirname, \\'../build/icon.png\\'),\\n' + ' titleBarStyle: \\'default\\', // 使用默认标题栏,避免重叠问题\\n' + ' show: false,\\n' + - ' autoHideMenuBar: true, // 隐藏菜单栏\\n' + + ' autoHideMenuBar: false, // 显示菜单栏,确保编辑快捷键行为一致\\n' + ' frame: true, // 保持窗口框架\\n' + ' backgroundColor: \\'#ffffff\\', // 设置背景色,避免白屏闪烁\\n' + ' titleBarOverlay: false, // 禁用标题栏覆盖\\n' + @@ -281,9 +281,21 @@ jobs: ' mainWindow.once(\\'ready-to-show\\', () => {\\n' + ' mainWindow.show();\\n' + ' });\\n\\n' + - ' // 提供稳定的 DevTools 入口(生产环境)\\n' + + ' // 提供稳定的菜单与编辑快捷键(生产环境)\\n' + ' const menuTemplate = [\\n' + ' {\\n' + + ' label: \\'Edit\\',\\n' + + ' submenu: [\\n' + + ' { role: \\'undo\\' },\\n' + + ' { role: \\'redo\\' },\\n' + + ' { type: \\'separator\\' },\\n' + + ' { role: \\'cut\\' },\\n' + + ' { role: \\'copy\\' },\\n' + + ' { role: \\'paste\\' },\\n' + + ' { role: \\'selectAll\\' }\\n' + + ' ]\\n' + + ' },\\n' + + ' {\\n' + ' label: \\'View\\',\\n' + ' submenu: [\\n' + ' { role: \\'reload\\' },\\n' +