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

chore(ui): add info icon to describe file and media are not in bytes stored #2764

Merged
merged 11 commits into from
Oct 31, 2024
19 changes: 19 additions & 0 deletions weave-js/src/components/BytesStoredInfoIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import numeral from 'numeral';
import React from 'react';

import {IconInfo} from './Icon';
import {Tailwind} from './Tailwind';
import {Tooltip as WeaveTooltip} from './Tooltip';

export const BytesStoredInfoIcon = ({bytesStored}: {bytesStored: number}) => (
<Tailwind>
<div className="flex items-center">
harukatab marked this conversation as resolved.
Show resolved Hide resolved
{numeral(bytesStored).format('0.0b')}
<WeaveTooltip
content="This does not take into account any files or media logged in this trace."
harukatab marked this conversation as resolved.
Show resolved Hide resolved
placement="top-start"
trigger={<IconInfo className="ml-2 text-moon-500" />}
/>
</div>
</Tailwind>
);
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import numeral from 'numeral';
import React, {useMemo} from 'react';

import {BytesStoredInfoIcon} from '../../../../../BytesStoredInfoIcon';
import {Timestamp} from '../../../../../Timestamp';
import {UserLink} from '../../../../../UserLink';
import {parseRefMaybe, SmallRef} from '../../../Browse2/SmallRef';
Expand Down Expand Up @@ -92,7 +92,9 @@ export const CallSummary: React.FC<{
Latency: span.summary.latency_s.toFixed(3) + 's',
}
: {}),
'Bytes stored': numeral(totalBytesStored).format('0.0b'),
'Bytes stored': (
<BytesStoredInfoIcon bytesStored={totalBytesStored} />
),
...(Object.keys(attributes).length > 0
? {Attributes: attributes}
: {}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Box from '@mui/material/Box';
import {useObjectViewEvent} from '@wandb/weave/integrations/analytics/useViewEvents';
import numeral from 'numeral';
import React, {useMemo} from 'react';

import {maybePluralizeWord} from '../../../../../core/util/string';
import {BytesStoredInfoIcon} from '../../../../BytesStoredInfoIcon';
import {Icon, IconName} from '../../../../Icon';
import {LoadingDots} from '../../../../LoadingDots';
import {Tailwind} from '../../../../Tailwind';
Expand Down Expand Up @@ -249,7 +249,7 @@ const ObjectVersionPageInner: React.FC<{
{data.loading ? (
<LoadingDots />
) : (
numeral(bytesStored).format('0.0b')
<BytesStoredInfoIcon bytesStored={bytesStored} />
)}
</>
),
Expand Down
Loading