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

feat: highlight search input result keyword #263

Merged
merged 6 commits into from
Mar 21, 2024

Conversation

PainterPuppets
Copy link

Copy link

vercel bot commented Mar 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ckb-explorer-frontend-in-magickbase-repo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 21, 2024 4:14am

@Keith-CY
Copy link
Member

Keith-CY commented Mar 7, 2024

US is matched when keyword is USD
image

@PainterPuppets
Copy link
Author

US is matched when keyword is USD image

The search results are provided by the backend, and the matching fields include "description", and I'm guessing "USD" is included in "description".

This pr is matching that string and highlighting it in the frontend, I can change it if it means that the frontend doesn't want to highlight us when typing usd, but if it doesn't want to display this search result, might have to change the backend.

@Keith-CY
Copy link
Member

US is matched when keyword is USD image

The search results are provided by the backend, and the matching fields include "description", and I'm guessing "USD" is included in "description".

This pr is matching that string and highlighting it in the frontend, I can change it if it means that the frontend doesn't want to highlight us when typing usd, but if it doesn't want to display this search result, might have to change the backend.

But in this case B*US* should not be partially highlighted

@Keith-CY
Copy link
Member

US is matched when keyword is USD image

The search results are provided by the backend, and the matching fields include "description", and I'm guessing "USD" is included in "description".
This pr is matching that string and highlighting it in the frontend, I can change it if it means that the frontend doesn't want to highlight us when typing usd, but if it doesn't want to display this search result, might have to change the backend.

But in this case B*US* should not be partially highlighted

Any update on this

@PainterPuppets
Copy link
Author

US is matched when keyword is USD image

The search results are provided by the backend, and the matching fields include "description", and I'm guessing "USD" is included in "description".
This pr is matching that string and highlighting it in the frontend, I can change it if it means that the frontend doesn't want to highlight us when typing usd, but if it doesn't want to display this search result, might have to change the backend.

But in this case B*US* should not be partially highlighted

Any update on this

fixed it

@Keith-CY
Copy link
Member

Please have a review @FrederLu

@FrederLu
Copy link

FrederLu commented Mar 18, 2024

Magickbase/ckb-explorer-public-issues#511 (comment)

image image

When the mouse is hovering, in addition to the matching information being highlighted, other information does not need to be highlighted.


image image The red line in the screenshot should be highlighted (the first point of the match), but it is not, while the later points are.
image The data in the search results box is abnormal. Name information that matches the input information should be displayed, with matching data highlighted.
image

If there is no corresponding data match, the data should not be displayed in the result information.

@PainterPuppets
Copy link
Author

Magickbase/ckb-explorer-public-issues#511 (comment)

image image
When the mouse is hovering, in addition to the matching information being highlighted, other information does not need to be highlighted.

image image The red line in the screenshot should be highlighted (the first point of the match), but it is not, while the later points are.
image The data in the search results box is abnormal. Name information that matches the input information should be displayed, with matching data highlighted.
image
If there is no corresponding data match, the data should not be displayed in the result information.

Problems 1 and 2 have been fixed, regarding the last two points, the search results are returned by the back-end, if want to change the search fields and logic, may need to collaborate with the back-end developers.

@FrederLu
Copy link

FrederLu commented Mar 19, 2024

Magickbase/ckb-explorer-public-issues#511 (comment)
image image
When the mouse is hovering, in addition to the matching information being highlighted, other information does not need to be highlighted.
image image The red line in the screenshot should be highlighted (the first point of the match), but it is not, while the later points are.
image The data in the search results box is abnormal. Name information that matches the input information should be displayed, with matching data highlighted.
image
If there is no corresponding data match, the data should not be displayed in the result information.

Problems 1 and 2 have been fixed, regarding the last two points, the search results are returned by the back-end, if want to change the search fields and logic, may need to collaborate with the back-end developers.

The fixed problem will be verified later, but now the page cannot be opened, please confirm.

regarding the last two points, the search results are returned by the back-end, if want to change the search fields and logic, may need to collaborate with the back-end developers.

image

Using the API of Testnet, I saw that there is information related to the name, but the page displays the information of symbol. You can check with your backend colleagues to confirm.

@PainterPuppets
Copy link
Author

PainterPuppets commented Mar 20, 2024

Using the API of Testnet, I saw that there is information related to the name, but the page displays the information of symbol. You can check with your backend colleagues to confirm.

Magickbase/ckb-explorer-public-issues#511 (comment)
image image
When the mouse is hovering, in addition to the matching information being highlighted, other information does not need to be highlighted.
image image The red line in the screenshot should be highlighted (the first point of the match), but it is not, while the later points are.
image The data in the search results box is abnormal. Name information that matches the input information should be displayed, with matching data highlighted.
image
If there is no corresponding data match, the data should not be displayed in the result information.

Problems 1 and 2 have been fixed, regarding the last two points, the search results are returned by the back-end, if want to change the search fields and logic, may need to collaborate with the back-end developers.

The fixed problem will be verified later, but now the page cannot be opened, please confirm.

regarding the last two points, the search results are returned by the back-end, if want to change the search fields and logic, may need to collaborate with the back-end developers.

image Using the API of `Testnet`, I saw that there is information related to the name, but the page displays the information of `symbol`. You can check with your backend colleagues to confirm.

The display logic for previous searches was the same, full_name is more like a complementary name and symbol is a commonly used name, like USD Tether and USDT, maybe most people use the latter more often?

About search results, most search engines support many fields, it seems to me that searching for both full_name and symbol doesn't seem to be a problem?

@FrederLu
Copy link

FrederLu commented Mar 20, 2024

image image image

When matching to the middle part of the character, the beginning part of the character seems to be compressed, see the pattern below in the screenshot.

@PainterPuppets
Copy link
Author

image image image
When matching to the middle part of the character, the beginning part of the character seems to be compressed, see the pattern below in the screenshot.

fixed

@Keith-CY Keith-CY merged commit f186380 into Magickbase:develop Mar 21, 2024
3 checks passed
@PainterPuppets PainterPuppets deleted the highlight_search_result branch March 21, 2024 06:49
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.

Characters in search results need to be highlighted.
3 participants