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

Adding Feature/search engine selection #257

Merged
merged 11 commits into from
Dec 5, 2024

Conversation

princevora
Copy link
Contributor

@princevora princevora commented Dec 2, 2024

  • Added DropDown Support With all the supported search engine In the materialYouNewTab.
  • The DropDown Supports all the colors which are currently active as it has used the pre written css classes and styles.
  • The Feature has short code and i have focused on clean and readable code
  • The Dropdown stores the selected search engine in the local storage same as the radio button does.
  • It will automatically detect and select the appropriate search engine from local storage when ever the new tab is been created.

I have Shared A few Screen Shots Of my work below.

Dark theme

image

image

Light Theme & Brave New Tab interface

image

Option For Enabling Or Disabling the shortcut search

image

@princevora
Copy link
Contributor Author

This Fork Has all the recent code and added a feature to enable or disable the shortcut search.

@XengShi XengShi marked this pull request as ready for review December 2, 2024 05:59
@itz-rj-here
Copy link
Collaborator

if you don't have any problem can you place the type here... Text little bit of right side please...

@prem-k-r
Copy link
Collaborator

prem-k-r commented Dec 2, 2024

Option For Enabling Or Disabling the shortcut search

image

Great. Please rearrange it before search suggestions toggle.. proxy and search suggestions are related.. so adding in between is not good

@XengShi
Copy link
Owner

XengShi commented Dec 2, 2024

Your code works well overall, but I noticed a couple of minor issues that could be improved:

Screencast.From.2024-12-02.13-16-05.mp4

Upon reloading the page, the radio button momentarily appears for a fraction of a second before disappearing.

Screencast.From.2024-12-02.13-17-37.mp4

On the first load of the extension, both options—'Search with' and 'Dropdown selection'—are enabled simultaneously, whereas initially, only the 'Search with' option should be active.

@itz-rj-here
Copy link
Collaborator

itz-rj-here commented Dec 2, 2024

Your code works well overall, but I noticed a couple of minor issues that could be improved:

Screencast.From.2024-12-02.13-16-05.mp4
Upon reloading the page, the radio button momentarily appears for a fraction of a second before disappearing.

Screencast.From.2024-12-02.13-17-37.mp4
On the first load of the extension, both options—'Search with' and 'Dropdown selection'—are enabled simultaneously, whereas initially, only the 'Search with' option should be active.

i can feel that the position of the icon's doesn't looks good.
Need more perfection :)

@prem-k-r
Copy link
Collaborator

prem-k-r commented Dec 2, 2024

I recently learned that we can use the element. It allows us to reference an SVG symbol, avoiding the need to write the same SVG code repeatedly and making our code cleaner.

example:

<!-- Define the SVG symbol in the <defs> block -->
<svg style="display: none;">
  <symbol id="custom-icon" viewBox="0 0 28 28">
    <rect class="accentColor" fill="#FF000F" height="28" rx="14" width="28" />
    <path class="darkIconForDarkTheme"
          d="M22.9991 13.1645C22.9954 13.0734 22.9651 12.9855 22.9119 12.9118C22.8588 12.8382 22.7853 12.7822 22.7007 12.751L13.8694 9.98251C13.7046 9.93107 13.6294 10.0197 13.7018 10.1788L15.3442 13.8304C15.4167 13.9904 15.604 14.18 15.7602 14.2524L18.0135 15.2966C18.1697 15.369 18.1735 15.4957 18.021 15.5776L8.40754 20.7525C8.25601 20.8345 8.23624 20.8059 8.36425 20.6887L12.0575 17.3219C12.197 17.1796 12.28 16.9905 12.291 16.7904L12.2947 6.58526C12.291 6.49394 12.2606 6.40578 12.2073 6.33199C12.154 6.25821 12.0803 6.20212 11.9954 6.17084L8.2993 5.01334C8.13459 4.9619 8 5.06383 8 5.24008V20.7211C8 20.8974 8.11483 21.1241 8.25601 21.2251L12.0114 23.9183C12.1526 24.0193 12.3879 24.0279 12.5357 23.9373L22.7308 17.723C22.8093 17.6688 22.8744 17.597 22.921 17.5133C22.9677 17.4295 22.9947 17.336 23 17.24V13.1645H22.9991Z"
          fill="white" />
  </symbol>
</svg>

<!-- Reuse the SVG with <use> -->
<svg class="icon" width="28" height="28">
  <use href="#custom-icon"></use>
</svg>

<svg class="icon-large" width="56" height="56">
  <use href="#custom-icon"></use>
</svg>

I'm not sure if we can do the same here, but you can check if it's possible.

@princevora
Copy link
Contributor Author

Your code works well overall, but I noticed a couple of minor issues that could be improved:

Screencast.From.2024-12-02.13-16-05.mp4
Upon reloading the page, the radio button momentarily appears for a fraction of a second before disappearing.

Screencast.From.2024-12-02.13-17-37.mp4
On the first load of the extension, both options—'Search with' and 'Dropdown selection'—are enabled simultaneously, whereas initially, only the 'Search with' option should be active.

i updated it, it should be good now.

@princevora
Copy link
Contributor Author

Option For Enabling Or Disabling the shortcut search

image

Great. Please rearrange it before search suggestions toggle.. proxy and search suggestions are related.. so adding in between is not good

i also pushed that

index.html Outdated
@@ -563,7 +656,7 @@
<!-- ----------end of searchbar-------------- -->

<!-- ----------search with------------------- -->
<div class="searchWithCont">
<div class="searchWithCont" style="visibility: hidden;;" id="search-with-container">

This comment was marked as resolved.

@prem-k-r

This comment was marked as resolved.

Copy link
Collaborator

@prem-k-r prem-k-r left a comment

Choose a reason for hiding this comment

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

  1. Please remove semi-colon

  2. On first launch it is like this.. it will be better if it start with toggle off
    image

  3. svg placement is bit off... we can fix this later

@prem-k-r
Copy link
Collaborator

prem-k-r commented Dec 2, 2024

Also I suggest if toggle is on then shift rightdiv a little down

@princevora
Copy link
Contributor Author

princevora commented Dec 2, 2024

Is it giving error lol

its all good from my side bro
image

Your page doesnt have the container "Search With"

@princevora
Copy link
Contributor Author

I have updated your suggestions you told me

@prem-k-r
Copy link
Collaborator

prem-k-r commented Dec 2, 2024

Is it giving error lol

its all good from my side bro image

Your page doesnt have the container "Search With"

that was coz of semi color, it's resolved

@princevora
Copy link
Contributor Author

Is it giving error lol

its all good from my side bro ![image](https://private-user-images.githubusercontent.com/122656064/391571007-3c046aa8-
that was coz of semi color, it's resolved

Ohh i see

@princevora
Copy link
Contributor Author

I have added the default as search with option

@prem-k-r
Copy link
Collaborator

prem-k-r commented Dec 2, 2024

just change back padding to what it was
image
Rest seems all good..

(svg one.. i"ll check it)

@princevora
Copy link
Contributor Author

princevora commented Dec 2, 2024

just change back padding to what it was image Rest seems all good..

(svg one.. i"ll check it)

you mean the "typ here" , its done 👍?

@princevora
Copy link
Contributor Author

i hope its all good now

Copy link
Collaborator

@prem-k-r prem-k-r left a comment

Choose a reason for hiding this comment

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

ah sorry,
toggle on -> after reloading page, toggle got off
state not saving

@princevora
Copy link
Contributor Author

ah sorry, toggle on -> after reloading page, toggle got off state not saving

It was calling the function before initializing the html values, its fixed now

Copy link
Collaborator

@prem-k-r prem-k-r left a comment

Choose a reason for hiding this comment

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

great

@XengShi XengShi merged commit e9dafcd into XengShi:main Dec 5, 2024
@prem-k-r
Copy link
Collaborator

prem-k-r commented Dec 5, 2024

I just realised a case.. search engine dropdown menu should hide automatically when resultBox from search suggestions pops up

@princevora princevora deleted the feature/SearchEngineSelection branch December 6, 2024 03:21
@princevora
Copy link
Contributor Author

I just realised a case.. search engine dropdown menu should hide automatically when resultBox from search suggestions pops up

done

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.

4 participants