fix(ui): show the link icon on a linked group until hovered

The unlink icon at rest read as a broken link, not as the linked folder
it marks. Show the link icon and swap to the unlink icon in the danger
color only on hover or keyboard focus, so the row says what it is and
the action appears where the pointer is.
This commit is contained in:
Willie
2026-10-05 18:27:12 +08:00
parent 370b612f33
commit 8b1b4a39d3
+4 -2
View File
@@ -511,9 +511,11 @@ export default function ResourcesPage({ kind }: { kind: Kind }) {
const unlinkButton = (link: SourceLink) => (
<Tooltip content={t('sourceLinks.unlink')}>
<button type="button" className="ss-ib hover:!text-bad focus-visible:!text-bad" aria-label={t('sourceLinks.unlink')}
{/* Reads as the link it is; only hover or focus turns it into the unlink action. */}
<button type="button" className="ss-ib group hover:!text-bad focus-visible:!text-bad" aria-label={t('sourceLinks.unlink')}
onClick={() => setUnlinking(link)}>
<Unlink2 size={16} />
<Link2 size={16} className="group-hover:hidden group-focus-visible:hidden" />
<Unlink2 size={16} className="hidden group-hover:block group-focus-visible:block" />
</button>
</Tooltip>
);