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

ui: Flamegraph tooltip improvements #2600

Merged
merged 19 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7d6d120
Replaced the node margins with storkes to remove the flickering while…
manojVivek Feb 15, 2023
1721352
Reduced the throttle time and fixed the node margin bug
manojVivek Feb 15, 2023
4b496ee
Tooltip spacing, font size, content truncation tweaks
manojVivek Feb 15, 2023
6ecba34
Merge branch 'main' into flamegraph-tooltip-improvements
manojVivek Feb 15, 2023
e8dfb3b
Updated popper position so that the position is changed only when the…
manojVivek Feb 16, 2023
29f9fbb
Merge branch 'main' into flamegraph-tooltip-improvements
manojVivek Feb 16, 2023
42ce15d
Merge branch 'main' into flamegraph-tooltip-improvements
manojVivek Feb 16, 2023
f87262c
ESLint failures fixed'
manojVivek Feb 16, 2023
c3c74ad
Merge remote-tracking branch 'origin/flamegraph-tooltip-improvements'…
manojVivek Feb 16, 2023
a505e51
Merge remote-tracking branch 'origin/flamegraph-tooltip-improvements'…
manojVivek Feb 16, 2023
225b6f0
Merged origin/main
manojVivek Feb 20, 2023
f26dca0
Tooltip content modified to show all fields always
manojVivek Feb 20, 2023
4d7b57e
Tooltip mouse move perf improvements
manojVivek Feb 21, 2023
e1ac12a
Downgraded tailwind version
manojVivek Feb 21, 2023
694c757
Merge branch 'main' into flamegraph-tooltip-improvements
manojVivek Feb 21, 2023
ba6e42e
Merge remote-tracking branch 'origin/flamegraph-tooltip-improvements'…
manojVivek Feb 21, 2023
dfdb10b
Merge remote-tracking branch 'origin/main' into tailwind-downgrade
manojVivek Feb 21, 2023
9a9c709
Type error fix
manojVivek Feb 21, 2023
f40aba1
Merge remote-tracking branch 'origin/main' into flamegraph-tooltip-im…
manojVivek Feb 21, 2023
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
28 changes: 28 additions & 0 deletions ui/packages/shared/components/src/ConditionalWrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2022 The Parca Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import {ReactNode} from 'react';

interface Props {
condition: boolean;
wrapper: ({children}: {children: ReactNode}) => JSX.Element;
children: JSX.Element;
}

export const ConditionalWrapper = ({condition, wrapper: Wrapper, children}: Props): JSX.Element => {
if (condition) {
return <Wrapper>{children}</Wrapper>;
}

return children;
};
2 changes: 2 additions & 0 deletions ui/packages/shared/components/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import Button, {IconButton} from './Button';
import ButtonGroup from './ButtonGroup';
import Card from './Card';
import {ConditionalWrapper} from './ConditionalWrapper';
import DateTimePicker from './DateTimePicker';
import DateTimeRangePicker, {DateTimeRange} from './DateTimeRangePicker';
import Dropdown from './Dropdown';
Expand All @@ -39,6 +40,7 @@ export {
Button,
ButtonGroup,
Card,
ConditionalWrapper,
DateTimePicker,
DateTimeRange,
DateTimeRangePicker,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2022 The Parca Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

interface Props {
value: string | number | undefined;
displayValue?: string | number | undefined;
}

export const ExpandOnHover = ({value, displayValue}: Props): JSX.Element => {
return (
<div className="relative group w-full">
<div className="text-ellipsis w-full overflow-hidden whitespace-nowrap">
{displayValue ?? value}
</div>
<div className="group-hover:flex hidden absolute -inset-2 max-w-[500px] whitespace-normal h-fit bg-gray-50 dark:bg-gray-900 shadow-[0_0_10px_2px_rgba(0,0,0,0.3)] rounded p-2 break-all">
{value}
</div>
</div>
);
};
Loading