Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit d66dbbc

Browse files
author
Rok Novosel
authored
Remove core workflow improvements flag (#41986)
1 parent 0651b67 commit d66dbbc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+255
-1014
lines changed

client/branded/src/global-styles/colors.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ $theme-colors: (
204204
rgba(215, 240, 253, 0.25) 83.64%
205205
);
206206
--modal-bg: #{rgba($gray-04, 0.5)};
207-
// Colors used in the search sidebar with .core-workflow-improvements-enabled
208207
--sidebar-bg: var(--color-bg-1);
209208
--sidebar-border-color: var(--border-color-2);
210209
}
@@ -296,7 +295,6 @@ $theme-colors: (
296295
--marketing-gradient: linear-gradient(90.64deg, rgba(108, 8, 223, 0.5) 3.11%, rgba(0, 165, 213, 0.5) 83.64%);
297296
--marketing-gradient-25: linear-gradient(90.64deg, rgba(108, 8, 223, 0.25) 3.11%, rgba(0, 165, 213, 0.25) 83.64%);
298297
--modal-bg: #{rgba($gray-08, 0.5)};
299-
// Colors used in the search sidebar with .core-workflow-improvements-enabled
300298
--sidebar-bg: var(--black);
301299
--sidebar-border-color: var(--color-bg-2);
302300
}

client/search-ui/src/components/CommitSearchResult.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import SourceCommitIcon from 'mdi-react/SourceCommitIcon'
77
import { displayRepoName } from '@sourcegraph/shared/src/components/RepoLink'
88
import { PlatformContextProps } from '@sourcegraph/shared/src/platform/context'
99
import { CommitMatch, getCommitMatchUrl, getRepositoryUrl } from '@sourcegraph/shared/src/search/stream'
10-
import { useCoreWorkflowImprovementsEnabled } from '@sourcegraph/shared/src/settings/useCoreWorkflowImprovementsEnabled'
1110
// eslint-disable-next-line no-restricted-imports
1211
import { Timestamp } from '@sourcegraph/web/src/components/time/Timestamp'
1312
import { Link, Code } from '@sourcegraph/wildcard'
@@ -36,15 +35,13 @@ export const CommitSearchResult: React.FunctionComponent<Props> = ({
3635
as,
3736
index,
3837
}) => {
39-
const [coreWorkflowImprovementsEnabled] = useCoreWorkflowImprovementsEnabled()
40-
4138
const renderTitle = (): JSX.Element => (
4239
<div className={styles.title}>
4340
<span
4441
className={classNames(
4542
'test-search-result-label flex-grow-1',
4643
styles.titleInner,
47-
coreWorkflowImprovementsEnabled && styles.mutedRepoFileLink
44+
styles.mutedRepoFileLink
4845
)}
4946
>
5047
<Link to={getRepositoryUrl(result.repository)}>{displayRepoName(result.repository)}</Link>

client/search-ui/src/components/FileMatchChildren.module.scss

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
.file-match-children {
22
background-color: var(--code-bg);
3-
border: 1px solid var(--border-color);
43
border-radius: var(--border-radius);
54
padding: 0.25rem 0;
65
position: relative;
76

8-
:global(.core-workflow-improvements-enabled) & {
9-
border: none;
10-
}
11-
12-
:global(.core-workflow-improvements-enabled) [data-collapsible='true'] & {
7+
[data-collapsible='true'] & {
138
border-bottom-left-radius: 0;
149
border-bottom-right-radius: 0;
1510
}
@@ -67,11 +62,7 @@
6762
position: relative;
6863

6964
&:not(:first-child) {
70-
border-top: 1px solid var(--border-color-2);
71-
72-
:global(.core-workflow-improvements-enabled) & {
73-
border-top-color: var(--border-color);
74-
}
65+
border-top: 1px solid var(--border-color);
7566
}
7667
}
7768
}

client/search-ui/src/components/FileMatchChildren.tsx

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ import { Controller as ExtensionsController } from '@sourcegraph/shared/src/exte
2121
import { HoverContext } from '@sourcegraph/shared/src/hover/HoverOverlay.types'
2222
import { ContentMatch, SymbolMatch, PathMatch, getFileMatchUrl } from '@sourcegraph/shared/src/search/stream'
2323
import { SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
24-
import { useCoreWorkflowImprovementsEnabled } from '@sourcegraph/shared/src/settings/useCoreWorkflowImprovementsEnabled'
25-
import { SymbolIcon } from '@sourcegraph/shared/src/symbols/SymbolIcon'
2624
import { SymbolTag } from '@sourcegraph/shared/src/symbols/SymbolTag'
2725
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
2826
import { codeCopiedEvent } from '@sourcegraph/shared/src/tracking/event-log-creators'
2927
import { useCodeIntelViewerUpdates } from '@sourcegraph/shared/src/util/useCodeIntelViewerUpdates'
30-
import { Link, Code } from '@sourcegraph/wildcard'
3128

3229
import { CodeExcerpt, FetchFileParameters } from './CodeExcerpt'
3330
import { LastSyncedIcon } from './LastSyncedIcon'
@@ -148,8 +145,6 @@ function navigateToFileOnMiddleMouseButtonClick(event: MouseEvent<HTMLElement>):
148145
}
149146

150147
export const FileMatchChildren: React.FunctionComponent<React.PropsWithChildren<FileMatchProps>> = props => {
151-
const [coreWorkflowImprovementsEnabled] = useCoreWorkflowImprovementsEnabled()
152-
153148
/**
154149
* If LazyFileResultSyntaxHighlighting is enabled, we fetch plaintext
155150
* line ranges _alongside_ the typical highlighted line ranges.
@@ -347,14 +342,9 @@ export const FileMatchChildren: React.FunctionComponent<React.PropsWithChildren<
347342
telemetryService.log(...codeCopiedEvent('file-match'))
348343
}, [telemetryService])
349344

350-
const openInNewTabProps = props.openInNewTab ? { target: '_blank', rel: 'noopener noreferrer' } : undefined
351-
352345
return (
353346
<div
354-
className={classNames(
355-
styles.fileMatchChildren,
356-
coreWorkflowImprovementsEnabled && result.type === 'symbol' && styles.symbols
357-
)}
347+
className={classNames(styles.fileMatchChildren, result.type === 'symbol' && styles.symbols)}
358348
data-testid="file-match-children"
359349
>
360350
{result.repoLastFetched && <LastSyncedIcon lastSyncedTime={result.repoLastFetched} />}
@@ -366,23 +356,7 @@ export const FileMatchChildren: React.FunctionComponent<React.PropsWithChildren<
366356
)}
367357

368358
{/* Symbols */}
369-
{((!coreWorkflowImprovementsEnabled && result.type === 'symbol' && result.symbols) || []).map(symbol => (
370-
<Link
371-
to={symbol.url}
372-
className={classNames('test-file-match-children-item', styles.item)}
373-
key={`symbol:${symbol.name}${String(symbol.containerName)}${symbol.url}`}
374-
data-testid="file-match-children-item"
375-
{...openInNewTabProps}
376-
>
377-
<SymbolIcon kind={symbol.kind} className="mr-1 flex-shrink-0" />
378-
<Code>
379-
{symbol.name}{' '}
380-
{symbol.containerName && <span className="text-muted">{symbol.containerName}</span>}
381-
</Code>
382-
</Link>
383-
))}
384-
385-
{((coreWorkflowImprovementsEnabled && result.type === 'symbol' && result.symbols) || []).map(symbol => (
359+
{((result.type === 'symbol' && result.symbols) || []).map(symbol => (
386360
<div
387361
key={`symbol:${symbol.name}${String(symbol.containerName)}${symbol.url}`}
388362
className={classNames('test-file-match-children-item', styles.symbol)}
@@ -420,7 +394,7 @@ export const FileMatchChildren: React.FunctionComponent<React.PropsWithChildren<
420394
{/* Line matches */}
421395
{grouped.length > 0 && (
422396
<div>
423-
{grouped.map((group, index) => (
397+
{grouped.map(group => (
424398
<div
425399
key={`linematch:${getFileMatchUrl(result)}${group.position.line}:${
426400
group.position.character

client/search-ui/src/components/FileSearchResult.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
getRevision,
2424
} from '@sourcegraph/shared/src/search/stream'
2525
import { isSettingsValid, SettingsCascadeProps } from '@sourcegraph/shared/src/settings/settings'
26-
import { useCoreWorkflowImprovementsEnabled } from '@sourcegraph/shared/src/settings/useCoreWorkflowImprovementsEnabled'
2726
import { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
2827
import { Badge } from '@sourcegraph/wildcard'
2928

@@ -107,18 +106,17 @@ type CommonResultContainerProps = Omit<
107106

108107
// This is a search result for types file (content), path, or symbol.
109108
export const FileSearchResult: React.FunctionComponent<React.PropsWithChildren<Props>> = props => {
110-
const [coreWorkflowImprovementsEnabled] = useCoreWorkflowImprovementsEnabled()
111109
const result = props.result
112110
const repoAtRevisionURL = getRepositoryUrl(result.repository, result.branches)
113111
const revisionDisplayName = getRevision(result.branches, result.commit)
114112
const settings = props.settingsCascade.final
115113

116114
const ranking = useMemo(() => {
117115
if (!isErrorLike(settings) && settings?.experimentalFeatures?.clientSearchResultRanking === BY_LINE_RANKING) {
118-
return new LineRanking(coreWorkflowImprovementsEnabled ? 5 : 10)
116+
return new LineRanking(5)
119117
}
120-
return new ZoektRanking(coreWorkflowImprovementsEnabled ? 3 : 5)
121-
}, [settings, coreWorkflowImprovementsEnabled])
118+
return new ZoektRanking(3)
119+
}, [settings])
122120

123121
// The number of lines of context to show before and after each match.
124122
const context = useMemo(() => {
@@ -200,7 +198,7 @@ export const FileSearchResult: React.FunctionComponent<React.PropsWithChildren<P
200198
? `${props.repoDisplayName}${revisionDisplayName ? `@${revisionDisplayName}` : ''}`
201199
: undefined
202200
}
203-
className={classNames(styles.titleInner, coreWorkflowImprovementsEnabled && styles.mutedRepoFileLink)}
201+
className={classNames(styles.titleInner, styles.mutedRepoFileLink)}
204202
/>
205203
),
206204
allExpanded: props.allExpanded,
@@ -277,10 +275,8 @@ export const FileSearchResult: React.FunctionComponent<React.PropsWithChildren<P
277275
collapsible: limitedMatchCount < matchCount,
278276
collapsedChildren,
279277
expandedChildren,
280-
collapseLabel: coreWorkflowImprovementsEnabled ? 'Show less' : `Hide ${hideCount}`,
281-
expandLabel: coreWorkflowImprovementsEnabled
282-
? `Show ${hideCount} more ${pluralize('match', hideCount, 'matches')}`
283-
: `${hideCount} more`,
278+
collapseLabel: 'Show less',
279+
expandLabel: `Show ${hideCount} more ${pluralize('match', hideCount, 'matches')}`,
284280
matchCountLabel,
285281
}
286282
}
@@ -300,10 +296,8 @@ export const FileSearchResult: React.FunctionComponent<React.PropsWithChildren<P
300296
description,
301297
collapsedChildren: <FileMatchChildren {...props} result={result} {...collapsedMatchGroups} />,
302298
expandedChildren,
303-
collapseLabel: coreWorkflowImprovementsEnabled ? 'Show less' : `Hide ${length}`,
304-
expandLabel: coreWorkflowImprovementsEnabled
305-
? `Show ${length} more ${pluralize('match', length, 'matches')}`
306-
: `${length} more`,
299+
collapseLabel: 'Show less',
300+
expandLabel: `Show ${length} more ${pluralize('match', length, 'matches')}`,
307301
matchCountLabel,
308302
as: props.as,
309303
}

client/search-ui/src/components/RepoSearchResult.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import SourceRepositoryIcon from 'mdi-react/SourceRepositoryIcon'
77
import { highlightNode } from '@sourcegraph/common'
88
import { codeHostSubstrLength, displayRepoName } from '@sourcegraph/shared/src/components/RepoLink'
99
import { getRepoMatchLabel, getRepoMatchUrl, RepositoryMatch } from '@sourcegraph/shared/src/search/stream'
10-
import { useCoreWorkflowImprovementsEnabled } from '@sourcegraph/shared/src/settings/useCoreWorkflowImprovementsEnabled'
1110
import { Icon, Link } from '@sourcegraph/wildcard'
1211

1312
import { LastSyncedIcon } from './LastSyncedIcon'
@@ -32,19 +31,12 @@ export const RepoSearchResult: React.FunctionComponent<RepoSearchResultProps> =
3231
as,
3332
index,
3433
}) => {
35-
const [coreWorkflowImprovementsEnabled] = useCoreWorkflowImprovementsEnabled()
3634
const repoDescriptionElement = useRef<HTMLDivElement>(null)
3735
const repoNameElement = useRef<HTMLAnchorElement>(null)
3836

3937
const renderTitle = (): JSX.Element => (
4038
<div className={styles.title}>
41-
<span
42-
className={classNames(
43-
'test-search-result-label',
44-
styles.titleInner,
45-
coreWorkflowImprovementsEnabled && styles.mutedRepoFileLink
46-
)}
47-
>
39+
<span className={classNames('test-search-result-label', styles.titleInner, styles.mutedRepoFileLink)}>
4840
<Link to={getRepoMatchUrl(result)} ref={repoNameElement}>
4941
{displayRepoName(getRepoMatchLabel(result))}
5042
</Link>

client/search-ui/src/components/ResultContainer.module.scss

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,22 @@
44
}
55

66
&:not(:last-of-type) {
7-
margin-bottom: 0.5rem;
8-
}
9-
10-
:global(.core-workflow-improvements-enabled) &:not(:last-of-type) {
117
// Prevents the sticky items below from affecting
128
// anything outside of the result container.
139
isolation: isolate;
14-
1510
margin-bottom: 1rem;
1611
}
1712
}
1813

1914
.header {
2015
padding: 0.5rem 0.5rem 0.5rem 0;
21-
background-color: transparent;
2216
display: flex;
2317
align-items: center;
2418
flex-wrap: wrap;
25-
26-
:global(.core-workflow-improvements-enabled) & {
27-
position: sticky;
28-
top: 0;
29-
z-index: 1; // Show on top of search result contents
30-
background-color: var(--body-bg);
31-
}
19+
position: sticky;
20+
top: 0;
21+
z-index: 1; // Show on top of search result contents
22+
background-color: var(--body-bg);
3223

3324
&-title {
3425
flex: 1 1 auto;

0 commit comments

Comments
 (0)