Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webui: Improve UI of links for viewing search results in context. #515

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

junhaoliao
Copy link
Collaborator

@junhaoliao junhaoliao commented Aug 13, 2024

Description

  1. webui: Improve display of ExtractIr file links in search results table.

Validation performed

  1. Built and started CLP package.
  2. Compressed sample files.
  3. Loaded WebUI http://localhost:4000 in a browser.
  4. Started a search with query string "1" and observed each search result is displayed with its original file path.
  5. Changed "Max lines per result" and verified that the UI was rendered correctly.
  6. Scrolled to the bottom to load more results and verified that the UI was rendered correctly.

Sample screenshot:
image

@junhaoliao
Copy link
Collaborator Author

@Henry8192 Please help triage this review. Thanks!

@junhaoliao junhaoliao removed the request for review from kirkrodrigues August 13, 2024 05:47
Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

Just a question.

{" "}
<a
className={"search-results-file-link"}
rel={"noopener noreferrer"}
Copy link
Member

Choose a reason for hiding this comment

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

What's the reasoning behind setting these? Fwiw, _blank seems to imply noopener now:

Note: Setting target="_blank" on elements implicitly provides the same rel behavior as setting rel="noopener" which does not set window.opener.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah.. I didn't read the docs when I wrote this.

Apparently the behaviour change is fairly recent (with Chrome adapting it only since 2021) so we might better keep the noopener:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#browser_compatibility:~:text=target%3D%22_blank%22%20implies%20rel%3D%22noopener%22%20behavior

Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

For the PR title, how about:

webui: Improve UI of links for viewing search results in context.

@junhaoliao junhaoliao changed the title webui: Improve display of ExtractIr file links in search results table. webui: Improve UI of links for viewing search results in context. Aug 19, 2024
@junhaoliao junhaoliao merged commit e1f3f2a into y-scope:main Aug 19, 2024
4 checks passed
@junhaoliao junhaoliao deleted the webui-file-link branch August 19, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants