feat: 定时日报支持Windows

This commit is contained in:
电摇小子
2026-09-01 11:36:15 +08:00
parent f65dc4ac32
commit 25b72c3d76
15 changed files with 205 additions and 41 deletions
+7 -7
View File
@@ -39,7 +39,7 @@ import { isRelevantMessageMonitorEvent, parseWcdbMonitorEvent } from './utils/me
import { enrichQuotedMessages } from './utils/quoted-messages'
import type { SelectableReportTemplateId } from '../../shared/report-templates'
import { switchGeneratedReportTemplate } from './utils/report-template-switch'
import { runtimePlatform } from './utils/runtime-environment'
import { runtimePlatform, supportsPersonalWechatSend } from './utils/runtime-environment'
import { useToast } from './components/ui'
import { AppUpdatePrompt } from './features/app-update/AppUpdatePrompt'
import { GroupExitMonitorWorkspace } from './features/group-exit-monitor/GroupExitMonitorWorkspace'
@@ -1783,24 +1783,24 @@ function App(): React.ReactElement {
type="button"
role="tab"
aria-selected={reportSection === 'scheduled'}
aria-disabled={runtimePlatform !== 'darwin'}
className={`${reportSection === 'scheduled' ? 'active' : ''} ${runtimePlatform !== 'darwin' ? 'unsupported' : ''}`}
aria-disabled={!supportsPersonalWechatSend}
className={`${reportSection === 'scheduled' ? 'active' : ''} ${!supportsPersonalWechatSend ? 'unsupported' : ''}`}
onClick={() => {
if (runtimePlatform !== 'darwin') {
toast({ description: '定时日报目前仅支持 macOS。', duration: 3200 })
if (!supportsPersonalWechatSend) {
toast({ description: '定时日报目前仅支持 macOS 和 Windows。', duration: 3200 })
return
}
setReportSection('scheduled')
}}
>
定时日报{runtimePlatform !== 'darwin' && <small>仅 macOS</small>}
定时日报{!supportsPersonalWechatSend && <small>仅 macOS / Windows</small>}
</button>
</div>
<div className="report-workspace-body">
{reportSection === 'scheduled' ? (
<ScheduledReportsWorkspace
contacts={contacts}
platformSupported={runtimePlatform === 'darwin'}
platformSupported={supportsPersonalWechatSend}
onOpenWechatSettings={openWechatSendSettings}
onOpenModelSettings={openModelSettings}
onNotice={(message, variant) =>
@@ -115,7 +115,7 @@ export function ChatHeader({
) : (
<Tooltip>
<TooltipTrigger asChild>
<span tabIndex={0} aria-label="仅支持 macOS">
<span tabIndex={0} aria-label="仅支持 macOS 和 Windows">
<Button
variant="outline"
size="sm"
@@ -129,7 +129,7 @@ export function ChatHeader({
</Button>
</span>
</TooltipTrigger>
<TooltipContent>仅支持 macOS</TooltipContent>
<TooltipContent>仅支持 macOS 和 Windows</TooltipContent>
</Tooltip>
)}
<Button
@@ -80,7 +80,7 @@ export function ReportViewer({
const title = useMemo(() => (report ? `${report.contactName} 群聊日报` : 'AI 日报'), [report])
const sendToGroupHint = !personalWechatSendSupported
? '仅支持 macOS'
? '仅支持 macOS 和 Windows'
: !sendTarget
? '未找到这份日报对应的群聊'
: !report?.pngPath
@@ -106,7 +106,7 @@ const capabilityCopy = (capability: PersonalWechatSendCapability | null): string
case 'ready':
return '✓ 微信发送能力已就绪'
case 'unsupported':
return '微信消息发送目前仅支持 macOS'
return '微信消息发送目前仅支持 macOS 和 Windows'
case 'needs_binding':
case 'unconfigured':
return '请先绑定个人微信'
@@ -127,7 +127,7 @@ const readableError = (error?: string): string => {
const value = String(error || '')
if (value.includes('wechat_not_ready') || value.includes('仅支持 macOS')) {
if (value.includes('unsupported') || value.includes('仅支持'))
return '微信消息发送目前仅支持 macOS'
return '微信消息发送目前仅支持 macOS 和 Windows'
if (value.includes('needs_binding') || value.includes('unconfigured')) return '请先绑定个人微信'
if (value.includes('needs_verification')) return '请先完成微信消息能力检测'
return '微信发送能力不可用,请检查微信连接。'
@@ -576,7 +576,7 @@ export function ScheduledReportsWorkspace({
status: 'unsupported',
capabilities: { text: false, image: false, voice: false },
senderStatus: {} as PersonalWechatSendCapability['senderStatus'],
message: '微信消息发送目前仅支持 macOS'
message: '定时日报目前仅支持 macOS 和 Windows'
})
setTasks([])
setExecutions([])
@@ -367,7 +367,7 @@ export function PersonalWechatSendPage({
<strong className="mt-1 block text-base">{pageMessage}</strong>
<p className="mt-2 text-sm text-muted-foreground">
{pageStatus === 'unsupported' && !isWindows
? '微信消息发送目前仅支持 macOS。'
? '微信消息发送目前仅支持 macOS 和 Windows。'
: isWindows
? 'Windows 通过本机微信发送接口工作,请先配置并检测接口端口。'
: '档案中的文字、图片和语音发送,以及定时日报发送,都会使用这项能力。'}