fix: hide queue attachment action for messages without attachments
Derive attachment presence from saved queue inputs and only show the preview action when attachments exist. Cover queue metadata and button visibility with regression tests. Release note: Queued messages without attachments no longer show the View attachments button.
This commit is contained in:
@@ -4618,6 +4618,22 @@ describe('AssistantDatabase', () => {
|
||||
}
|
||||
])
|
||||
|
||||
for (const [payload, hasAttachments] of [
|
||||
[{ prompt: 'text' }, false],
|
||||
[{ input: { attachments: [] } }, false],
|
||||
[{ input: { attachments: [{ id: 'attachment' }] } }, true],
|
||||
[{ attachments: [{ id: 'attachment' }] }, true]
|
||||
] as const) {
|
||||
const queued = initial.enqueueConversationUserInput({
|
||||
conversationId,
|
||||
label: 'Attachment visibility',
|
||||
payloadJson: JSON.stringify(payload)
|
||||
})
|
||||
expect(queued.hasAttachments).toBe(hasAttachments)
|
||||
expect(initial.listConversationQueueItems(conversationId)[0]?.hasAttachments).toBe(hasAttachments)
|
||||
initial.cancelConversationQueueItem(queued.id)
|
||||
}
|
||||
|
||||
const first = initial.enqueueConversationUserInput({
|
||||
conversationId,
|
||||
label: '第一条消息',
|
||||
|
||||
Reference in New Issue
Block a user