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

Some features request #50

Closed
sluongng opened this issue Jun 23, 2019 · 12 comments
Closed

Some features request #50

sluongng opened this issue Jun 23, 2019 · 12 comments

Comments

@sluongng
Copy link

Hey I just want to give some suggestion for this project since I am using this extension quite a lot:

  • Refactor the code base. Personally I want to fork and start contributing, unfortunately I am a bit lost when I read the current code. Consider turning off the TSLint, adding in extra EsLint one by one. The final goal should be to have 100% compliance with linters suggestions

  • Adding search result sorting order. For example for me when i press 'O' to search and open a new tab, I would like to be able to customize so that my bookmarks are ordered first on the list, then the search result from the search engine should follow after

  • Add testing. Another way of enabling other contributors is having tests to guide/assure them on the correctness of the implementation. We can start out small but given that this is TypeScript, testing should be rather intuitive.

Let me know your thoughts.

@gdh1995
Copy link
Owner

gdh1995 commented Jun 24, 2019

Firstly, thanks.

TSLint

The TSLint has worked well for months, so why do you want to switch to ESLint? Um, the tslint.json is indeed trimmed a lot by myself. If you think some rules are better, fell free to post them up here.

Refactor

The code is indeed too complicated to read - this is designed on purpose, mainly for the JS-uglifier (terser) to trim code as much as possible, according to some pre-defined macros (Build.* and BuildStr.* in https://github.com/gdh1995/vimium-c/blob/master/types/build/index.d.ts). With this, the distribution packages for Chrome and Firefox are different, so they are smaller and a little faster than a generic one.

Therefore, when you want to get familiar with some code, please ignore those lines containing Build or BuildStr, and all other code has been well-typed.

Search result order

It's a new idea which I haven't seen in https://github.com/philc/vimium/issues. A work-around is:

  • map o Vomnibar.activate and press o in most cases
  • if you want only to search in bookmarks, input :b **** into the Vomnibar input box
  • a prefix of :b means to enter "bookm" mode, and there're also :o, :h, :t and w for "omni", "history", "tabs" and "currentWindowTabs" modes.

Or you may map another key to Vomnibar.activateBookmarksInNewTab, and use it most of the time. Then :o may help.

Testing

Well, it's a much heavier time killer. You see I'm busy (fixing bugs and) adding new features and details, and as a result there're quite a few long-term tasks in #13 (comment) which haven't started, including translating to Chinese and writing a wiki.

Although it's quite helpful to add tests, personally I think, a more urgent need is to write usage wiki for this tool. But as a typical programmer I also dislike writing documents by myself, so this task has been delayed and delayed.

If you or anyone else is interested in adding tests or wiki, I would very appreciate it. Currently I have just one suggestion about the tests code: wrap new code for testing (like exposing some inner objects) by if ( ! Build.NDEBUG ) {...}

@sluongng
Copy link
Author

Hi, thanks a ton for the response!

Here is why you should move from TSLint to ESLint palantir/tslint#4534 (its being deprecated)

I am remapping and using b key. But my idea is more like being able to incorporate multiple search results at the same time into the omnibar and prioritize them accordingly, perhaps even with Tabs to switch between search engines (similar to how you press double Shift (or cmd + shift + A) in IntelliJ

The idea came from firefox address bar where its actually multiple search sources and you can definitely customize it https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places/Frecency_algorithm

I am enjoying the extension.
Cheers

@sluongng
Copy link
Author

to elaborate a bit more on the current search result sorting of 'o' key

image

as you can see the desired result in this case is at the bottom of the list which mean you either have to shift+tab or tab multiple times

@gdh1995
Copy link
Owner

gdh1995 commented Jun 26, 2019

The image is broken on my computer? Could you post it again?

@sluongng
Copy link
Author

image

hit 'o' -> type "youtube sub"

@gdh1995
Copy link
Owner

gdh1995 commented Jun 26, 2019

So is it enough if I add a new mode of Vomnibar (named "bomni" or something else) to make the bookmark suggestions usually have higher scores? Then a map b Vomnibar.activate mode="bomni" will make b an entry for this mode.

@sluongng
Copy link
Author

As long as it bring more customizable options to the table, I am all for it 👍

gdh1995 added a commit that referenced this issue Jun 27, 2019
* entry: ":B" / mode=bomni
* effect: every bookmark item gets a fake visitTime of 5 minute before

This is for
#50 (comment)
@gdh1995
Copy link
Owner

gdh1995 commented Jun 27, 2019

You may have a try: vimium_c-1.75.7-fx.zip (this is compiled from a3fffe0) Too many bugs in this commit. I'm still trying to fix.

@gdh1995
Copy link
Owner

gdh1995 commented Jul 7, 2019

Vimium C 1.76.0 has been released on Firefox Add-ons, so you may have a try of the "bomni" mode.

@sluongng
Copy link
Author

sluongng commented Jul 9, 2019

Hey I am not too sure how to use the "bomni" mode?

I press 'o' to open Omnibar and the type ":B" (capitalized B) + space + but the bookmarked youtube subscription is still sorted lower vs the history youtube videos

Perhaps I didnt understand the commit a3fffe0 fully?

@gdh1995
Copy link
Owner

gdh1995 commented Jul 9, 2019

:B will make bookmarks have a fake visiting time of "5 minutes ago", so if you have opening videos in the past 5 minutes, or some of your history have shorter URLs / more word matches, these history may get a higher score.

If this category's not enough, I have few ideas about what is better.

@gdh1995
Copy link
Owner

gdh1995 commented Jul 11, 2019

So is the ":B" broken? Or do you need higher scores for bookmarks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants