fix(desktop): keep attachment close and code copy icons visible (#95611)
* fix(desktop): keep attachment close and code copy icons visible Hover-only opacity-0 hid the composer remove control and code-block copy button, so they stayed clickable but invisible on Windows and other no-hover surfaces. * test(desktop): pin attachment close and code copy visibility at rest The remove chip and code-block copy control must stay in the tree without a hover class, so Windows and no-hover surfaces cannot hide them again.
This commit is contained in:
@@ -236,6 +236,18 @@ describe('AttachmentList', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('shows the remove control at rest and does not hide it behind hover', async () => {
|
||||
const onRemove = vi.fn()
|
||||
|
||||
await renderWithI18n(<AttachmentList attachments={[makeAttachment('a', 'doc.pdf')]} onRemove={onRemove} />)
|
||||
|
||||
const remove = screen.getByRole('button', { name: 'Remove doc.pdf' })
|
||||
|
||||
expect(remove.className.split(/\s+/)).not.toContain('opacity-0')
|
||||
fireEvent.click(remove)
|
||||
expect(onRemove).toHaveBeenCalledWith('a')
|
||||
})
|
||||
|
||||
it('still routes a non-image attachment to the preview rail', async () => {
|
||||
$previewTabs.set([])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user