fix(chat): allow all files in attachment picker
This commit is contained in:
@@ -514,11 +514,7 @@ describe('ContextManager', () => {
|
||||
})
|
||||
expect(showOpenDialog).toHaveBeenCalledWith(
|
||||
expect.anything(),
|
||||
expect.objectContaining({
|
||||
filters: expect.arrayContaining([
|
||||
expect.objectContaining({ name: '图片' })
|
||||
])
|
||||
})
|
||||
{ properties: ['openFile', 'multiSelections'] }
|
||||
)
|
||||
})
|
||||
|
||||
@@ -555,19 +551,7 @@ describe('ContextManager', () => {
|
||||
})
|
||||
expect(showOpenDialog).toHaveBeenCalledWith(
|
||||
expect.anything(),
|
||||
expect.objectContaining({
|
||||
filters: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
name: 'PDF 和 Office 文档',
|
||||
extensions: expect.arrayContaining([
|
||||
'docx',
|
||||
'pdf',
|
||||
'pptx',
|
||||
'xlsx'
|
||||
])
|
||||
})
|
||||
])
|
||||
})
|
||||
{ properties: ['openFile', 'multiSelections'] }
|
||||
)
|
||||
expect(onProgress.mock.calls.map(([progress]) => { const { operationId, ...rest } = progress; expect(operationId).toEqual(expect.any(String)); return rest })).toEqual([
|
||||
{
|
||||
|
||||
@@ -329,27 +329,7 @@ export class ContextManager {
|
||||
conversationId?: string
|
||||
): Promise<ContextAttachment[]> {
|
||||
const result = await dialog.showOpenDialog(window, {
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
filters: [
|
||||
{
|
||||
name: '文本、代码和配置文件',
|
||||
extensions: [...supportedExtensions].map((extension) =>
|
||||
extension.slice(1)
|
||||
)
|
||||
},
|
||||
{
|
||||
name: '图片',
|
||||
extensions: [...supportedImageExtensions].map((extension) =>
|
||||
extension.slice(1)
|
||||
)
|
||||
},
|
||||
{
|
||||
name: 'PDF 和 Office 文档',
|
||||
extensions: [...supportedDocumentExtensions].map((extension) =>
|
||||
extension.slice(1)
|
||||
)
|
||||
}
|
||||
]
|
||||
properties: ['openFile', 'multiSelections']
|
||||
})
|
||||
if (result.canceled) {
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user