-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Update search.js polish, bugs fixed, remember/restore last search query and position. #2201
Conversation
funnily enough self is somehow still set while in this handler and points to same element as text_field
All the listeners are already setup by satus.render. code here was doubling them down resulting in Search being performed twice every time.
Seatch text-field (Input) is of type component.skeleton.storage
trigger 'change' event same way as in element.storage.set https://github.com/code-charity/youtube/blob/9c4e5f66e44bbe14cef4d59ce6f5cb1ae5e9d4fc/menu/satus.js#L785
on a quick/superficial glance: (much of all code was originally written for this extension first, then moved to satus)
|
you linked to the search.js keydown bit I am deleting :)
thats the convention used by search.js |
…ialog no more double .close()
we never set style on text-field to begin with, no reason to try and remove it either
… position, restore on search reopen
reverting c29e706 selectionchange works only globally on document doh! This makes it remove listener when its no longer used, no more multiplying global listeners for non existent elements being created every time we render 'text-field'.
…our history queue)
this is it, the big one! :)
fdf3d80 returns categories(buttons) in search. There are limitations - only one element of the same name can be returned. Problem elements are: extension.skeleton.main.layers.section.appearance.on.click.comments - category(button) opening whole card full of options extension.skeleton.main.layers.section.appearance.on.click.comments.on.click.comments - one of those options need to rename one of them |
…a 'button' inside search results second piece of the puzzle to make categories work in search results
aaand thats it.
Search results disappear, Player Category opens.
Search results appear again in same spot it was when being hidden
Shortcut popup appears, Search results are still underneath
again works as expected. Etc etc :-) Few things to look in the future is: 1 remembering Search in History, so instead of clicking Loupe to get back to results user could click "<" back icon and get History. 2 adding ^ icon next to <. < goes Back, ^ would go Up in hierarchy. 3 Clicking on category breadcrumbs (Appearance > Player) in search results automagically redirecting to appropriate pages, enabling:
4 When Extension popup first appears Search is activated with blinking cursor. This is great for discovery! But as soon as user clicks on one of Categories (for example Player) Search should close so Header shows Section name and < back icon. Currently going back is super annoying with having to click two times, first to close search we didnt use, then < back. |
maybe it should be possible? (if satus.js is a framework) |
search input need not overlap the back button.
often will be the same as back / one might be enough. (while we should support tags (multiple categories for on feature)
) |
search.js L37 |
how? I just checked out current master and no errors |
And it could be focused on all pages🤩 Before the input would disappear when empty and on a category page, did that have to change? or should can we get that for now? |
Yes, with much more work it could be redesigned, Ill leave that to someone else :)
afaik sidebar doesnt
if you grey out comments how will you re-enable them? youtube/menu/skeleton-parts/search.js Lines 34 to 37 in f1ab739
there is no need for that check, value is declared one line above as this.value, 'this' is Input element, those are guaranteed by html standard https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement to have string .value. What I meant is How did you trigger that error :), because I cant trigger any. Is it possible you didnt restart full extension before testing? or didnt download all the changed files?
more clutter
isnt it enough with search being active when opening Options Popup?
Imo Options Popup starting with Search active is great, and the way it works now with empty query keeping it open while showing main skeleton.js is also great. |
hi! @raszpl and thanks!!
sorry if so! i'll just say this here again, just in case you invest more time here.
(The 9 red buttons also are just "tags" 😅 Doesn't matter if something is our 1st-, 2nd- or 3rd-level category) |
yes, just because (at mine) search currently stayed visible now in the categories, unlike before.
oh, and what this actually 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 .
until i added "hide sidebar" in the end😅. (
Yes, *i guess*, then the blocks would have a red X or Trashbin icon at the parent level "appearance". (except player unless somebody wants transcript only). ) |
Weird, I could have sworn it was working like that before :o I just tested 4.823 and you are totally right! I had to change something, didnt notice, and later convinced myself it was like that from the start :] Ill fix that later.
That is clever, but confusing for people not expecting it, and undiscoverable.
oh, thats easy to add. Dont know about red X, but something subtle to signal to the user that this whole category has no active options would be nice. |
🚫. Yes, while semantically / structurally making sense, i assume the few features hiding a whole sections most arent used very often in improvedtube. ( should start counting: #1972 (comment) )
(while i mentioned this word in several threads/thoughts about structure. Active features and all features could be two icons on the front screen/always: my active features[🧰my toolbox & 🗑️trashbin]. Features to remove-clean-reduce or revert-undo youtube could have their own list (https://chromewebstore.google.com/detail/unhook-remove-youtube-rec/khncfooichmfjbepaaaebmommgaepoid ) like a search for remove|hide|block & not enabled, ordered by popularity and recency(new features), starting with youtube's experiment flags set to true, that the extension never heard of yet. With up to 730 in the end that could be disabled too but might be [known] marginal https://docs.google.com/spreadsheets/d/1GidvMduxTl6jXpDCKj-sOPg8KSqDfCYO2OlCdBADaSI/edit?pli=1#gid=0 ) |
*with a little layout change search can always stay visible too. |
Update search.js keydown is redundant, input handles same case
Update search.js clean variable mess
Update search.js text_field was always broken
Update satus.js removing redundant addEventListener
All the listeners are already setup by satus.render. code here was doubling them down resulting in Search being performed twice every time.
Update satus.js respect storage: false on text-field elements
Seatch text-field (Input) is of type component.skeleton.storage: false
Update satus.js propagate manual change 'text-field' value
trigger 'change' event same way as in element.storage.set
youtube/menu/satus.js
Line 785 in 9c4e5f6
Update satus.js more graceful handling of clicking outside of modal dialog
no more double .close()
Update search.js phantom style set
we never set style on text-field to begin with, no reason to try and remove it either
Update satus.js stop adding storage component to storage: false elements
Update satus.js make ok() cancel() optional for modal.confirm simplified variant
Update search.js remember last search query and search_results scroll position, restore on search reopen
Update skeleton.js search restore variables