diff --git a/CHANGELOG.md b/CHANGELOG.md index f709a89..c455dcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [unreleased] +## [v1.8.8] + +- **FIXED**: Fuzzy search now also works with non-ASCII characters like CKJ chars by default +- **FIXED**: Option `bookmarkColor` now also applies to the bookmark folder badge in the search results +- **REMOVED**: Removed hybrid search as the benefits / differences against new fuzzy search are negligible. + ## [v1.8.7] - **NEW**: New option `uFuzzyOptions` that allows to configure the fuzzy search library used by this extension diff --git a/README.md b/README.md index 1fb2b7b..6c8bc91 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ It supports three different search approaches: - **Exact search** (case-insensitive, but exact matching): Faster, but only exact matching results. - **Fuzzy search** (approximate matching): Slower, but includes also inexact (fuzzy) matches. -- **Hybrid search** (combination): Combines results of both approaches. With this extension you can also **tag your bookmarks** including auto completions. The tags are considered when searching and can be used for navigation. diff --git a/cypress/e2e/search.cy.js b/cypress/e2e/search.cy.js index 1a311d8..d12f32f 100644 --- a/cypress/e2e/search.cy.js +++ b/cypress/e2e/search.cy.js @@ -183,53 +183,6 @@ describe('Search View', () => { .checkNoErrors() }) - describe('Hybrid search', () => { - it('can switch to hybrid search successfully', () => { - cy.get('#search-approach-toggle') - .wait(interactionTime) - .contains('PRECISE') - .click() - .wait(interactionTime) - .contains('FUZZY') - .click() - .wait(interactionTime) - .contains('HYBRID') - .get('#search-input') - .type(`JSON`) - .get('li.bookmark') - .checkNoErrors() - }) - - it('can execute a hybrid search successfully', () => { - cy.get('#search-approach-toggle') - .wait(interactionTime) - .contains('PRECISE') - .click() - .wait(interactionTime) - .contains('FUZZY') - .click() - .wait(interactionTime) - .contains('HYBRID') - .wait(interactionTime) - .get('#search-input') - .type(`JSON`) - .get('li.bookmark') - .get('#result-list') - .should('not.have.length', 0) - .find('[x-original-id=9]') - // Check that we have all kinds of results - .get('#result-list') - .find('li.bookmark') - .get('#result-list') - .find('li.history') - .get('#result-list') - .find('li.tab') - .get('#result-list') - .find('li.bookmark') - .checkNoErrors() - }) - }) - describe('Bookmark search', () => { it('Empty search returns recent bookmarks', () => { cy.get('#search-input') diff --git a/images/logo-128.png b/images/logo-128.png index 469a37b..1d7dbff 100644 Binary files a/images/logo-128.png and b/images/logo-128.png differ diff --git a/images/logo-32.png b/images/logo-32.png index e53da3f..a34b9f5 100644 Binary files a/images/logo-32.png and b/images/logo-32.png differ diff --git a/images/logo-48.png b/images/logo-48.png index e02281e..1a813e7 100644 Binary files a/images/logo-48.png and b/images/logo-48.png differ diff --git a/images/logo-64.png b/images/logo-64.png index 84d6096..15efc00 100644 Binary files a/images/logo-64.png and b/images/logo-64.png differ diff --git a/images/promo-1400.png b/images/promo-1400.png index 04f0a4c..4ed79d5 100644 Binary files a/images/promo-1400.png and b/images/promo-1400.png differ diff --git a/images/promo-300.png b/images/promo-300.png index 0aa2417..a79265c 100644 Binary files a/images/promo-300.png and b/images/promo-300.png differ diff --git a/images/promo-440-alt.png b/images/promo-440-alt.png index 5256d85..4d2f301 100644 Binary files a/images/promo-440-alt.png and b/images/promo-440-alt.png differ diff --git a/images/promo-440.png b/images/promo-440.png index 218296b..97be01d 100644 Binary files a/images/promo-440.png and b/images/promo-440.png differ diff --git a/images/promo-920.png b/images/promo-920.png index 8280e77..d57a25a 100644 Binary files a/images/promo-920.png and b/images/promo-920.png differ diff --git a/images/x.svg b/images/x.svg index 9f305a7..9202bfb 100644 --- a/images/x.svg +++ b/images/x.svg @@ -1,3 +1,4 @@ + diff --git a/manifest.firefox.json b/manifest.firefox.json index 50b0fab..8d5b313 100644 --- a/manifest.firefox.json +++ b/manifest.firefox.json @@ -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.8.6", + "version": "1.9.0", "manifest_version": 2, "applications": { "gecko": { diff --git a/manifest.json b/manifest.json index 9e21ed7..fd4e401 100644 --- a/manifest.json +++ b/manifest.json @@ -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.8.6", + "version": "1.9.0", "manifest_version": 3, "permissions": ["tabs", "bookmarks", "history", "storage"], "action": { diff --git a/package-lock.json b/package-lock.json index ff60fa4..f8565bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,30 +1,30 @@ { "name": "search-bookmarks-history-and-tabs", - "version": "1.8.6", + "version": "1.9.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "search-bookmarks-history-and-tabs", - "version": "1.8.6", + "version": "1.9.0", "license": "MIT", "dependencies": { "@leeoniya/ufuzzy": "^1.0.6", - "@yaireo/tagify": "^4.17.7", + "@yaireo/tagify": "^4.17.8", "bulma": "^0.9.4", "js-yaml": "^4.1.0", "mark.js": "^8.11.1" }, "devDependencies": { - "cypress": "^12.9.0", + "cypress": "^12.11.0", "cypress-fail-on-console-error": "^4.0.2", - "eslint": "^8.37.0", + "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", - "eslint-plugin-cypress": "^2.13.2", + "eslint-plugin-cypress": "^2.13.3", "live-server": "^1.2.2", - "prettier": "2.8.7", + "prettier": "2.8.8", "prettier-eslint": "^15.0.1", - "sass": "^1.60.0" + "sass": "^1.62.1" } }, "node_modules/@cypress/request": { @@ -123,9 +123,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz", - "integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A==", + "version": "8.39.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz", + "integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -397,9 +397,9 @@ } }, "node_modules/@yaireo/tagify": { - "version": "4.17.7", - "resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-4.17.7.tgz", - "integrity": "sha512-kMk179PY4aXdc5tIw4t65I6IvB5Dyes30DF0XTUagqcCe+pCyi60g4eUGScFsJByF/u25An0RkVqZ4+IcPVxVg==", + "version": "4.17.8", + "resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-4.17.8.tgz", + "integrity": "sha512-MqU3JhE/35r8qZPgfLshXfOkTkgtFEXh2Ja8J3Nn1rPuut28yorJLtxH67jbrbanE1gFH2vCvxe6meqM6oZ8rA==", "peerDependencies": { "prop-types": "^15.7.2" } @@ -1261,9 +1261,9 @@ } }, "node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, "engines": { "node": ">= 6" @@ -1363,9 +1363,9 @@ } }, "node_modules/cypress": { - "version": "12.9.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.9.0.tgz", - "integrity": "sha512-Ofe09LbHKgSqX89Iy1xen2WvpgbvNxDzsWx3mgU1mfILouELeXYGwIib3ItCwoRrRifoQwcBFmY54Vs0zw7QCg==", + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.11.0.tgz", + "integrity": "sha512-TJE+CCWI26Hwr5Msb9GpQhFLubdYooW0fmlPwTsfiyxmngqc7+SZGLPeIkj2dTSSZSEtpQVzOzvcnzH0o8G7Vw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -1383,7 +1383,7 @@ "check-more-types": "^2.24.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", - "commander": "^5.1.0", + "commander": "^6.2.1", "common-tags": "^1.8.0", "dayjs": "^1.10.4", "debug": "^4.3.4", @@ -1401,7 +1401,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.6", + "minimist": "^1.2.8", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", @@ -1645,15 +1645,15 @@ } }, "node_modules/eslint": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz", - "integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==", + "version": "8.39.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz", + "integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.2", - "@eslint/js": "8.37.0", + "@eslint/js": "8.39.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -1663,7 +1663,7 @@ "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", + "eslint-scope": "^7.2.0", "eslint-visitor-keys": "^3.4.0", "espree": "^9.5.1", "esquery": "^1.4.2", @@ -1714,9 +1714,9 @@ } }, "node_modules/eslint-plugin-cypress": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.13.2.tgz", - "integrity": "sha512-LlwjnBTzuKuC0A4H0RxVjs0YeAWK+CD1iM9Dp8un3lzT713ePQxfpPstCD+9HSAss8emuE3b2hCNUST+NrUwKw==", + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.13.3.tgz", + "integrity": "sha512-nAPjZE5WopCsgJwl3vHm5iafpV+ZRO76Z9hMyRygWhmg5ODXDPd+9MaPl7kdJ2azj+sO87H3P1PRnggIrz848g==", "dev": true, "dependencies": { "globals": "^11.12.0" @@ -1735,9 +1735,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", + "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -1745,6 +1745,9 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { @@ -3837,10 +3840,13 @@ } }, "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/mixin-deep": { "version": "1.3.2", @@ -4363,9 +4369,9 @@ } }, "node_modules/prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -4780,9 +4786,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.60.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.60.0.tgz", - "integrity": "sha512-updbwW6fNb5gGm8qMXzVO7V4sWf7LMXnMly/JEyfbfERbVH46Fn6q02BX7/eHTdKpE7d+oTkMMQpFWNUMfFbgQ==", + "version": "1.62.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.62.1.tgz", + "integrity": "sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -4793,7 +4799,7 @@ "sass": "sass.js" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/semver": { @@ -6121,9 +6127,9 @@ } }, "@eslint/js": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz", - "integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A==", + "version": "8.39.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz", + "integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==", "dev": true }, "@humanwhocodes/config-array": { @@ -6325,9 +6331,9 @@ } }, "@yaireo/tagify": { - "version": "4.17.7", - "resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-4.17.7.tgz", - "integrity": "sha512-kMk179PY4aXdc5tIw4t65I6IvB5Dyes30DF0XTUagqcCe+pCyi60g4eUGScFsJByF/u25An0RkVqZ4+IcPVxVg==", + "version": "4.17.8", + "resolved": "https://registry.npmjs.org/@yaireo/tagify/-/tagify-4.17.8.tgz", + "integrity": "sha512-MqU3JhE/35r8qZPgfLshXfOkTkgtFEXh2Ja8J3Nn1rPuut28yorJLtxH67jbrbanE1gFH2vCvxe6meqM6oZ8rA==", "requires": {} }, "accepts": { @@ -6965,9 +6971,9 @@ } }, "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true }, "common-tags": { @@ -7051,9 +7057,9 @@ } }, "cypress": { - "version": "12.9.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.9.0.tgz", - "integrity": "sha512-Ofe09LbHKgSqX89Iy1xen2WvpgbvNxDzsWx3mgU1mfILouELeXYGwIib3ItCwoRrRifoQwcBFmY54Vs0zw7QCg==", + "version": "12.11.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.11.0.tgz", + "integrity": "sha512-TJE+CCWI26Hwr5Msb9GpQhFLubdYooW0fmlPwTsfiyxmngqc7+SZGLPeIkj2dTSSZSEtpQVzOzvcnzH0o8G7Vw==", "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -7070,7 +7076,7 @@ "check-more-types": "^2.24.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", - "commander": "^5.1.0", + "commander": "^6.2.1", "common-tags": "^1.8.0", "dayjs": "^1.10.4", "debug": "^4.3.4", @@ -7088,7 +7094,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.6", + "minimist": "^1.2.8", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", @@ -7279,15 +7285,15 @@ "dev": true }, "eslint": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz", - "integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==", + "version": "8.39.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz", + "integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", "@eslint/eslintrc": "^2.0.2", - "@eslint/js": "8.37.0", + "@eslint/js": "8.39.0", "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -7297,7 +7303,7 @@ "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", + "eslint-scope": "^7.2.0", "eslint-visitor-keys": "^3.4.0", "espree": "^9.5.1", "esquery": "^1.4.2", @@ -7334,9 +7340,9 @@ "requires": {} }, "eslint-plugin-cypress": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.13.2.tgz", - "integrity": "sha512-LlwjnBTzuKuC0A4H0RxVjs0YeAWK+CD1iM9Dp8un3lzT713ePQxfpPstCD+9HSAss8emuE3b2hCNUST+NrUwKw==", + "version": "2.13.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.13.3.tgz", + "integrity": "sha512-nAPjZE5WopCsgJwl3vHm5iafpV+ZRO76Z9hMyRygWhmg5ODXDPd+9MaPl7kdJ2azj+sO87H3P1PRnggIrz848g==", "dev": true, "requires": { "globals": "^11.12.0" @@ -7351,9 +7357,9 @@ } }, "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", + "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -8990,9 +8996,9 @@ } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, "mixin-deep": { @@ -9400,9 +9406,9 @@ "dev": true }, "prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true }, "prettier-eslint": { @@ -9708,9 +9714,9 @@ "dev": true }, "sass": { - "version": "1.60.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.60.0.tgz", - "integrity": "sha512-updbwW6fNb5gGm8qMXzVO7V4sWf7LMXnMly/JEyfbfERbVH46Fn6q02BX7/eHTdKpE7d+oTkMMQpFWNUMfFbgQ==", + "version": "1.62.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.62.1.tgz", + "integrity": "sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0", diff --git a/package.json b/package.json index 67fcf17..c804acb 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,25 @@ { "name": "search-bookmarks-history-and-tabs", - "version": "1.8.6", + "version": "1.9.0", "description": "Browser extension to (fuzzy) search and navigate bookmarks, history and open tabs.", "main": "index.js", "dependencies": { "@leeoniya/ufuzzy": "^1.0.6", - "@yaireo/tagify": "^4.17.7", + "@yaireo/tagify": "^4.17.8", "bulma": "^0.9.4", "js-yaml": "^4.1.0", "mark.js": "^8.11.1" }, "devDependencies": { - "cypress": "^12.9.0", + "cypress": "^12.11.0", "cypress-fail-on-console-error": "^4.0.2", - "eslint": "^8.37.0", + "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", - "eslint-plugin-cypress": "^2.13.2", + "eslint-plugin-cypress": "^2.13.3", "live-server": "^1.2.2", - "prettier": "2.8.7", + "prettier": "2.8.8", "prettier-eslint": "^15.0.1", - "sass": "^1.60.0" + "sass": "^1.62.1" }, "scripts": { "clean": "rm -rf ./dist", diff --git a/popup/js/model/options.js b/popup/js/model/options.js index 33dabf5..07d4637 100644 --- a/popup/js/model/options.js +++ b/popup/js/model/options.js @@ -33,10 +33,8 @@ export const defaultOptions = { * It has a moderate impact on init performance, and is slower when searching. * It supports all options. * Uses https://github.com/leeoniya/uFuzzy - * - * * 'hybrid': Hybrid that uses both 'precise' and 'fuzzy' algorithms combined */ - searchStrategy: 'precise', // 'precise' or 'fuzzy' or 'hybrid' + searchStrategy: 'precise', // 'precise' or 'fuzzy' /** * Max search results. Reduce for better performance. * Does not apply for tag and folder search @@ -286,17 +284,6 @@ export const defaultOptions = { */ scoreCustomSearchEngineBaseScore: 500, - /** - * If in hybrid mode, this is the score bonus or malus for precise results - * This can be positive or negative - */ - scoreHybridPreciseBonus: 40, - /** - * If in hybrid mode, this is the score bonus or malus for fuzzy results - * This can be positive or negative - */ - scoreHybridFuzzyBonus: -10, - // FIELD WEIGHTS // Depending on in which field the search match was found, // the match gets a multiplier applied on how important the match is. @@ -440,12 +427,14 @@ export async function getUserOptions() { if (ext.browserApi.runtime.lastError) { return reject(ext.browserApi.runtime.lastError) } - return resolve(result.userOptions || emptyOptions) + const userOptions = migrateOptions(result.userOptions || emptyOptions) + return resolve(userOptions) }) } else { console.warn('No storage API found. Falling back to local Web Storage') - const userOptions = window.localStorage.getItem('userOptions') - return resolve(userOptions ? JSON.parse(userOptions) : emptyOptions) + const userOptionsString = window.localStorage.getItem('userOptions') + const userOptions = migrateOptions(userOptionsString ? JSON.parse(userOptionsString) : emptyOptions) + return resolve(userOptions) } } catch (err) { return reject(err) @@ -483,3 +472,10 @@ export function validateUserOptions(userOptions) { } } } + +function migrateOptions(userOptions) { + if (userOptions && userOptions.searchStrategy === 'hybrid') { + userOptions.searchStrategy = 'fuzzy' + } + return userOptions +} diff --git a/popup/js/search/common.js b/popup/js/search/common.js index b71c433..988bd88 100644 --- a/popup/js/search/common.js +++ b/popup/js/search/common.js @@ -110,25 +110,10 @@ export async function search(event) { ext.model.result.push(...(await searchWithAlgorithm('fuzzy', searchTerm, searchMode))) } else if (ext.opts.searchStrategy === 'precise') { ext.model.result.push(...(await searchWithAlgorithm('precise', searchTerm, searchMode))) - } else if (ext.opts.searchStrategy === 'hybrid') { - // in this search mode, both precise and hybrid search is executed - // and the search results are merged, with precise results given precedence. - const preciseResultIndexes = {} - const preciseResults = await searchWithAlgorithm('precise', searchTerm, searchMode) - const fuzzyResults = await searchWithAlgorithm('fuzzy', searchTerm, searchMode) - for (const preciseResult of preciseResults) { - preciseResult.searchApproach = 'precise' - ext.model.result.push(preciseResult) - preciseResultIndexes[preciseResult.index] = true - } - for (const fuzzyResult of fuzzyResults) { - if (!preciseResultIndexes[fuzzyResult.index]) { - fuzzyResult.searchApproach = 'fuzzy' - ext.model.result.push(fuzzyResult) - } - } } else { - throw new Error(`Unsupported option "search.approach" value: "${ext.opts.searchStrategy}"`) + console.error(`Unsupported option "search.approach" value: "${ext.opts.searchStrategy}"`) + // Fall back to use precise search instead of crashing entirely + ext.model.result.push(...(await searchWithAlgorithm('precise', searchTerm, searchMode))) } // Add search engine result items @@ -240,15 +225,6 @@ export function calculateFinalScore(results, searchTerm) { throw new Error(`Search result type "${el.type}" not supported`) } - // Hybrid search: Add bonus / malus for precise and fuzzy matches - if (ext.opts.searchStrategy === 'hybrid') { - if (el.searchApproach === 'precise') { - score += ext.opts.scoreHybridPreciseBonus - } else if (el.searchApproach === 'fuzzy') { - score += ext.opts.scoreHybridFuzzyBonus - } - } - // Multiply by search library score. // This will reduce the score if the search is not a good match score = score * (el.searchScore || ext.opts.scoreTitleWeight) diff --git a/popup/js/view/searchView.js b/popup/js/view/searchView.js index 211366f..a66fb63 100644 --- a/popup/js/view/searchView.js +++ b/popup/js/view/searchView.js @@ -364,8 +364,6 @@ export async function toggleSearchApproach() { if (ext.opts.searchStrategy === 'precise') { ext.opts.searchStrategy = 'fuzzy' - } else if (ext.opts.searchStrategy === 'fuzzy') { - ext.opts.searchStrategy = 'hybrid' } else { ext.opts.searchStrategy = 'precise' } @@ -388,8 +386,5 @@ export function updateSearchApproachToggle() { } else if (ext.opts.searchStrategy === 'precise') { ext.dom.searchApproachToggle.innerText = 'PRECISE' ext.dom.searchApproachToggle.classList = 'precise' - } else if (ext.opts.searchStrategy === 'hybrid') { - ext.dom.searchApproachToggle.innerText = 'HYBRID' - ext.dom.searchApproachToggle.classList = 'hybrid' } } diff --git a/popup/tips.html b/popup/tips.html index 7bba551..0b57ab3 100644 --- a/popup/tips.html +++ b/popup/tips.html @@ -13,8 +13,7 @@
Search Strategies: Switch between PRECISE (faster, exact), - FUZZY (slower, more results, fuzzy) or - HYBRID (combination) by clicking on the indicator button right of the search bar. + FUZZY (slower, more results, fuzzy)
Keyboard Shortcut: Trigger the extension via keyboard.
diff --git a/sass/style.scss b/sass/style.scss index 3fc2344..8f0221c 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -336,9 +336,6 @@ code { .precise { color: #b1d354; } - .hybrid { - color: #54c4d3; - } } /** CUSTOMIZE TAGIFY STYLE */ @@ -455,9 +452,6 @@ code { #search-approach-toggle.precise { color: #b1d354; } - #search-approach-toggle.hybrid { - color: #54c4d3; - } #result-list, #error-list { li {