Skip to content

Commit 3a79668

Browse files
author
Laurie T. Malau
committed
Add tooltip to project names
Fixes #5122
1 parent f646642 commit 3a79668

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

components/dashboard/src/components/Tooltip.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useState } from 'react';
99
export interface TooltipProps {
1010
children: React.ReactChild[] | React.ReactChild;
1111
content: string;
12+
allowWrap?: boolean;
1213
}
1314

1415
function Tooltip(props: TooltipProps) {
@@ -20,7 +21,7 @@ function Tooltip(props: TooltipProps) {
2021
{props.children}
2122
</div>
2223
{expanded ?
23-
<div style={{top: '-0.5rem', left: '50%', transform: 'translate(-50%, -100%)'}} className={`mt-2 z-50 py-1 px-2 bg-gray-900 text-gray-100 text-sm absolute flex flex-col border border-gray-200 dark:border-gray-800 rounded-md truncated whitespace-nowrap`}>
24+
<div style={{top: '-0.5rem', left: '50%', transform: 'translate(-50%, -100%)'}} className={`max-w-md mt-2 z-50 py-1 px-2 bg-gray-900 text-gray-100 text-sm absolute flex flex-col border border-gray-200 dark:border-gray-800 rounded-md truncated ` + (props.allowWrap ? 'whitespace-normal' : 'whitespace-nowrap')}>
2425
{props.content}
2526
</div>
2627
:

components/dashboard/src/workspaces/WorkspaceEntry.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export function WorkspaceEntry({ desc, model, isAdmin, stopWorkspace }: Props) {
9191
</ItemFieldIcon>
9292
<ItemField className="w-3/12 flex flex-col">
9393
<a href={startUrl.toString()}><div className="font-medium text-gray-800 dark:text-gray-200 truncate hover:text-blue-600 dark:hover:text-blue-400">{ws.id}</div></a>
94-
<a href={project ? 'https://' + project : undefined}><div className="text-sm overflow-ellipsis truncate text-gray-400 dark:text-gray-500 hover:text-blue-600 dark:hover:text-blue-400">{project || 'Unknown'}</div></a>
94+
<Tooltip content={project ? 'https://' + project : ''} allowWrap={true}>
95+
<a href={project ? 'https://' + project : undefined}><div className="text-sm overflow-ellipsis truncate text-gray-400 dark:text-gray-500 hover:text-blue-600 dark:hover:text-blue-400">{project || 'Unknown'}</div></a>
96+
</Tooltip>
9597
</ItemField>
9698
<ItemField className="w-4/12 flex flex-col">
9799
<div className="text-gray-500 dark:text-gray-400 overflow-ellipsis truncate">{ws.description}</div>

0 commit comments

Comments
 (0)