Click rage has
{item.isIncreased ? 'increased' : 'decreased'} on
{item.name}
diff --git a/frontend/app/components/Session_/Player/Controls/Controls.tsx b/frontend/app/components/Session_/Player/Controls/Controls.tsx
index d6d1d2c9b..bf1f010a7 100644
--- a/frontend/app/components/Session_/Player/Controls/Controls.tsx
+++ b/frontend/app/components/Session_/Player/Controls/Controls.tsx
@@ -386,7 +386,7 @@ export function SummaryButton({
);
}
-const gradientButton = {
+export const gradientButton = {
border: 'double 1px transparent',
borderRadius: '60px',
background:
diff --git a/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx b/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx
index ff721d5c0..ac83aa3bb 100644
--- a/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx
+++ b/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx
@@ -1,19 +1,28 @@
+import { CloseOutlined, EnterOutlined } from '@ant-design/icons';
+import { Tour } from 'antd';
+import { observer } from 'mobx-react-lite';
import React, { useState } from 'react';
import { connect } from 'react-redux';
-import { Input, Icon } from 'UI';
-import FilterModal from 'Shared/Filters/FilterModal';
-import { debounce } from 'App/utils';
+
+import { useStore } from 'App/mstore';
import { assist as assistRoute, isRoute } from 'App/routes';
-import { addFilterByKeyAndValue, fetchFilterSearch, edit, clearSearch } from 'Duck/search';
+import { debounce } from 'App/utils';
import {
addFilterByKeyAndValue as liveAddFilterByKeyAndValue,
fetchFilterSearch as liveFetchFilterSearch,
} from 'Duck/liveSearch';
-import { observer } from 'mobx-react-lite';
-import { useStore } from 'App/mstore';
-import { Segmented } from 'antd';
-import OutsideClickDetectingDiv from 'Shared/OutsideClickDetectingDiv';
-import { EnterOutlined, CloseOutlined } from '@ant-design/icons';
+import {
+ addFilterByKeyAndValue,
+ clearSearch,
+ edit,
+ fetchFilterSearch,
+} from 'Duck/search';
+import { Icon, Input, Toggler as Switch } from 'UI';
+
+import FilterModal from 'Shared/Filters/FilterModal';
+
+import { SwitchToggle } from '../../ui/Toggler/Toggler';
+import OutsideClickDetectingDiv from '../OutsideClickDetectingDiv';
const ASSIST_ROUTE = assistRoute();
@@ -32,7 +41,10 @@ function SessionSearchField(props: Props) {
isRoute(ASSIST_ROUTE, window.location.pathname) ||
window.location.pathname.includes('multiview');
const debounceFetchFilterSearch = React.useCallback(
- debounce(isLive ? props.liveFetchFilterSearch : props.fetchFilterSearch, 1000),
+ debounce(
+ isLive ? props.liveFetchFilterSearch : props.fetchFilterSearch,
+ 1000
+ ),
[]
);
@@ -64,12 +76,14 @@ function SessionSearchField(props: Props) {
onFocus={onFocus}
onBlur={onBlur}
onChange={onSearchChange}
- placeholder={'Search sessions using any captured event (click, input, page, error...)'}
- style={{ minWidth: 360 }}
+ placeholder={
+ 'Search sessions using any captured event (click, input, page, error...)'
+ }
+ style={{ minWidth: 360, height: 33 }}
id="search"
type="search"
autoComplete="off"
- className="text-lg placeholder-lg !border-0 w-full rounded-r-lg focus:!border-0 focus:ring-0"
+ className="px-2 py-1 text-lg placeholder-lg !border-0 rounded-r-lg focus:!border-0 focus:ring-0"
/>
{showModal && (
@@ -86,126 +100,217 @@ function SessionSearchField(props: Props) {
);
}
-const AiSearchField = observer(({ edit, appliedFilter, clearSearch }: Props) => {
- const hasFilters = appliedFilter && appliedFilter.filters && appliedFilter.filters.size > 0;
- const { aiFiltersStore } = useStore();
- const [searchQuery, setSearchQuery] = useState('');
- const debounceAiFetch = React.useCallback(debounce(aiFiltersStore.getSearchFilters, 1000), []);
+const AiSearchField = observer(
+ ({ edit, appliedFilter, clearSearch }: Props) => {
+ const hasFilters =
+ appliedFilter && appliedFilter.filters && appliedFilter.filters.size > 0;
+ const { aiFiltersStore } = useStore();
+ const [searchQuery, setSearchQuery] = useState('');
+ const debounceAiFetch = React.useCallback(
+ debounce(aiFiltersStore.getSearchFilters, 1000),
+ []
+ );
- const onSearchChange = ({ target: { value } }: any) => {
- setSearchQuery(value);
- };
+ const onSearchChange = ({ target: { value } }: any) => {
+ setSearchQuery(value);
+ };
- const fetchResults = () => {
- if (searchQuery) {
- debounceAiFetch(searchQuery);
- }
- };
+ const fetchResults = () => {
+ if (searchQuery) {
+ debounceAiFetch(searchQuery);
+ }
+ };
- const handleKeyDown = (event: any) => {
- if (event.key === 'Enter') {
- fetchResults();
- }
- };
+ const handleKeyDown = (event: any) => {
+ if (event.key === 'Enter') {
+ fetchResults();
+ }
+ };
- const clearAll = () => {
- clearSearch();
- setSearchQuery('');
- };
+ const clearAll = () => {
+ clearSearch();
+ setSearchQuery('');
+ };
- React.useEffect(() => {
- if (aiFiltersStore.filtersSetKey !== 0) {
- console.log('updating filters', aiFiltersStore.filters, aiFiltersStore.filtersSetKey);
- edit(aiFiltersStore.filters);
- }
- }, [aiFiltersStore.filters, aiFiltersStore.filtersSetKey]);
+ React.useEffect(() => {
+ if (aiFiltersStore.filtersSetKey !== 0) {
+ edit(aiFiltersStore.filters);
+ }
+ }, [aiFiltersStore.filters, aiFiltersStore.filtersSetKey]);
- return (
-
-
-
- {hasFilters ?
:
}
+ return (
+
+
+
+ {hasFilters ? : }
+
-
- ) : null
- }
- />
-
- );
-});
+ ) : null
+ }
+ />
+
+ );
+ }
+);
function AiSessionSearchField(props: Props) {
- const [tab, setTab] = useState('search');
- const [isFocused, setIsFocused] = useState(false);
+ const askTourKey = '__or__ask-tour';
+ const tabKey = '__or__tab';
+ const { aiFiltersStore } = useStore();
+ const isTourShown = localStorage.getItem(askTourKey) !== null;
+ const [tab, setTab] = useState(localStorage.getItem(tabKey) || 'search');
+ const [touring, setTouring] = useState(!isTourShown);
+ const askAiRef = React.useRef(null);
- const boxStyle = isFocused ? gradientBox : gradientBoxUnfocused;
+ const closeTour = () => {
+ setTouring(false);
+ localStorage.setItem(askTourKey, 'true');
+ };
+ const changeValue = (v?: string) => {
+ const newTab = v ? v : tab !== 'ask' ? 'ask' : 'search';
+ setTab(newTab);
+ localStorage.setItem(tabKey, newTab);
+ };
return (
-