Skip to content

Commit 3613888

Browse files
Tooltips for workspace and threads (#4500)
* Tooltips for workspace and threads * refactor tooltips * add comp on desktop only * dev
1 parent f6f5667 commit 3613888

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

.github/workflows/dev-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ concurrency:
66

77
on:
88
push:
9-
branches: ['agentic-streaming'] # put your current branch to create a build. Core team only.
9+
branches: ['4499-tooltips'] # put your current branch to create a build. Core team only.
1010
paths-ignore:
1111
- '**.md'
1212
- 'cloud-deployments/*'

frontend/src/components/Sidebar/ActiveWorkspaces/ThreadContainer/ThreadItem/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ export default function ThreadItem({
9191
href={
9292
window.location.pathname === linkTo || ctrlPressed ? "#" : linkTo
9393
}
94+
data-tooltip-id="workspace-thread-name"
95+
data-tooltip-content={thread.name}
9496
className="w-full pl-2 py-1 overflow-hidden"
9597
aria-current={isActive ? "page" : ""}
9698
>

frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ export default function ActiveWorkspaces() {
106106
? null
107107
: paths.workspace.chat(workspace.slug)
108108
}
109+
data-tooltip-id="workspace-name"
110+
data-tooltip-content={workspace.name}
109111
aria-current={isActive ? "page" : ""}
110112
className={`
111113
transition-all duration-[200ms]

frontend/src/components/Sidebar/index.jsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import paths from "@/utils/paths";
1313
import { useTranslation } from "react-i18next";
1414
import { useSidebarToggle, ToggleSidebarButton } from "./SidebarToggle";
1515
import SearchBox from "./SearchBox";
16+
import { Tooltip } from "react-tooltip";
17+
import { createPortal } from "react-dom";
1618

1719
export default function Sidebar() {
1820
const { user } = useUser();
@@ -24,7 +26,6 @@ export default function Sidebar() {
2426
showModal: showNewWsModal,
2527
hideModal: hideNewWsModal,
2628
} = useNewWorkspaceModal();
27-
const { t } = useTranslation();
2829

2930
return (
3031
<>
@@ -72,6 +73,7 @@ export default function Sidebar() {
7273
</div>
7374
{showingNewWsModal && <NewWorkspaceModal hideModal={hideNewWsModal} />}
7475
</div>
76+
<WorkspaceAndThreadTooltips />
7577
</>
7678
);
7779
}
@@ -87,7 +89,6 @@ export function SidebarMobileHeader() {
8789
hideModal: hideNewWsModal,
8890
} = useNewWorkspaceModal();
8991
const { user } = useUser();
90-
const { t } = useTranslation();
9192

9293
useEffect(() => {
9394
// Darkens the rest of the screen
@@ -203,3 +204,23 @@ function NewWorkspaceButton({ user, showNewWsModal }) {
203204
</div>
204205
);
205206
}
207+
208+
function WorkspaceAndThreadTooltips() {
209+
return createPortal(
210+
<React.Fragment>
211+
<Tooltip
212+
id="workspace-name"
213+
place="right"
214+
delayShow={800}
215+
className="tooltip !text-xs z-99"
216+
/>
217+
<Tooltip
218+
id="workspace-thread-name"
219+
place="right"
220+
delayShow={800}
221+
className="tooltip !text-xs z-99"
222+
/>
223+
</React.Fragment>,
224+
document.body
225+
);
226+
}

0 commit comments

Comments
 (0)