Skip to content

Commit

Permalink
area/ui: reset the selected_timeframe after a new series is clicked on
Browse files Browse the repository at this point in the history
  • Loading branch information
yomete committed Feb 27, 2025
1 parent 4345892 commit dd1ebca
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ import {AnimatePresence, motion} from 'framer-motion';
import throttle from 'lodash.throttle';
import {useContextMenu} from 'react-contexify';

import {DateTimeRange, MetricsGraphSkeleton, useParcaContext, useURLState} from '@parca/components';
import {
DateTimeRange,
MetricsGraphSkeleton,
useParcaContext,
useURLState,
useURLStateCustom,

Check failure on line 27 in ui/packages/shared/profile/src/MetricsGraph/UtilizationMetrics/index.tsx

View workflow job for this annotation

GitHub Actions / UI Test and Lint

'useURLStateCustom' is defined but never used. Allowed unused vars must match /_/u
} from '@parca/components';
import {Matcher} from '@parca/parser';
import {formatDate, formatForTimespan, getPrecision, valueFormatter} from '@parca/utilities';

Expand Down Expand Up @@ -100,6 +106,7 @@ const RawUtilizationMetrics = ({
const [isContextMenuOpen, setIsContextMenuOpen] = useState<boolean>(false);
const idForContextMenu = useId();
const [selectedSeries, setSelectedSeries] = useURLState<string>('selectedSeries');
const [_, setSelectedTimeframe] = useURLState('gpu_selected_timeframe');

const parsedSelectedSeries: Matcher[] = useMemo(() => {
if (selectedSeries === undefined) {
Expand Down Expand Up @@ -489,6 +496,8 @@ const RawUtilizationMetrics = ({
}))
)
);
// reset the selected_timeframe
setSelectedTimeframe(undefined);
}
}}
/>
Expand Down

0 comments on commit dd1ebca

Please sign in to comment.