fix: 工具面板/帮助面板同步更新 + 图片上传限制
- 工具面板: 20→29个工具,补齐 web_search/memory_*/session_*/spawn_task/browser_* - 帮助面板: 工具数量21→29,新增人格模式/MCP/Cron/Heartbeat说明,补充/retry等命令 - 图片上传: preload透传完整options,ipc尊重multiple参数,图片选择器限制单文件
This commit is contained in:
+13
-2
@@ -80,9 +80,20 @@ function summarizeResult(toolName: string, result: Record<string, unknown>): str
|
||||
}
|
||||
|
||||
export async function setupIPC(): Promise<void> {
|
||||
ipcMain.handle('dialog:openFile', async (_, options?: { filters?: Array<{ name: string; extensions: string[] }> }) => {
|
||||
ipcMain.handle('dialog:openFile', async (_, options?: { filters?: Array<{ name: string; extensions: string[] }>; properties?: string[]; multiple?: boolean }) => {
|
||||
const dialogProperties: Array<'openFile' | 'multiSelections' | 'openDirectory'> = ['openFile'];
|
||||
if (options?.multiple !== false && !options?.properties?.includes('openFile')) {
|
||||
dialogProperties.push('multiSelections');
|
||||
}
|
||||
if (options?.properties) {
|
||||
for (const p of options.properties) {
|
||||
if (p === 'multiSelections' && !dialogProperties.includes('multiSelections')) {
|
||||
dialogProperties.push('multiSelections');
|
||||
}
|
||||
}
|
||||
}
|
||||
const result = await dialog.showOpenDialog(mainWindow!, {
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
properties: dialogProperties,
|
||||
filters: options?.filters || [{ name: '所有文件', extensions: ['*'] }]
|
||||
});
|
||||
if (result.canceled) return null;
|
||||
|
||||
Reference in New Issue
Block a user