Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): update tooltips #1266

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`FilterPill renders correctly 1`] = `
TITLE
</p>
<span
class="pointer-events-none z-50 max-w-xl absolute font-sans text-sm text-white rounded-md p-4 bg-neutral-800 top-8 left-0 w-max opacity-0 transition-opacity group-hover:opacity-100"
class="pointer-events-none z-50 max-w-xl absolute font-sans text-xs text-white rounded-md p-4 bg-neutral-800 left-0 -top-2 transform translate-y-full w-max opacity-0 transition-opacity group-hover:opacity-100"
>
TITLE
</span>
Expand All @@ -31,7 +31,7 @@ exports[`FilterPill renders correctly 1`] = `
TITLE
</p>
<span
class="pointer-events-none z-50 max-w-xl absolute font-sans text-sm text-white rounded-md p-4 bg-neutral-800 top-8 left-0 w-max opacity-0 transition-opacity group-hover:opacity-100"
class="pointer-events-none z-50 max-w-xl absolute font-sans text-xs text-white rounded-md p-4 bg-neutral-800 left-0 -top-2 transform translate-y-full w-max opacity-0 transition-opacity group-hover:opacity-100"
>
TITLE
</span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/dashboard/app/components/filter_pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const FilterPill: React.FC<FilterPillProps> = ({ title }) => {
<p className="px-2 py-1 max-w-72 whitespace-nowrap text-ellipsis overflow-hidden text-white bg-neutral-950 font-display text-sm border border-black rounded-full outline-none transition ease-in-out transition-colors duration-100">
{title}
</p>
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-sm text-white rounded-md p-4 bg-neutral-800 top-8 left-0 w-max opacity-0 transition-opacity group-hover:opacity-100">
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-xs text-white rounded-md p-4 bg-neutral-800 left-0 -top-2 transform translate-y-full w-max opacity-0 transition-opacity group-hover:opacity-100">
{title}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ const InfoCircleAppAdoption = ({ status, noData, value, sessions, totalSessions,
{status === MetricsApiStatus.Success && noData === false && <p className="font-sans text-xl"> {value}%</p>}
{status === MetricsApiStatus.Success && noData === false && <div className="py-1" />}
{status === MetricsApiStatus.Success && noData === false && <p className="font-sans text-sm">{formatter.format(sessions)}/{formatter.format(totalSessions)} sessions</p>}
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-sm text-white rounded-md p-4 bg-neutral-800 -top-28 left-0 w-max opacity-0 transition-opacity group-hover:opacity-100">
Adoption = (Sessions of selected app versions / Sessions of all app versions) * 100
</span>
<div className="pointer-events-none z-50 max-w-xl absolute font-sans text-xs text-white rounded-md p-4 bg-neutral-800 left-0 top-0 transform -translate-y-full -mt-4 w-max opacity-0 transition-opacity group-hover:opacity-100">
<p>Adoption = (Sessions of selected app versions / Sessions of all app versions) * 100</p>
<div className='py-2' />
<p>Selected Sessions = {sessions}</p>
<p>Total Sessions = {totalSessions}</p>
</div>
</div>
<div className="py-2" />
<p className="font-display text-lg">{title}</p>
Expand Down
2 changes: 1 addition & 1 deletion frontend/dashboard/app/components/info_circle_app_size.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const InfoCircleAppSize = ({ status, noData, valueInBytes, deltaInBytes, title }
{status === MetricsApiStatus.Success && noData === false && <p className="font-sans text-xl"> {(valueInBytes / (1024 * 1024)).toPrecision(3)} MB</p>}
{status === MetricsApiStatus.Success && noData === false && <div className="py-1" />}
{status === MetricsApiStatus.Success && noData === false && <p className={`font-sans text-sm ${deltaInBytes < 0 ? 'text-green-600' : deltaInBytes > 0 ? 'text-red-400' : ''}`}>{deltaInBytes > 0 ? '+' : ''}{deltaInBytes === 0 ? 'No change' : (deltaInBytes / (1024 * 1024)).toPrecision(3) + ' MB'}</p>}
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-sm text-white rounded-md p-4 bg-neutral-800 -top-32 left-0 w-max opacity-0 transition-opacity group-hover:opacity-100">
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-xs text-white rounded-md p-4 bg-neutral-800 left-0 top-0 transform -translate-y-full -mt-4 w-max opacity-0 transition-opacity group-hover:opacity-100">
Delta value = App size of selected app version - Average app size of unselected app versions
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const InfoCircleAppStartTime = ({ status, noData, value, delta, title, launchTyp
{status === MetricsApiStatus.Success && noData === false && <p className="font-sans text-xl"> {value}ms</p>}
{status === MetricsApiStatus.Success && noData === false && <div className="py-1" />}
{status === MetricsApiStatus.Success && noData === false && <p className={`font-sans text-sm ${delta > 0 && delta < 1 ? 'text-green-600' : delta > 1 ? 'text-red-400' : ''}`}>{delta > 1 ? `${delta}x slower` : delta > 0 && delta < 1 ? `${delta}x faster` : 'No change'}</p>}
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-sm text-white rounded-md p-4 bg-neutral-800 -top-44 left-0 w-max opacity-0 transition-opacity group-hover:opacity-100">
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-xs text-white rounded-md p-4 bg-neutral-800 left-0 top-0 transform -translate-y-full -mt-4 w-max opacity-0 transition-opacity group-hover:opacity-100">
App start time = p95 {launchType} launch time of selected app versions<br /><br />Delta value = p95 {launchType} launch time of selected app versions / p95 {launchType} launch time of unselected app versions
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const InfoCircleExceptionRate = ({ status, noData, value, delta, title, tooltipM
{status === MetricsApiStatus.Success && noData === false && <p className="font-sans text-xl"> {value}%</p>}
{status === MetricsApiStatus.Success && noData === false && <div className="py-1" />}
{status === MetricsApiStatus.Success && noData === false && <p className={`font-sans text-sm ${delta > 1 ? 'text-green-600' : delta > 0 && delta < 1 ? 'text-red-400' : ''}`}>{delta > 1 ? `${delta}x better` : delta > 0 && delta < 1 ? `${delta}x worse` : 'No change'}</p>}
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-sm text-white rounded-md p-4 bg-neutral-800 -top-48 left-0 w-max opacity-0 transition-opacity group-hover:opacity-100">{tooltipMsgLine1}<br /><br />{tooltipMsgLine2}</span>
<span className="pointer-events-none z-50 max-w-xl absolute font-sans text-xs text-white rounded-md p-4 bg-neutral-800 left-0 top-0 transform -translate-y-full -mt-4 w-max opacity-0 transition-opacity group-hover:opacity-100">{tooltipMsgLine1}<br /><br />{tooltipMsgLine2}</span>
</div>
<div className="py-2" />
<p className="font-display text-lg">{title}</p>
Expand Down