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

search ui: ResultContainer component refactor#42483

Merged
novoselrok merged 9 commits into
mainfrom
rn/result-container-refactor
Oct 10, 2022
Merged

search ui: ResultContainer component refactor#42483
novoselrok merged 9 commits into
mainfrom
rn/result-container-refactor

Conversation

@novoselrok

@novoselrok novoselrok commented Oct 4, 2022

Copy link
Copy Markdown
Contributor

Fixes #42159

Summary

Test plan

  • Everything should be covered by tests, no new functionality added.

App preview:

Check out the client app preview documentation to learn more.

@cla-bot cla-bot Bot added the cla-signed label Oct 4, 2022
@novoselrok novoselrok marked this pull request as ready for review October 4, 2022 08:52
@sourcegraph-bot

sourcegraph-bot commented Oct 4, 2022

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 39147a4...a46e742.

Notify File(s)
@fkling client/search-ui/src/components/CodeExcerpt.tsx
client/search-ui/src/components/CommitSearchResult.tsx
client/search-ui/src/components/FileContentSearchResult.test.tsx
client/search-ui/src/components/FileContentSearchResult.tsx
client/search-ui/src/components/FileMatchChildren.module.scss
client/search-ui/src/components/FileMatchChildren.tsx
client/search-ui/src/components/FilePathSearchResult.tsx
client/search-ui/src/components/FileSearchResult.test.tsx
client/search-ui/src/components/FileSearchResult.tsx
client/search-ui/src/components/LegacyResultContainer.module.scss
client/search-ui/src/components/LegacyResultContainer.test.tsx
client/search-ui/src/components/LegacyResultContainer.tsx
client/search-ui/src/components/RepoSearchResult.tsx
client/search-ui/src/components/ResultContainer.module.scss
client/search-ui/src/components/ResultContainer.tsx
client/search-ui/src/components/SearchResult.module.scss
client/search-ui/src/components/SymbolSearchResult.module.scss
client/search-ui/src/components/SymbolSearchResult.tsx
client/search-ui/src/components/codeLinkNavigation.ts
client/search-ui/src/components/index.ts
client/search-ui/src/results/StreamingSearchResultsList.tsx
client/web/src/search/results/StreamingSearchResults.test.tsx
@limitedmage client/search-ui/src/components/CodeExcerpt.tsx
client/search-ui/src/components/CommitSearchResult.tsx
client/search-ui/src/components/FileContentSearchResult.test.tsx
client/search-ui/src/components/FileContentSearchResult.tsx
client/search-ui/src/components/FileMatchChildren.module.scss
client/search-ui/src/components/FileMatchChildren.tsx
client/search-ui/src/components/FilePathSearchResult.tsx
client/search-ui/src/components/FileSearchResult.test.tsx
client/search-ui/src/components/FileSearchResult.tsx
client/search-ui/src/components/LegacyResultContainer.module.scss
client/search-ui/src/components/LegacyResultContainer.test.tsx
client/search-ui/src/components/LegacyResultContainer.tsx
client/search-ui/src/components/RepoSearchResult.tsx
client/search-ui/src/components/ResultContainer.module.scss
client/search-ui/src/components/ResultContainer.tsx
client/search-ui/src/components/SearchResult.module.scss
client/search-ui/src/components/SymbolSearchResult.module.scss
client/search-ui/src/components/SymbolSearchResult.tsx
client/search-ui/src/components/codeLinkNavigation.ts
client/search-ui/src/components/index.ts
client/search-ui/src/results/StreamingSearchResultsList.tsx
client/web/src/integration/search.test.ts
client/web/src/search/results/StreamingSearchResults.test.tsx

@novoselrok novoselrok requested review from a team and limitedmage October 4, 2022 08:56

@limitedmage limitedmage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, left non-blocking suggestions.

Comment on lines +191 to +199
<PrefetchableFile
isPrefetchEnabled={prefetchFileEnabled}
prefetch={prefetchFile}
filePath={result.path}
revision={getRevision(result.branches, result.commit)}
repoName={result.repository}
className={resultContainerStyles.resultContainer}
as="li"
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 14 to +16
title: React.ReactNode

/**
* CSS class name to apply to the title element.
*/
titleClassName?: string

/** The content to display next to the title. */
description?: React.ReactNode

/**
* The content of the result displayed underneath the result container's
* header when collapsed.
*/
collapsedChildren?: React.ReactNode
/**
* The content of the result displayed underneath the result container's
* header when expanded.
*/
expandedChildren?: React.ReactNode
/**
* The label to display next to the collapse button
*/
collapseLabel?: string

/**
* The label to display next to the expand button
*/
expandLabel?: string

/**
* The total number of matches to display
*/
matchCountLabel?: string

/**
* This component does not accept children.
*/
children?: never

/**
* The result type
*/
repoStars?: number

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be moved to another component (ResultTitle?) that this component can compose.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider that, but since it's going to be used in only one place, I didn't want to fragment the components too much.

@novoselrok novoselrok merged commit 7c2e624 into main Oct 10, 2022
@novoselrok novoselrok deleted the rn/result-container-refactor branch October 10, 2022 06:54
novoselrok pushed a commit that referenced this pull request Oct 14, 2022
novoselrok pushed a commit that referenced this pull request Oct 14, 2022
* Revert "search ui: add copy path button to search results (#42721)"

This reverts commit 75efbc9.

* Revert "search ui: search results components hierarchy refactor (#42483)"

This reverts commit 7c2e624.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search results components hierarchy refactor

4 participants