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

Fix Search feature #1935

Open
unnamed-orbert opened this issue Jan 12, 2024 · 13 comments
Open

Fix Search feature #1935

unnamed-orbert opened this issue Jan 12, 2024 · 13 comments
Assignees
Labels
Completion / Revision Rethink, complete, improve, tweak our feature or structure. Feature request Wish or idea help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) 🧩Plan ready Solution or some specification noted; To-Do; steps for implementation (+raw brainstorming too maybe) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥

Comments

@unnamed-orbert
Copy link
Contributor

Was thinking here... @ImprovedTube
Our project's research is a bit broken!
Would it be possible to use the translation list keys as a database for searching?
instead of trying to pull the IDs in the files?

@unnamed-orbert unnamed-orbert added Feature request Wish or idea good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels Jan 12, 2024
@unnamed-orbert
Copy link
Contributor Author

#1916 #1921 #1925

@ImprovedTube
Copy link
Member

ImprovedTube commented Jan 12, 2024

oh 💡 thats what you meant. For sure, search is very simple/broken still. Only works for one word.

  • Could search in synonyms

  • All locales to support search input in all languages at once.

#1886

#339 #1171 #890 #1634 #1660 #1566

@unnamed-orbert unnamed-orbert removed good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels Jan 12, 2024
@ImprovedTube ImprovedTube added help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels Jan 13, 2024
@catbrew
Copy link

catbrew commented Jan 14, 2024

I searched for a few options and they worked as intended but I encountered some strange behavior while looking for picture in picture:
I searched for "pip":
image
The result's good and it doesn't even say pip, but a result that does say pip did not come up:
image
Then I tried searching for "pic" and I should have got many results but only these two showed up:
image

@ImprovedTube
Copy link
Member

ImprovedTube commented Jan 26, 2024

hi @amamelia
yes, search features does too little / wrong yet.

  • the searches are matched from the start of a word not the end

good

seems it searches also here in the name.

below_player_pip: {
component: 'switch',
text: 'pictureInPicture',
value: true
},

  • Yet it should also show the full subsection name "Buttons" in the search Appearance > Details > Extra buttons.

  • we also have tags defined preparing alternative lists such as hiding stuff / trashbin candidates. (like "unhook")
    however this also seem not to be considered by the search.

    tags: "remove,hide"

@raszpl
Copy link
Contributor

raszpl commented Mar 4, 2024

use the translation list keys as a database for searching

just did that in pull request

@ImprovedTube
Copy link
Member

thank you! @raszpl

  • we should also search in the "tags" and put those results at the end after a <hr> (the only ones when nothing/little is found otherwise)

  • if the locale is set to pt_BR we also check 2. pt 3. en unless chrome://settings/languages has a different order of languages set:

    youtube/menu/satus.js

    Lines 1038 to 1087 in b412f2d

    function importLocale(locale, successCallback) {
    var url = chrome.runtime.getURL(path + locale + '/messages.json');
    fetch(url)
    .then(response => response.ok ? response.json() : {})
    .then(data => {
    for (var key in data) {
    if (!satus.locale.data[key]) {
    satus.locale.data[key] = data[key].message;
    }
    }
    })
    .catch(() => {})
    .finally(() => successCallback && successCallback());
    }
    if (code) { var language = code.replace('-', '_');
    if (language.indexOf('_') !== -1) {
    importLocale(language, () => importLocale(language.split('_')[0], () => importLocale('en', callback)));
    } else {
    importLocale(language, () => importLocale('en', callback));
    }}
    else { // try chrome://settings/languages:
    try{chrome.i18n.getAcceptLanguages(function (languages) {
    languages = languages.map(language => language.replace('-', '_'));
    for (let i = languages.length - 1; i >= 0; i--) {
    if (languages[i].includes('_')) {
    let languageWithoutCountryCode = languages[i].substring(0, 2);
    if (!languages.includes(languageWithoutCountryCode)) {
    languages.splice(i + 1, 0, languageWithoutCountryCode);
    }
    }
    }
    languages.includes("en") || languages.push("en");
    languages.forEach((language, index) => index === languages.length - 1 ? importLocale(language, callback) : importLocale(language, () => {}));
    /* equals:
    languages.length === 1 && importLocale(languages[0], callback);
    languages.length === 2 && importLocale(languages[0], () => importLocale(languages[1], callback));
    languages.length === 3 && importLocale(languages[0], () => importLocale(languages[1], () => importLocale(languages[2], callback)));
    ... */
    // console.log(languages);
    });} catch(error) {
    // Finally, if code nor chrome://settings/languages are available, use window.navigator.language:
    var language = window.navigator.language.replace('-', '_');
    if (language.indexOf('_') !== -1) {
    importLocale(language, () => importLocale(language.split('_')[0], () => importLocale('en', callback)));
    } else {
    importLocale(language, () => importLocale('en', callback));
    }

    ( achieving the same result as chrome.i18n.getMessage, besides not yet covering messages with parameters
    https://developer.chrome.com/docs/extensions/how-to/ui/localization-message-formats#example )


  • ( at zero results we could also search in all languages - or we could check if the search input is part of a specific alphabet. )

@ImprovedTube
Copy link
Member

  • 0 results for: import, export, API, CSS, JavaScript (sections: backup; developer) - Somehow these were excluded but needn't be (also: Why dont Analytics graph, Mixer & custom css/js work since years? #1658)
  • include categories in search. (0 results for header. ).
    • Somehow the right feature should appear when searching hide header or header hidden. And the category path like appearance : header should be two links (breadcrumbs navigation)
  • Sub features like repeat and repeat:always. Both should only appear when searching "repeat"
  • no less than 1 result needs to appear when searching "repeat xyz", filtering further can stop as soon as only the 1 result is there.

@raszpl
Copy link
Contributor

raszpl commented Apr 9, 2024

I think all those are treated as categories/menu entries leading further, like Subtitles under Player. Its not an option, its a button opening another menu.

  • include categories in search. (0 results for header. ).

yep

  • Somehow the right feature should appear when searching hide header or header hidden.

"somehow" indeed :) how? including section/menu name will lead to returning a ton of spurious results. When I search Player I want player popup, I dont want all the contents of whole Player menu all at once.

And the category path like appearance : header should be two links (breadcrumbs navigation)

Yep, I already planned to somehow make category paths clickable for faster navigation.

  • Sub features like repeat and repeat:always. Both should only appear when searching "repeat"

Its badly named. Already suggested renaming it to "Always repeat" - problem solved ;-) + We should never enable features in a way its hidden from user (always repeat without Repeat button, Cinema mode without Cinema button etc).

  • no less than 1 result needs to appear when searching "repeat xyz", filtering further can stop as soon as only the 1 result is there.

dont understand this one

@ImprovedTube ImprovedTube added the Bug Bug or required update after YouTube changes label Apr 20, 2024
@ImprovedTube
Copy link
Member

I think all those are treated as categories

the whole section backup&reset is missing including the buttons: try import, cookies, reset

Yep, I already planned to somehow make category paths clickable for faster navigation.

❤️

dont understand this one

Search can stop listening to further input, once the number of results was only 1 already for the previous character entered.
( more unexpected UX focus 😅: #1565 )

"somehow" indeed :) how? ... When I search Player I want player popup, I don't want all the contents of whole Player menu all at once.

the whole path should always be searched, just like tags & synonyms (if you only search player, then you get 10 results now which are random, while 35 would be more accurate. Since it's the least specific search to make next to 'appearance')

for search, the structure can be by function only:
(path & tags) function: standard options unique options
(player music enjoy musician rehearse) repeat: shortcut, button, by default ("always")
(player speed listening) speed: shortcut, permanent, exceptions :music, education, whitelist: gaming, sports
(player capture) screenshot-file: shortcut, button, when paused for longer than: x seconds,
(player capture) screenshot-copy: shortcut, button
(player capture) .gif: button, shortcut start/stop, automatically take a .gif of the most viewed 1%, if i watched it (#1463)
(youtube appearance) header: hide, transparent, hover

While the function matters most (could have more weight in search), but all words in the whole line should lead to it.

While our lists like "shortcuts" (or sub-sections "buttons") are not features / broad, but just might be convenient/a habit to go through all of them in a row. And at least "tidy/trashbin" will be appreciated all in a row.
Yet this order doesn't matter for search, if search is structured by main functionality like the example.

youtube screenshot

badly named
should never

(besides that most of our features yet are permanent set and forget yet and buttons are more of a work in progress #1445 )

@ImprovedTube ImprovedTube added 🧩Plan ready Solution or some specification noted; To-Do; steps for implementation (+raw brainstorming too maybe) Completion / Revision Rethink, complete, improve, tweak our feature or structure. labels Apr 20, 2024
@raszpl
Copy link
Contributor

raszpl commented Apr 23, 2024

I think all those are treated as categories

the whole section backup&reset is missing including the buttons: try import, cookies, reset

those are all component: 'button', #2200 but its not enough. There needs to be mechanism added that automagically closes Search results when someone clicks on a button. It will also be needed if I make Categories (Appearance > Player) clickable.

dont understand this one

Search can stop listening to further input, once the number of results was only 1 already for the previous character entered.

how? and why? what if user wants to click backspace? :)

"somehow" indeed :) how? ... When I search Player I want player popup, I don't want all the contents of whole Player menu all at once.

the whole path should always be searched, just like tags & synonyms (if you only search player, then you get 10 results now which are random

not random, those are all settings with "player" in name

, while 35 would be more accurate. Since it's the least specific search to make next to 'appearance')

This is bad, searching "player" would display whole contents of player.js and appearance.js/player submenus.

for search, the structure can be by function only: (path & tags) function: standard options unique options (player music enjoy musician rehearse) repeat: shortcut, button, by default ("always") (player speed listening) speed: shortcut, permanent, exceptions :music, education, whitelist: gaming, sports (player capture) screenshot-file: shortcut, button, when paused for longer than: x seconds, (player capture) screenshot-copy: shortcut, button (player capture) .gif: button, shortcut start/stop, automatically take a .gif of the most viewed 1%, if i watched it (#1463) (youtube appearance) header: hide, transparent, hover

While the function matters most (could have more weight in search), but all words in the whole line should lead to it.

Dont understand at all :) Start with just one example :]

One thing that annoys me is:

  • search for "capture"
  • click in the blurred area under result

Search results gets closed/vanishes, but satus-header still shows Search active with "capture" search word and X. I see two options to remedy this.
Easy one - leave it as is, but make clicking again on satus-header where Search is showing "capture" reopen Search results below.
Complicated to implement - auto close satus-header Search, but remember searched word "capture", so next time user clicks Magnifying Glass icon it goes back to "capture" and shows results below.

@raszpl
Copy link
Contributor

raszpl commented Apr 26, 2024

#2201

@ImprovedTube
Copy link
Member

Easy one - leave it as is, but make clicking again on satus-header where Search is showing "capture" reopen Search results below.

Yay! Or search could appear always, and listen to all non navigation word-character input permanently (said before) (Sections are just extra tags, filters; Section names and search could share the same input; etc.)

made me think of, that search could still listen to keyboard input while in a path since we don't need keyboard input.

...except😅 maybe tab, space, page-up, page-down & arrows .
And + btw, advanced thoughts

@ImprovedTube
Copy link
Member

not random, those are all settings with "player" in name

which is not necessarily consistent and missing relevant ones.

This is bad, searching "player" would display whole contents of player.js and appearance.js/player submenus.

bad just the most common(=irrelevant) word to search here. (still efficient enough if it showed half of all features, (maybe one would want to explore the whole list in two steps first by "player" and than by "-player"?). For a user clicking "player" is just a synonym for searching "player" (?) - So what should appear both times is approx. player.js and appearance.js/player below and more.

one example

😅. Any! Was just pondering semantics. you might have more sympathy for this considering the long term #2251. The 2nd column "function" is most specific for the order/ranking of search results. And a match in the 5th col too, but 5th will often have only one result often. (So there could be a <hr> and extra results also for the and col ("function") that the found unique option belongs to.

While the 3rd & 4rd col are a bit auxiliary (besides that they can be a list (the user could want the whole list for example saying "buttons" plural). And each of these thing has almost perfect synonym (by default permanent set&forget) (button switch toggle)

(1) lists / tags (2) function: (3) common options (4) less common options (5) unique options / "robots"
(player, music, enjoy, musician, rehearse) repeat: shortcut, button by default ("always")
(player, speed, listening) speed: shortcut, , permanent category-exceptions:(music, education) only by category(gaming, sports) (Feature Request)
(player, capture) screenshot-file: shortcut, button, auto, when paused for longer than: x seconds (Feature Request)
(player, capture) screenshot-copy: shortcut, button
(player, capture) .gif: button, shortcut start/stop, automatically take a .gif of the most viewed 1%, if i watched it (#1463)(Feature Request)
(youtube, appearance) header: hide transparent, hover

@ImprovedTube ImprovedTube removed the Bug Bug or required update after YouTube changes label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Completion / Revision Rethink, complete, improve, tweak our feature or structure. Feature request Wish or idea help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) 🧩Plan ready Solution or some specification noted; To-Do; steps for implementation (+raw brainstorming too maybe) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥
Projects
None yet
Development

No branches or pull requests

4 participants