search ui: permanently enable simple ui (but keep temp setting) (#41021)

* changes

* update changelog

* fix unit tests

* fix ts build

* rename temp setting so users that have turned it off get the new UI

* fix broken merge

* remove unneeded stories and add stories for new UI

* fix test
This commit is contained in:
Juliana Peña 2022-09-02 15:53:01 -07:00 committed by GitHub
parent 2131ce10cc
commit e84daee944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 127 additions and 623 deletions

View File

@ -17,7 +17,7 @@ All notable changes to Sourcegraph are documented in this file.
### Added
-
- A new look for Sourcegraph, previously in beta as "Simple UI", is now permanently enabled. [#41021](https://github.com/sourcegraph/sourcegraph/pull/41021)
### Changed
@ -34,6 +34,7 @@ All notable changes to Sourcegraph are documented in this file.
### Removed
- `CACHE_DIR` has been removed from the `sourcegraph-frontend` deployment. This required ephemeral storage which will no longer be needed. This variable (and corresponding filesystem mount) has been unused for many releases. [#38934](https://github.com/sourcegraph/sourcegraph/issues/38934)
- Quick links will no longer be shown on the homepage or search sidebar. The `quicklink` setting is now marked as deprecated. [#40750](https://github.com/sourcegraph/sourcegraph/pull/40750)
- Quick links will no longer be shown on the homepage or search sidebar if the "Simple UI" toggle is enabled and will be removed entirely in a future release. The `quicklink` setting is now marked as deprecated. [#40750](https://github.com/sourcegraph/sourcegraph/pull/40750)
- `file:contains()` has been removed from the list of valid predicates. `file:has.content()` and `file:contains.content()` remain, both of which work the same as `file:contains()` and are valid aliases of each other.
- The single-container `sourcegraph/server` deployment no longer bundles a Jaeger instance. [#41244](https://github.com/sourcegraph/sourcegraph/pull/41244)

View File

@ -24,22 +24,6 @@ exports[`<HierarchicalLocationsView /> displays a single location when complete
class="header"
id="result-container-0"
>
<svg
aria-label="content result"
class="mdi-icon mdi-icon iconInline flex-shrink-0"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z"
/>
</svg>
<div
class="mx-1 headerDivider"
/>
<svg
aria-label="github.com"
class="mdi-icon iconInline text-muted flex-shrink-0 mr-1"
@ -59,7 +43,7 @@ exports[`<HierarchicalLocationsView /> displays a single location when complete
data-testid="result-container-header"
>
<div
class="titleInner"
class="titleInner mutedRepoFileLink"
>
<a
class="anchorLink"
@ -84,16 +68,9 @@ exports[`<HierarchicalLocationsView /> displays a single location when complete
class="ml-2 headerDescription"
/>
</div>
<span
class="d-flex align-items-center"
>
<small>
1 match
</small>
</span>
</div>
<div
class=""
class="collapsibleResults"
>
<div>
<div
@ -268,22 +245,6 @@ exports[`<HierarchicalLocationsView /> displays multiple locations grouped by fi
class="header"
id="result-container-0"
>
<svg
aria-label="content result"
class="mdi-icon mdi-icon iconInline flex-shrink-0"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z"
/>
</svg>
<div
class="mx-1 headerDivider"
/>
<svg
aria-label="github.com"
class="mdi-icon iconInline text-muted flex-shrink-0 mr-1"
@ -303,7 +264,7 @@ exports[`<HierarchicalLocationsView /> displays multiple locations grouped by fi
data-testid="result-container-header"
>
<div
class="titleInner"
class="titleInner mutedRepoFileLink"
>
<a
class="anchorLink"
@ -330,16 +291,9 @@ exports[`<HierarchicalLocationsView /> displays multiple locations grouped by fi
class="ml-2 headerDescription"
/>
</div>
<span
class="d-flex align-items-center"
>
<small>
2 matches
</small>
</span>
</div>
<div
class=""
class="collapsibleResults"
>
<div>
<div
@ -460,22 +414,6 @@ exports[`<HierarchicalLocationsView /> displays partial locations before complet
class="header"
id="result-container-0"
>
<svg
aria-label="content result"
class="mdi-icon mdi-icon iconInline flex-shrink-0"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z"
/>
</svg>
<div
class="mx-1 headerDivider"
/>
<svg
aria-label="github.com"
class="mdi-icon iconInline text-muted flex-shrink-0 mr-1"
@ -495,7 +433,7 @@ exports[`<HierarchicalLocationsView /> displays partial locations before complet
data-testid="result-container-header"
>
<div
class="titleInner"
class="titleInner mutedRepoFileLink"
>
<a
class="anchorLink"
@ -520,16 +458,9 @@ exports[`<HierarchicalLocationsView /> displays partial locations before complet
class="ml-2 headerDescription"
/>
</div>
<span
class="d-flex align-items-center"
>
<small>
1 match
</small>
</span>
</div>
<div
class=""
class="collapsibleResults"
>
<div>
<div

View File

@ -261,6 +261,7 @@ export const ResultContainer: React.FunctionComponent<React.PropsWithChildren<Re
expanded && styles.toggleMatchesButtonExpanded
)}
onClick={toggle}
data-testid="toggle-matches-container"
>
<Icon aria-hidden={true} svgPath={expanded ? mdiChevronUp : mdiChevronDown} />
<span className={styles.toggleMatchesButtonText}>

View File

@ -2,8 +2,7 @@ import { Meta, Story } from '@storybook/react'
import { spy } from 'sinon'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'
import { MockTemporarySettings } from '@sourcegraph/shared/src/settings/temporary/testUtils'
import { H1, H2 } from '@sourcegraph/wildcard'
import { H2 } from '@sourcegraph/wildcard'
import { StreamingProgress } from './StreamingProgress'
@ -305,20 +304,6 @@ const render = () => (
</>
)
export const StreamingProgressStory: Story = () => (
<BrandedStory>
{() => (
<>
{render()}
<MockTemporarySettings settings={{ 'coreWorkflowImprovements.enabled': true }}>
<>
<H1>With simple UI enabled</H1>
{render()}
</>
</MockTemporarySettings>
</>
)}
</BrandedStory>
)
export const StreamingProgressStory: Story = () => <BrandedStory>{() => <>{render()}</>}</BrandedStory>
StreamingProgressStory.storyName = 'StreamingProgress'

View File

@ -19,18 +19,6 @@ describe('StreamingProgressSkippedButton', () => {
})
})
it('should not show if no skipped items', () => {
const progress: Progress = {
durationMs: 0,
matchCount: 0,
skipped: [],
}
renderWithBrandedContext(<StreamingProgressSkippedButton progress={progress} onSearchAgain={sinon.spy()} />)
expect(screen.queryByTestId('streaming-progress-skipped')).not.toBeInTheDocument()
expect(screen.queryByTestId('streaming-progress-skipped-popover')).not.toBeInTheDocument()
})
it('should be in info state with only info items', () => {
const progress: Progress = {
durationMs: 1500,

View File

@ -2,6 +2,16 @@
exports[`StreamingProgressSkippedPopover should render correctly 1`] = `
<DocumentFragment>
<p
class="mx-3 mt-3"
>
Found 2 results from 2 repositories.
</p>
<h3
class="h3 mx-3"
>
Some results skipped:
</h3>
<div
class="pt-2 w-100 streamingSkippedItem streamingSkippedItemWarn"
>

View File

@ -28,7 +28,7 @@ export const SidebarButtonStrip: React.FunctionComponent<{ className?: string }>
)
return (
<div className={classNames(styles.strip, className)}>
<div role="tablist" className={classNames(styles.strip, className)}>
{tabs.map(({ tab, icon, name }) => (
<Tooltip key={tab} content={name} placement="left">
<Button

View File

@ -575,6 +575,9 @@ export function streamComputeQuery(query: string): Observable<string[]> {
allData.push(event.data)
observer.next(allData)
},
onerror(event) {
observer.error(event)
},
}).then(
() => observer.complete(),
error => observer.error(error)

View File

@ -9,14 +9,14 @@ import { useTemporarySetting, UseTemporarySettingsReturnType } from './temporary
// Otherwise, each component would evaluate `useTemporarySetting` on their own leading to UI jitter while the
// temporary setting was "loading".
export const CoreWorkflowImprovementsEnabledContext = createContext<
UseTemporarySettingsReturnType<'coreWorkflowImprovements.enabled'>
>([false, noop, 'initial'])
UseTemporarySettingsReturnType<'coreWorkflowImprovements.enabled_deprecated'>
>([true, noop, 'initial'])
CoreWorkflowImprovementsEnabledContext.displayName = 'CoreWorkflowImprovementsContext'
export const CoreWorkflowImprovementsEnabledProvider: React.FunctionComponent<React.PropsWithChildren<{}>> = ({
children,
}) => {
const coreWorkflowImprovementsEnabled = useTemporarySetting('coreWorkflowImprovements.enabled')
const coreWorkflowImprovementsEnabled = useTemporarySetting('coreWorkflowImprovements.enabled_deprecated', true)
return (
<CoreWorkflowImprovementsEnabledContext.Provider value={coreWorkflowImprovementsEnabled}>

View File

@ -35,7 +35,6 @@ export interface TemporarySettingsSchema {
'codeintel.referencePanel.redesign.ctaDismissed': boolean
'codeintel.referencePanel.redesign.enabled': boolean
'onboarding.quickStartTour': TourListState
'coreWorkflowImprovements.enabled': boolean
'characterKeyShortcuts.enabled': boolean
'search.homepage.queryExamplesContent': {
lastCachedTimestamp: string
@ -44,6 +43,9 @@ export interface TemporarySettingsSchema {
author: string
}
'search.results.collapseLuckySearch': boolean
// TODO #41002: Remove this temporary setting.
// This temporary setting is now turned on by default with no UI to toggle it off.
'coreWorkflowImprovements.enabled_deprecated': boolean
}
/**

View File

@ -3,6 +3,6 @@ import { useContext } from 'react'
import { CoreWorkflowImprovementsEnabledContext } from './CoreWorkflowImprovementsEnabledProvider'
import { UseTemporarySettingsReturnType } from './temporary/useTemporarySetting'
export function useCoreWorkflowImprovementsEnabled(): UseTemporarySettingsReturnType<'coreWorkflowImprovements.enabled'> {
export function useCoreWorkflowImprovementsEnabled(): UseTemporarySettingsReturnType<'coreWorkflowImprovements.enabled_deprecated'> {
return useContext(CoreWorkflowImprovementsEnabledContext)
}

View File

@ -53,6 +53,17 @@ if (!document.body.classList.contains('theme-dark')) {
document.body.classList.add('theme-light')
}
// Default to light theme for Chromatic and "Open canvas in new tab" button.
// addon-dark-mode will override this if it's running.
if (!document.body.classList.contains('theme-dark')) {
document.body.classList.add('theme-light')
}
// Always add class for coreWorkflowImprovements.enabled in Chromatic
if (!document.body.classList.contains('core-workflow-improvements-enabled')) {
document.body.classList.add('core-workflow-improvements-enabled')
}
if (isChromatic()) {
const style = document.createElement('style')
style.innerHTML = `

View File

@ -17,7 +17,8 @@ export type FeatureFlagName =
| 'search-aggregation-filters'
| 'disable-proactive-insight-aggregation'
| 'ab-lucky-search' // To be removed at latest by 12/2022.
| 'search-input-hide-history'
| 'search-input-show-history'
| 'user-management-disabled'
interface OrgFlagOverride {
orgID: string

View File

@ -3,11 +3,8 @@ import React, { useCallback, useMemo } from 'react'
import { mdiChevronDown, mdiChevronUp, mdiOpenInNew } from '@mdi/js'
import { Shortcut } from '@slimsag/react-shortcuts'
import classNames from 'classnames'
// eslint-disable-next-line no-restricted-imports
import { Toggle } from '@sourcegraph/branded/src/components/Toggle'
import { useKeyboardShortcut } from '@sourcegraph/shared/src/keyboardShortcuts/useKeyboardShortcut'
import { useCoreWorkflowImprovementsEnabled } from '@sourcegraph/shared/src/settings/useCoreWorkflowImprovementsEnabled'
import { ThemeProps } from '@sourcegraph/shared/src/theme'
import {
Menu,
@ -23,7 +20,6 @@ import {
Select,
Icon,
Badge,
ProductStatusBadge,
} from '@sourcegraph/wildcard'
import { AuthenticatedUser } from '../auth'
@ -75,8 +71,6 @@ export const UserNavItem: React.FunctionComponent<React.PropsWithChildren<UserNa
onThemePreferenceChange(themePreference === ThemePreference.Dark ? ThemePreference.Light : ThemePreference.Dark)
}, [onThemePreferenceChange, themePreference])
const [coreWorkflowImprovementsEnabled, setCoreWorkflowImprovementsEnabled] = useCoreWorkflowImprovementsEnabled()
// Target ID for tooltip
const targetID = 'target-user-avatar'
const [isOpenBetaEnabled] = useFeatureFlag('open-beta-enabled')
@ -171,17 +165,6 @@ export const UserNavItem: React.FunctionComponent<React.PropsWithChildren<UserNa
</div>
)}
</div>
<div className="px-2 py-1">
<div className="d-flex align-items-center justify-content-between">
<div className="mr-2">
Simple UI <ProductStatusBadge status="beta" className="ml-1" />
</div>
<Toggle
value={coreWorkflowImprovementsEnabled}
onToggle={setCoreWorkflowImprovementsEnabled}
/>
</div>
</div>
{!isOpenBetaEnabled && props.authenticatedUser.organizations.nodes.length > 0 && (
<>
<MenuDivider className={styles.dropdownDivider} />

View File

@ -117,46 +117,22 @@ function getMocks({
]
}
export const CloudWithPanels: Story = () => (
export const CloudAuthedHome: Story = () => (
<WebStory>
{webProps => {
useExperimentalFeatures.setState({ showEnterpriseHomePanels: true })
return (
<MockedTestProvider
mocks={getMocks({
enableSavedSearches: false,
enableCollaborators: false,
})}
>
<SearchPage {...defaultProps(webProps)} isSourcegraphDotCom={true} />
</MockedTestProvider>
)
}}
{webProps => (
<MockedTestProvider
mocks={getMocks({
enableSavedSearches: false,
enableCollaborators: false,
})}
>
<SearchPage {...defaultProps(webProps)} isSourcegraphDotCom={true} />
</MockedTestProvider>
)}
</WebStory>
)
CloudWithPanels.storyName = 'Cloud with panels'
export const CloudWithPanelsAndCollaborators: Story = () => (
<WebStory>
{webProps => {
useExperimentalFeatures.setState({ showEnterpriseHomePanels: true })
useExperimentalFeatures.setState({ homepageUserInvitation: true })
return (
<MockedTestProvider
mocks={getMocks({
enableSavedSearches: false,
enableCollaborators: true,
})}
>
<SearchPage {...defaultProps(webProps)} isSourcegraphDotCom={true} />
</MockedTestProvider>
)
}}
</WebStory>
)
CloudWithPanelsAndCollaborators.storyName = 'Cloud with panels and collaborators'
CloudAuthedHome.storyName = 'Cloud authenticated home'
export const CloudMarketingHome: Story = () => (
<WebStory>
@ -170,22 +146,19 @@ export const CloudMarketingHome: Story = () => (
CloudMarketingHome.storyName = 'Cloud marketing home'
export const ServerWithPanels: Story = () => (
export const ServerHome: Story = () => (
<WebStory>
{webProps => {
useExperimentalFeatures.setState({ showEnterpriseHomePanels: true })
return (
<MockedTestProvider
mocks={getMocks({
enableSavedSearches: true,
enableCollaborators: false,
})}
>
<SearchPage {...defaultProps(webProps)} />
</MockedTestProvider>
)
}}
{webProps => (
<MockedTestProvider
mocks={getMocks({
enableSavedSearches: true,
enableCollaborators: false,
})}
>
<SearchPage {...defaultProps(webProps)} />
</MockedTestProvider>
)}
</WebStory>
)
ServerWithPanels.storyName = 'Server with panels'
ServerHome.storyName = 'Server home'

View File

@ -76,11 +76,11 @@ export const SearchPageInput: React.FunctionComponent<React.PropsWithChildren<Pr
features => features.applySearchQuerySuggestionOnEnter ?? false
)
const [coreWorkflowImprovementsEnabled] = useCoreWorkflowImprovementsEnabled()
const [hideSearchHistory] = useFeatureFlag('search-input-hide-history')
const [showSearchHistory] = useFeatureFlag('search-input-show-history')
const suggestionSources = useMemo(
() =>
coreWorkflowImprovementsEnabled && props.authenticatedUser && !hideSearchHistory
coreWorkflowImprovementsEnabled && props.authenticatedUser && showSearchHistory
? [
searchQueryHistorySource({
userId: props.authenticatedUser.id,
@ -99,7 +99,7 @@ export const SearchPageInput: React.FunctionComponent<React.PropsWithChildren<Pr
props.authenticatedUser,
props.selectedSearchContextSpec,
props.telemetryService,
hideSearchHistory,
showSearchHistory,
]
)

View File

@ -124,22 +124,6 @@ export const NoResults: Story = () => {
NoResults.storyName = 'no results'
export const SearchWithQuotes: Story = () => {
useNavbarQueryState.setState({ searchQueryFromURL: 'r:golang/oauth2 test f:travis "test"' })
return (
<WebStory>
{() => (
<SearchQueryStateStoreProvider useSearchQueryState={useNavbarQueryState}>
<StreamingSearchResults {...defaultProps} />
</SearchQueryStateStoreProvider>
)}
</WebStory>
)
}
SearchWithQuotes.storyName = 'search with quotes'
export const DidYouMean: Story = () => {
useNavbarQueryState.setState({ searchQueryFromURL: 'javascript test' })

View File

@ -80,6 +80,14 @@ describe('StreamingSearchResults', () => {
siteAdmin: true,
} as AuthenticatedUser
// Modified from https://sourcegraph.com/github.com/reach/reach-ui@26c826684729e51e45eef29aa4316df19c0e2c03/-/blob/test/utils.tsx?L105
// userEvent.click does not work for Reach menu items. Use this function from Reach's official test code instead.
function simualateMenuItemClick(element: HTMLElement) {
fireEvent.mouseEnter(element)
fireEvent.keyDown(element, { key: ' ' })
fireEvent.keyUp(element, { key: ' ' })
}
beforeEach(() => {
useNavbarQueryState.setState({
searchCaseSensitivity: false,
@ -123,28 +131,26 @@ describe('StreamingSearchResults', () => {
expect(screen.getAllByTestId('streaming-progress-count')[0]).toHaveTextContent(expectedString)
})
it('should expand and collapse results when event from infobar is triggered', () => {
it('should expand and collapse results when event from infobar is triggered', async () => {
renderWrapper(<StreamingSearchResults {...defaultProps} streamSearch={() => of(COLLAPSABLE_SEARCH_RESULT)} />)
expect(screen.getByTestId('search-result-expand-btn')).toHaveAttribute(
'data-test-tooltip-content',
'Show more matches on all results'
)
screen
.getAllByTestId('result-container')
.map(element => expect(element).toHaveAttribute('data-expanded', 'false'))
screen.getAllByTestId('result-container').map(element => {
expect(element).toHaveAttribute('data-expanded', 'false')
})
userEvent.click(screen.getByTestId('search-result-expand-btn'))
expect(screen.getByTestId('search-result-expand-btn')).toHaveAttribute(
'data-test-tooltip-content',
'Hide more matches on all results'
)
userEvent.click(await screen.findByLabelText(/Open search actions menu/))
simualateMenuItemClick(await screen.findByText(/Expand all/, { selector: '[role=menuitem]' }))
screen
.getAllByTestId('result-container')
.map(element => expect(element).toHaveAttribute('data-expanded', 'true'))
userEvent.click(await screen.findByLabelText(/Open search actions menu/))
simualateMenuItemClick(await screen.findByText(/Collapse all/, { selector: '[role=menuitem]' }))
screen
.getAllByTestId('result-container')
.map(element => expect(element).toHaveAttribute('data-expanded', 'false'))
})
it('should render correct components for file match and repository match', () => {
@ -194,27 +200,19 @@ describe('StreamingSearchResults', () => {
expect(screen.queryByTestId('saved-search-modal')).not.toBeInTheDocument()
})
it('should open saved search modal when triggering event from infobar', () => {
it('should open and close saved search modal if events trigger', async () => {
renderWrapper(<StreamingSearchResults {...defaultProps} authenticatedUser={mockUser} />)
const savedSearchButton = screen.getByRole('button', { name: 'Save search' })
userEvent.click(await screen.findByLabelText(/Open search actions menu/))
simualateMenuItemClick(await screen.findByText(/Save search/, { selector: '[role=menuitem]' }))
expect(savedSearchButton).toHaveAttribute('href', '')
userEvent.click(savedSearchButton)
expect(screen.getByTestId('saved-search-modal')).toBeInTheDocument()
})
it('should close saved search modal if close event triggers', async () => {
renderWrapper(<StreamingSearchResults {...defaultProps} authenticatedUser={mockUser} />)
userEvent.click(await screen.findByText(/save search/i, { selector: 'a' }))
fireEvent.keyDown(screen.getByText(/save search query to:/i), {
fireEvent.keyDown(await screen.findByText(/Save search query to:/), {
key: 'Escape',
code: 'Escape',
keyCode: 27,
charCode: 27,
})
expect(screen.queryByText(/save search query to:/i)).not.toBeInTheDocument()
expect(screen.queryByText(/Save search query to:/)).not.toBeInTheDocument()
})
it('should start a new search with added params when onSearchAgain event is triggered', async () => {
@ -273,7 +271,7 @@ describe('StreamingSearchResults', () => {
renderWrapper(<StreamingSearchResults {...defaultProps} streamSearch={() => of(results)} />)
userEvent.click(await screen.findByText(/some results excluded/i))
userEvent.click((await screen.findAllByText(/results in/i))[0])
const allChecks = await screen.findAllByTestId(/^streaming-progress-skipped-suggest-check/)
for (const check of allChecks) {

View File

@ -58,48 +58,19 @@ exports[`SearchResultsInfoBar code monitoring feature flag disabled 1`] = `
/>
<li
class="mr-2 navItem"
>
<a
class="anchorLink btn btnOutlineSecondary btnSm text-decoration-none test-save-search-link"
href=""
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M17,18L12,15.82L7,18V5H17M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z"
/>
</svg>
Save search
</a>
</li>
<li
aria-hidden="true"
class="divider"
/>
<li
class="navItem"
>
<button
aria-label="Collapse"
aria-live="polite"
class="btn btnOutlineSecondary btnSm text-decoration-none"
data-state="closed"
data-test-tooltip-content="Hide more matches on all results"
data-testid="search-result-expand-btn"
aria-controls=""
aria-haspopup="true"
aria-label="Open search actions menu"
class="btn btnOutlineSecondary btnSm d-flex align-items-center text-decoration-none"
data-reach-menu-button=""
id="menu-button-2"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-0"
class="mdi-icon iconInline"
fill="currentColor"
height="24"
role="img"
@ -107,7 +78,7 @@ exports[`SearchResultsInfoBar code monitoring feature flag disabled 1`] = `
width="24"
>
<path
d="M4.08,11.92L12,4L19.92,11.92L18.5,13.33L13,7.83V22H11V7.83L5.5,13.33L4.08,11.92M12,4H22V2H2V4H12Z"
d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"
/>
</svg>
</button>
@ -175,48 +146,20 @@ exports[`SearchResultsInfoBar code monitoring feature flag enabled, can create m
class="divider"
/>
<li
class="mr-2 button navItem"
data-state="closed"
>
<a
class="anchorLink btn btnOutlineSecondary btnSm text-decoration-none a11y-ignore create-code-monitor-button"
href="/code-monitoring/new?trigger-query=foo+type%3Adiff+patterntype%3Astandard"
tabindex="0"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="20"
role="img"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M18.01 8.01C18.01 8.29 18.23 8.51 18.51 8.51C18.79 8.51 19.01 8.29 19.01 8.01C19.01 4.15 15.87 1 12 1C11.72 1 11.5 1.22 11.5 1.5C11.5 1.78 11.72 2 12 2C15.31 2 18.01 4.7 18.01 8.01ZM16.1801 7.96002C15.9001 7.96002 15.6801 7.74002 15.6801 7.46002C15.6801 5.81002 14.3301 4.46002 12.6801 4.46002C12.4001 4.46002 12.1801 4.24002 12.1801 3.96002C12.1801 3.68002 12.4001 3.46002 12.6801 3.46002C14.8901 3.46002 16.6801 5.25002 16.6801 7.46002C16.6801 7.74002 16.4601 7.96002 16.1801 7.96002ZM4.83996 6.79999L13.34 15.3C12.39 15.88 11.29 16.18 10.15 16.18C8.49996 16.18 6.93996 15.54 5.76996 14.37C4.59996 13.2 3.94996 11.65 3.94996 9.98999C3.94996 8.84999 4.25996 7.74999 4.83996 6.79999ZM4.70996 4.54999C1.70996 7.54999 1.70996 12.43 4.70996 15.43C6.20996 16.93 8.17996 17.68 10.15 17.68C12.12 17.68 14.09 16.93 15.59 15.43L4.70996 4.54999ZM4 16.14C3.7 15.84 3.43 15.52 3.18 15.18L2.89 15.69L1 18.97H4.79H8.59L8.31 18.49C6.69 18.14 5.2 17.34 4 16.14ZM13.85 8.04999C13.85 9.01999 13.07 9.79999 12.1 9.79999C11.13 9.79999 10.35 9.01999 10.35 8.04999C10.35 7.07999 11.13 6.29999 12.1 6.29999C13.07 6.29999 13.85 7.07999 13.85 8.04999Z"
fill-rule="evenodd"
/>
</svg>
Monitor
</a>
</li>
<li
class="mr-2 menu navItem"
class="mr-2 navItem"
>
<button
aria-controls=""
aria-haspopup="true"
aria-label="Open create actions menu"
aria-label="Open search actions menu"
class="btn btnOutlineSecondary btnSm d-flex align-items-center text-decoration-none"
data-reach-menu-button=""
id="menu-button-4"
id="menu-button-6"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
class="mdi-icon iconInline"
fill="currentColor"
height="24"
role="img"
@ -224,64 +167,7 @@ exports[`SearchResultsInfoBar code monitoring feature flag enabled, can create m
width="24"
>
<path
d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
/>
</svg>
Create …
</button>
</li>
<li
class="mr-2 navItem"
>
<a
class="anchorLink btn btnOutlineSecondary btnSm text-decoration-none test-save-search-link"
href=""
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M17,18L12,15.82L7,18V5H17M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z"
/>
</svg>
Save search
</a>
</li>
<li
aria-hidden="true"
class="divider"
/>
<li
class="navItem"
>
<button
aria-label="Collapse"
aria-live="polite"
class="btn btnOutlineSecondary btnSm text-decoration-none"
data-state="closed"
data-test-tooltip-content="Hide more matches on all results"
data-testid="search-result-expand-btn"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-0"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M4.08,11.92L12,4L19.92,11.92L18.5,13.33L13,7.83V22H11V7.83L5.5,13.33L4.08,11.92M12,4H22V2H2V4H12Z"
d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"
/>
</svg>
</button>
@ -349,47 +235,20 @@ exports[`SearchResultsInfoBar code monitoring feature flag enabled, can create m
class="divider"
/>
<li
class="mr-2 button navItem"
data-state="closed"
>
<button
class="btn btnOutlineSecondary btnSm a11y-ignore create-code-monitor-button"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="20"
role="img"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M18.01 8.01C18.01 8.29 18.23 8.51 18.51 8.51C18.79 8.51 19.01 8.29 19.01 8.01C19.01 4.15 15.87 1 12 1C11.72 1 11.5 1.22 11.5 1.5C11.5 1.78 11.72 2 12 2C15.31 2 18.01 4.7 18.01 8.01ZM16.1801 7.96002C15.9001 7.96002 15.6801 7.74002 15.6801 7.46002C15.6801 5.81002 14.3301 4.46002 12.6801 4.46002C12.4001 4.46002 12.1801 4.24002 12.1801 3.96002C12.1801 3.68002 12.4001 3.46002 12.6801 3.46002C14.8901 3.46002 16.6801 5.25002 16.6801 7.46002C16.6801 7.74002 16.4601 7.96002 16.1801 7.96002ZM4.83996 6.79999L13.34 15.3C12.39 15.88 11.29 16.18 10.15 16.18C8.49996 16.18 6.93996 15.54 5.76996 14.37C4.59996 13.2 3.94996 11.65 3.94996 9.98999C3.94996 8.84999 4.25996 7.74999 4.83996 6.79999ZM4.70996 4.54999C1.70996 7.54999 1.70996 12.43 4.70996 15.43C6.20996 16.93 8.17996 17.68 10.15 17.68C12.12 17.68 14.09 16.93 15.59 15.43L4.70996 4.54999ZM4 16.14C3.7 15.84 3.43 15.52 3.18 15.18L2.89 15.69L1 18.97H4.79H8.59L8.31 18.49C6.69 18.14 5.2 17.34 4 16.14ZM13.85 8.04999C13.85 9.01999 13.07 9.79999 12.1 9.79999C11.13 9.79999 10.35 9.01999 10.35 8.04999C10.35 7.07999 11.13 6.29999 12.1 6.29999C13.07 6.29999 13.85 7.07999 13.85 8.04999Z"
fill-rule="evenodd"
/>
</svg>
Monitor
</button>
</li>
<li
class="mr-2 menu navItem"
class="mr-2 navItem"
>
<button
aria-controls=""
aria-haspopup="true"
aria-label="Open create actions menu"
aria-label="Open search actions menu"
class="btn btnOutlineSecondary btnSm d-flex align-items-center text-decoration-none"
data-reach-menu-button=""
id="menu-button-6"
id="menu-button-8"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
class="mdi-icon iconInline"
fill="currentColor"
height="24"
role="img"
@ -397,62 +256,7 @@ exports[`SearchResultsInfoBar code monitoring feature flag enabled, can create m
width="24"
>
<path
d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
/>
</svg>
Create …
</button>
</li>
<li
class="mr-2 navItem"
>
<button
class="btn btnOutlineSecondary btnSm test-save-search-link"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M17,18L12,15.82L7,18V5H17M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z"
/>
</svg>
Save search
</button>
</li>
<li
aria-hidden="true"
class="divider"
/>
<li
class="navItem"
>
<button
aria-label="Collapse"
aria-live="polite"
class="btn btnOutlineSecondary btnSm text-decoration-none"
data-state="closed"
data-test-tooltip-content="Hide more matches on all results"
data-testid="search-result-expand-btn"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-0"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M4.08,11.92L12,4L19.92,11.92L18.5,13.33L13,7.83V22H11V7.83L5.5,13.33L4.08,11.92M12,4H22V2H2V4H12Z"
d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"
/>
</svg>
</button>
@ -520,52 +324,20 @@ exports[`SearchResultsInfoBar code monitoring feature flag enabled, cannot creat
class="divider"
/>
<li
class="mr-2 button navItem"
data-state="closed"
>
<a
aria-disabled="true"
aria-label="Code monitors only support type:diff or type:commit searches."
class="anchorLink btn btnOutlineSecondary btnSm text-decoration-none a11y-ignore create-code-monitor-button disabled"
disabled=""
href=""
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="20"
role="img"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M18.01 8.01C18.01 8.29 18.23 8.51 18.51 8.51C18.79 8.51 19.01 8.29 19.01 8.01C19.01 4.15 15.87 1 12 1C11.72 1 11.5 1.22 11.5 1.5C11.5 1.78 11.72 2 12 2C15.31 2 18.01 4.7 18.01 8.01ZM16.1801 7.96002C15.9001 7.96002 15.6801 7.74002 15.6801 7.46002C15.6801 5.81002 14.3301 4.46002 12.6801 4.46002C12.4001 4.46002 12.1801 4.24002 12.1801 3.96002C12.1801 3.68002 12.4001 3.46002 12.6801 3.46002C14.8901 3.46002 16.6801 5.25002 16.6801 7.46002C16.6801 7.74002 16.4601 7.96002 16.1801 7.96002ZM4.83996 6.79999L13.34 15.3C12.39 15.88 11.29 16.18 10.15 16.18C8.49996 16.18 6.93996 15.54 5.76996 14.37C4.59996 13.2 3.94996 11.65 3.94996 9.98999C3.94996 8.84999 4.25996 7.74999 4.83996 6.79999ZM4.70996 4.54999C1.70996 7.54999 1.70996 12.43 4.70996 15.43C6.20996 16.93 8.17996 17.68 10.15 17.68C12.12 17.68 14.09 16.93 15.59 15.43L4.70996 4.54999ZM4 16.14C3.7 15.84 3.43 15.52 3.18 15.18L2.89 15.69L1 18.97H4.79H8.59L8.31 18.49C6.69 18.14 5.2 17.34 4 16.14ZM13.85 8.04999C13.85 9.01999 13.07 9.79999 12.1 9.79999C11.13 9.79999 10.35 9.01999 10.35 8.04999C10.35 7.07999 11.13 6.29999 12.1 6.29999C13.07 6.29999 13.85 7.07999 13.85 8.04999Z"
fill-rule="evenodd"
/>
</svg>
Monitor
</a>
</li>
<li
class="mr-2 menu navItem"
class="mr-2 navItem"
>
<button
aria-controls=""
aria-haspopup="true"
aria-label="Open create actions menu"
aria-label="Open search actions menu"
class="btn btnOutlineSecondary btnSm d-flex align-items-center text-decoration-none"
data-reach-menu-button=""
id="menu-button-2"
id="menu-button-4"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
class="mdi-icon iconInline"
fill="currentColor"
height="24"
role="img"
@ -573,64 +345,7 @@ exports[`SearchResultsInfoBar code monitoring feature flag enabled, cannot creat
width="24"
>
<path
d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
/>
</svg>
Create …
</button>
</li>
<li
class="mr-2 navItem"
>
<a
class="anchorLink btn btnOutlineSecondary btnSm text-decoration-none test-save-search-link"
href=""
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M17,18L12,15.82L7,18V5H17M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z"
/>
</svg>
Save search
</a>
</li>
<li
aria-hidden="true"
class="divider"
/>
<li
class="navItem"
>
<button
aria-label="Collapse"
aria-live="polite"
class="btn btnOutlineSecondary btnSm text-decoration-none"
data-state="closed"
data-test-tooltip-content="Hide more matches on all results"
data-testid="search-result-expand-btn"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-0"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M4.08,11.92L12,4L19.92,11.92L18.5,13.33L13,7.83V22H11V7.83L5.5,13.33L4.08,11.92M12,4H22V2H2V4H12Z"
d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"
/>
</svg>
</button>
@ -698,47 +413,20 @@ exports[`SearchResultsInfoBar unauthenticated user 1`] = `
class="divider"
/>
<li
class="mr-2 button navItem"
data-state="closed"
>
<button
class="btn btnOutlineSecondary btnSm a11y-ignore create-code-monitor-button"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="20"
role="img"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M18.01 8.01C18.01 8.29 18.23 8.51 18.51 8.51C18.79 8.51 19.01 8.29 19.01 8.01C19.01 4.15 15.87 1 12 1C11.72 1 11.5 1.22 11.5 1.5C11.5 1.78 11.72 2 12 2C15.31 2 18.01 4.7 18.01 8.01ZM16.1801 7.96002C15.9001 7.96002 15.6801 7.74002 15.6801 7.46002C15.6801 5.81002 14.3301 4.46002 12.6801 4.46002C12.4001 4.46002 12.1801 4.24002 12.1801 3.96002C12.1801 3.68002 12.4001 3.46002 12.6801 3.46002C14.8901 3.46002 16.6801 5.25002 16.6801 7.46002C16.6801 7.74002 16.4601 7.96002 16.1801 7.96002ZM4.83996 6.79999L13.34 15.3C12.39 15.88 11.29 16.18 10.15 16.18C8.49996 16.18 6.93996 15.54 5.76996 14.37C4.59996 13.2 3.94996 11.65 3.94996 9.98999C3.94996 8.84999 4.25996 7.74999 4.83996 6.79999ZM4.70996 4.54999C1.70996 7.54999 1.70996 12.43 4.70996 15.43C6.20996 16.93 8.17996 17.68 10.15 17.68C12.12 17.68 14.09 16.93 15.59 15.43L4.70996 4.54999ZM4 16.14C3.7 15.84 3.43 15.52 3.18 15.18L2.89 15.69L1 18.97H4.79H8.59L8.31 18.49C6.69 18.14 5.2 17.34 4 16.14ZM13.85 8.04999C13.85 9.01999 13.07 9.79999 12.1 9.79999C11.13 9.79999 10.35 9.01999 10.35 8.04999C10.35 7.07999 11.13 6.29999 12.1 6.29999C13.07 6.29999 13.85 7.07999 13.85 8.04999Z"
fill-rule="evenodd"
/>
</svg>
Monitor
</button>
</li>
<li
class="mr-2 menu navItem"
class="mr-2 navItem"
>
<button
aria-controls=""
aria-haspopup="true"
aria-label="Open create actions menu"
aria-label="Open search actions menu"
class="btn btnOutlineSecondary btnSm d-flex align-items-center text-decoration-none"
data-reach-menu-button=""
id="menu-button-8"
id="menu-button-10"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
class="mdi-icon iconInline"
fill="currentColor"
height="24"
role="img"
@ -746,62 +434,7 @@ exports[`SearchResultsInfoBar unauthenticated user 1`] = `
width="24"
>
<path
d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
/>
</svg>
Create …
</button>
</li>
<li
class="mr-2 navItem"
>
<button
class="btn btnOutlineSecondary btnSm test-save-search-link"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-1"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M17,18L12,15.82L7,18V5H17M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z"
/>
</svg>
Save search
</button>
</li>
<li
aria-hidden="true"
class="divider"
/>
<li
class="navItem"
>
<button
aria-label="Collapse"
aria-live="polite"
class="btn btnOutlineSecondary btnSm text-decoration-none"
data-state="closed"
data-test-tooltip-content="Hide more matches on all results"
data-testid="search-result-expand-btn"
type="button"
>
<svg
aria-hidden="true"
class="mdi-icon iconInline mr-0"
fill="currentColor"
height="24"
role="img"
viewBox="0 0 24 24"
width="24"
>
<path
d="M4.08,11.92L12,4L19.92,11.92L18.5,13.33L13,7.83V22H11V7.83L5.5,13.33L4.08,11.92M12,4H22V2H2V4H12Z"
d="M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"
/>
</svg>
</button>