-
Notifications
You must be signed in to change notification settings - Fork 1.3k
(feat) add repository metadata to repo match search result items #50567
Conversation
Codenotify: Notifying subscribers in CODENOTIFY files for diff c9ddb0d...68b9168.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woot! Thanks for tackling this.
A couple of quick first impressions:
- It seems a little strange that we are adding this to all result types since they are logically associated only with the repos, not a file or a commit. I would expect these to only be displayed on repository result types.
- The added gap between the title line and the result card is a little visually jarring. Might be worth a design consultation here
- What does this look like with a null value? I don't see any screenshots with that case.
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 68b9168 and 3f84c0f or learn more. Open explanation
|
This is a great addition! I agree with Camden's comments here. I recommend reconsidering the design to put these key/value pairs inside the box and only for repo results. I also recommend showing them in the repo page (eg. https://sourcegraph.com/github.com/sourcegraph/sourcegraph), but this can be a separate PR. |
Thanks for a quick review, @camdencheek.
I intentionally added to all result types except
Yep, already asked Rob Rhyne for help with designs.
Good point, I missed that values are nullable, will take a look at this scenario too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly naming and styling questions/suggestions
client/branded/src/search-ui/components/ResultContainer.module.scss
Outdated
Show resolved
Hide resolved
client/branded/src/search-ui/components/ResultContainer.module.scss
Outdated
Show resolved
Hide resolved
client/branded/src/search-ui/components/ResultContainer.module.scss
Outdated
Show resolved
Hide resolved
@@ -256,6 +256,7 @@ export const FileContentSearchResult: React.FunctionComponent<React.PropsWithChi | |||
className={classNames(styles.copyButtonContainer, containerClassName)} | |||
resultClassName={resultContainerStyles.highlightResult} | |||
rankingDebug={result.debug} | |||
keyValuePairs={result.keyValuePairs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we call the feature repository metadata, why do we call everything that actually implements it key value pairs? Does not make sense to me to be honest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe metadata is implemented as simple key-value pairs for more flexibility.
3bec0e0
to
159c93c
Compare
style(ResultContainer.module.scss): rename .repo-kvps class to .repo-metadata
…alue classes feat(ResultContainer.tsx): replace key-value pairs with badges in RepoMetadata component
90f4e33
to
52c6bf9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM after your changes and fixes.
I guess you'll move it as Juliana proposed in the next PR?
d344949
to
c0a148f
Compare
Thanks, everyone, for the reviews and feedback. So after thinking a bit,
Here is how it looks now: |
@limitedmage Follow-up PR adding repo metadata to repo root page. I would appreciate reviews. cc @camdencheek @camdencheek |
Part of https://github.com/sourcegraph/pr-faqs/issues/96.
This PR:
keyValuePairs
) to search repo match result items ifrepository-metadata
feature flag is enabledTest plan
sg start
repository-metadata
feature flagaddRepoKeyValuePair
APIScreenshots
App preview:
Check out the client app preview documentation to learn more.