Skip to content

Commit

Permalink
Adjust default options (#15)
Browse files Browse the repository at this point in the history
* Adjusted main description

* Update package lock

* Adjusted default settings and fixed custom settings example

* Written changelog

* Updated dependencies

* Adjusted e2e tests to work with new defaults

* Bump version to 1.1.0

Co-authored-by: Simon Heimler <[email protected]>
  • Loading branch information
Fannon and Simon Heimler authored Sep 15, 2021
1 parent f83f0f9 commit e54e1ec
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 59 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# CHANGELOG

## unreleased
## v1.1.0

- Reduced default base score for open tabs
- Adjusted default options
- precise search is now standard
- history goes back 7 days
- search engines are disabled by default
- Reduced default base score for open tabs

## v1.0.3

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,20 @@ An exemplary user-config can look like the following example:

```json5
{
visitCounter: true, // Show number of visits counter
dateAdded: true, // Show date added for bookmarks
dateAddedBonusScoreMaximum: 20, // Increase max score for recently added bookmarks
general: {
visitCounter: true, // Show number of visits counter
dateAdded: true, // Show date added for bookmarks
},
searchEngines: {
enabled: true, // Enable fallback to search engines
},
}
```

Or a more advanced example

```json5
{
search: {
approach: 'precise', // Use precise instead of fuzzy search
},
history: {
daysAgo: 7,
maxItems: 1024,
Expand All @@ -105,6 +106,7 @@ Or a more advanced example
],
},
searchEngines: {
enabled: true, // Enable fallback to search engines
choices: [
// Use only Google and dict.cc as fallback search engines
{
Expand Down
45 changes: 23 additions & 22 deletions cypress/integration/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,28 @@ describe('Search View', () => {
})

describe('Fuzzy search', () => {
it('can switch to fuzzy search sucessfully', () => {
cy.get('#search-approach-toggle')
.wait(interactionTime)
.contains('PRECISE')
.click()
.wait(interactionTime)
.contains('FUZZY')
.get('#search-input')
.type(`JSON`)
.get('li.bookmark')
.checkNoErrors()
})

it('can execute a fuzzy search sucessfully', () => {
cy.get('#search-input')
cy.get('#search-approach-toggle')
.wait(interactionTime)
.contains('PRECISE')
.click()
.wait(interactionTime)
.contains('FUZZY')
.wait(interactionTime)
.get('#search-input')
.type(`JSON`)
.get('li.bookmark')
.get('#result-list')
Expand All @@ -110,33 +130,14 @@ describe('Search View', () => {
.get('#result-list')
.find('li.tab')
.get('#result-list')
.find('li.search')
.find('li.bookmark')
.checkNoErrors()
})
})

describe('Precise search', () => {
it('can switch to precise search sucessfully', () => {
cy.get('#search-approach-toggle')
.wait(interactionTime)
.contains('FUZZY')
.click()
.wait(interactionTime)
.contains('PRECISE')
.get('#search-input')
.type(`JSON`)
.get('li.bookmark')
.checkNoErrors()
})

it('can execute a fuzzy search sucessfully', () => {
cy.get('#search-approach-toggle')
.wait(interactionTime)
.contains('FUZZY')
.click()
.wait(interactionTime)
.contains('PRECISE')
.wait(initTime)
.get('#search-input')
.type(`JSON`)
.wait(initTime)
Expand All @@ -151,7 +152,7 @@ describe('Search View', () => {
.get('#result-list')
.find('li.tab')
.get('#result-list')
.find('li.search')
.find('li.bookmark')
.checkNoErrors()
})
})
Expand Down
2 changes: 1 addition & 1 deletion manifest.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Browser extension to (fuzzy) search and navigate bookmarks, history and open tabs.",
"homepage_url": "https://github.com/Fannon/search-bookmarks-history-and-tabs",
"author": "Simon Heimler",
"version": "1.0.3",
"version": "1.1.0",
"manifest_version": 2,
"applications": {
"gecko": {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Browser extension to (fuzzy) search and navigate bookmarks, history and open tabs.",
"homepage_url": "https://github.com/Fannon/search-bookmarks-history-and-tabs",
"author": "Simon Heimler",
"version": "1.0.3",
"version": "1.1.0",
"manifest_version": 3,
"permissions": ["tabs", "bookmarks", "history", "storage"],
"action": {
Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "search-bookmarks-history-and-tabs",
"version": "1.0.3",
"version": "1.1.0",
"description": "Browser extension to (fuzzy) search and navigate bookmarks, history and open tabs.",
"main": "index.js",
"dependencies": {
Expand All @@ -12,11 +12,11 @@
"mark.js": "^8.11.1"
},
"devDependencies": {
"cypress": "^8.3.1",
"cypress": "^8.4.0",
"cypress-fail-on-console-error": "^2.1.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-cypress": "^2.12.1",
"live-server": "^1.2.1",
"node-sass": "^6.0.1",
"prettier": "2.4.0",
Expand Down
16 changes: 8 additions & 8 deletions popup/js/model/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ export const defaultOptions = {
/**
* Search approach to use. Choose between:
*
* * 'fuzzy' : Default choice that allows for fuzzy (approximate) search.
* It is faster to index / start up, but may be slower when searching.
* It supports all options.
* Uses the https://fusejs.io/ library
*
* * 'precise' : Alternative search approach that is more precise.
* It may be slower to index / start up, but faster for searching.
* The 'fuzzyness' option will be ignored
* Uses the https://github.com/nextapps-de/flexsearch library
*
* * 'fuzzy' : Default choice that allows for fuzzy (approximate) search.
* It is faster to index / start up, but may be slower when searching.
* It supports all options.
* Uses the https://fusejs.io/ library
*/
approach: 'fuzzy', // 'precise' or 'fuzzy'
approach: 'precise', // 'precise' or 'fuzzy'

/**
* Max search results. Reduce for better performance.
Expand Down Expand Up @@ -87,7 +87,7 @@ export const defaultOptions = {
*/
enabled: true,
/** How many days ago the history should be fetched */
daysAgo: 3,
daysAgo: 7,
/** How many history items should be fetched at most */
maxItems: 512,
/** All history items that start with the URLs given here will be skipped */
Expand All @@ -99,7 +99,7 @@ export const defaultOptions = {
*/
searchEngines: {
/** Enable or disable search engine links in results */
enabled: true,
enabled: false,
/**
* For each entry here, one result will be created - in the order they are defined.
* The URLs need to include the search querystring (see examples).
Expand Down

0 comments on commit e54e1ec

Please sign in to comment.