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

fix(search): VSCode Search extension: hide file preview link#63552

Merged
peterguy merged 2 commits into
mainfrom
peterguy/vscode-hide-preview-file-link
Jun 28, 2024
Merged

fix(search): VSCode Search extension: hide file preview link#63552
peterguy merged 2 commits into
mainfrom
peterguy/vscode-hide-preview-file-link

Conversation

@peterguy

Copy link
Copy Markdown
Contributor

The VSCode Search extension does not support file preview, so hide it from the search results when the search originates from the VSCode Search extension.

Example showing the file preview links (before this PR):
Screenshot 2024-06-28 at 09 42 26

Example without the file preview links (after this PR):
Screenshot 2024-06-28 at 09 43 46

Test plan

Automated tests still pass

Including visual and functional tests of the file preview functionality.

Build and run locally

Build

git switch peterguy/vscode-hide-preview-file-link
cd client/vscode
pnpm run build

Run

  • Launch extension in VSCode: open the Run and Debug sidebar view in VS Code, then select Launch VS Code Extension from the dropdown menu.
  • Run a search using the search bar.
  • See that the file preview link

Check that the file preview link exists in the web app

The web app uses the branded components also, so run sg start or sg start web-standalone, do a search and see that the file preview link still exists.
If you want to be an over-achiever, you can edit client/branded/src/search-ui/results/StreamingSearchResultsList.tsx, changing hideFilePreviewButton = false, to hideFilePreviewButton = true, and reload the search results to see that the file preview link disappears.

@cla-bot cla-bot Bot added the cla-signed label Jun 28, 2024
@peterguy peterguy requested a review from vovakulikov June 28, 2024 17:38
Comment thread client/branded/src/search-ui/components/FileContentSearchResult.tsx
@peterguy peterguy self-assigned this Jun 28, 2024
@peterguy peterguy requested review from camdencheek June 28, 2024 18:30
@peterguy peterguy marked this pull request as draft June 28, 2024 20:16
@peterguy peterguy marked this pull request as ready for review June 28, 2024 20:51
@peterguy peterguy requested a review from a team June 28, 2024 20:51
@peterguy peterguy enabled auto-merge (squash) June 28, 2024 20:52
Comment on lines +85 to +89
/**
* Don't display the file preview button in the VSCode extension.
* Expose this prop to allow the VSCode extension to hide the button.
* Name it "hide" in an attempt to communicate that hiding is a special case.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the nice disclaimers 🙂

@peterguy peterguy merged commit bca0526 into main Jun 28, 2024
@peterguy peterguy deleted the peterguy/vscode-hide-preview-file-link branch June 28, 2024 21:06
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.

2 participants