Skip to content

Commit 25ee01c

Browse files
posthog[bot]Array
andauthored
feat(code): add hover tooltips to Pin and Archive sidebar buttons (#1557)
Co-authored-by: Array <array@posthog.com>
1 parent d044bac commit 25ee01c

1 file changed

Lines changed: 38 additions & 36 deletions

File tree

  • apps/code/src/renderer/features/sidebar/components/items

apps/code/src/renderer/features/sidebar/components/items/TaskItem.tsx

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -78,48 +78,50 @@ function TaskHoverToolbar({
7878
return (
7979
<span className="hidden shrink-0 items-center gap-0.5 group-hover:flex">
8080
{onTogglePin && (
81-
// biome-ignore lint/a11y/useSemanticElements: Cannot use button inside parent button (SidebarItem)
82-
<span
83-
role="button"
84-
tabIndex={0}
85-
className="flex h-5 w-5 cursor-pointer items-center justify-center rounded text-gray-10 transition-colors hover:bg-gray-4 hover:text-gray-12"
86-
onClick={(e) => {
87-
e.stopPropagation();
88-
onTogglePin();
89-
}}
90-
onKeyDown={(e) => {
91-
if (e.key === "Enter" || e.key === " ") {
92-
e.preventDefault();
81+
<Tooltip content={isPinned ? "Unpin task" : "Pin task"} side="top">
82+
{/* biome-ignore lint/a11y/useSemanticElements: Cannot use button inside parent button (SidebarItem) */}
83+
<span
84+
role="button"
85+
tabIndex={0}
86+
className="flex h-5 w-5 cursor-pointer items-center justify-center rounded text-gray-10 transition-colors hover:bg-gray-4 hover:text-gray-12"
87+
onClick={(e) => {
9388
e.stopPropagation();
9489
onTogglePin();
95-
}
96-
}}
97-
title={isPinned ? "Unpin task" : "Pin task"}
98-
>
99-
<PushPin size={12} weight={isPinned ? "fill" : "regular"} />
100-
</span>
90+
}}
91+
onKeyDown={(e) => {
92+
if (e.key === "Enter" || e.key === " ") {
93+
e.preventDefault();
94+
e.stopPropagation();
95+
onTogglePin();
96+
}
97+
}}
98+
>
99+
<PushPin size={12} weight={isPinned ? "fill" : "regular"} />
100+
</span>
101+
</Tooltip>
101102
)}
102103
{onArchive && (
103-
// biome-ignore lint/a11y/useSemanticElements: Cannot use button inside parent button (SidebarItem)
104-
<span
105-
role="button"
106-
tabIndex={0}
107-
className="flex h-5 w-5 cursor-pointer items-center justify-center rounded text-gray-10 transition-colors hover:bg-gray-4 hover:text-gray-12"
108-
onClick={(e) => {
109-
e.stopPropagation();
110-
onArchive();
111-
}}
112-
onKeyDown={(e) => {
113-
if (e.key === "Enter" || e.key === " ") {
114-
e.preventDefault();
104+
<Tooltip content="Archive task" side="top">
105+
{/* biome-ignore lint/a11y/useSemanticElements: Cannot use button inside parent button (SidebarItem) */}
106+
<span
107+
role="button"
108+
tabIndex={0}
109+
className="flex h-5 w-5 cursor-pointer items-center justify-center rounded text-gray-10 transition-colors hover:bg-gray-4 hover:text-gray-12"
110+
onClick={(e) => {
115111
e.stopPropagation();
116112
onArchive();
117-
}
118-
}}
119-
title="Archive task"
120-
>
121-
<Archive size={12} />
122-
</span>
113+
}}
114+
onKeyDown={(e) => {
115+
if (e.key === "Enter" || e.key === " ") {
116+
e.preventDefault();
117+
e.stopPropagation();
118+
onArchive();
119+
}
120+
}}
121+
>
122+
<Archive size={12} />
123+
</span>
124+
</Tooltip>
123125
)}
124126
</span>
125127
);

0 commit comments

Comments
 (0)