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:
xxxigm
2026-08-27 01:38:19 +07:00
committed by GitHub
parent d0fdbfd655
commit b519ce29ad
4 changed files with 26 additions and 5 deletions
@@ -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([])