Skip to content

Commit

Permalink
Add right-click -> copy to clipboard feature (#125)
Browse files Browse the repository at this point in the history
* Add right-click -> copy to clipboard feature

* undo prettier length increase

* Changelog for v1.10.0

* Cleanup now unnecessary SCSS files and format CSS with prettier

* Improving cypress tests further

---------

Co-authored-by: Simon Heimler <[email protected]>
  • Loading branch information
Fannon and Simon Heimler authored Aug 24, 2024
1 parent 03b8146 commit c8dc2f9
Show file tree
Hide file tree
Showing 15 changed files with 574 additions and 1,004 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Ignore artifacts:
dist/
popup/lib/
popup/css/
node_modules/
cypress/
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"quoteProps": "consistent",
"printWidth": 120,
"tabWidth": 2
}
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## [unreleased]

## [v1.10.0]

- **NEW**: Right-click result to copy URL to clipboard
- **IMPROVED**: Improved initial loading time by caching browser history in local storage
- The browser API to fetch history tends to be slow
- The default history size (`historyMaxItems`) to load has been increased to 1024
- **IMPROVED**: Simplified options for calculating score of recently visited pages
- now only `scoreRecentBonusScoreMaximum` (which defaults to +20)
- **CHORE**: Minor refactoring and cleanups, maybe with a little bit performance improvements.
- **CHORE**: Removed SCSS build step, now it's just vanilla CSS

## [v1.9.7]

- **FIXED**: Fixed missing CSS font style for tagging view
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ For a list of recent changes, see [CHANGELOG.md](./CHANGELOG.md).
- **Open selected results**: By default, the extension will open the selected result in a new active tab, or switch to an existing tab with the target url.
- Hold `Shift` or `Alt` to open the result in the current tab
- Hold `Ctrl` to open the result without closing the popup.
- Right-click to copy URL to clipboard
- **Search Modes**: In case you want to be more selective -> use a search mode:
- Start your query with `#`: only **bookmarks with the tag** will be returned (exact "starts with" search)
- Supports AND search, e.g. search for `#github #pr` to only get results which have both tags
Expand Down
11 changes: 4 additions & 7 deletions cypress/e2e/folders.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ describe('Folder View', () => {
.find('#folders-list')
.find('[x-folder=Tools]')
.click()
cy.get('#search-input')
.should('have.value', '~Tools')
cy.get('#result-list')
.should('not.have.length', 0)
cy.get('#search-input').should('have.value', '~Tools')
cy.get('#result-list').should('not.have.length', 0)
.find('[x-original-id=6]')
cy.get('#result-list')
.find('li.bookmark')
.checkNoErrors()
cy.get('#result-list').find('li.bookmark')
cy.checkNoErrors()
})
})
})
4 changes: 2 additions & 2 deletions cypress/e2e/options.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Options View', () => {
cy.visit('/options.html')
cy.get('#user-config')
.should('include.value', 'displayVisitCounter')
.checkNoErrors()
cy.checkNoErrors()
})
it('can save a new user config in YAML format', () => {
const newConfig = `displayVisitCounter: true\n`
Expand All @@ -43,7 +43,7 @@ describe('Options View', () => {
cy.visit('/options.html')
cy.get('#user-config')
.should('include.value', 'displayVisitCounter')
.checkNoErrors()
cy.checkNoErrors()
})
})
})
64 changes: 25 additions & 39 deletions cypress/e2e/search.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Search View', () => {
})
cy.get('#search-input')
.type('{uparrow}')
// eslint-disable-next-line cypress/unsafe-to-chain-command
cy.get('#result-list li')
.each((el, index) => {
if (index === 0) {
Expand All @@ -48,7 +48,7 @@ describe('Search View', () => {
expect(el[0].id).to.not.equal('selected-result')
}
})
.checkNoErrors()
cy.checkNoErrors()
})
})

Expand Down Expand Up @@ -89,7 +89,7 @@ describe('Search View', () => {
cy.get('[x-original-id=7]')
.find('span.score')

.checkNoErrors()
cy.checkNoErrors()
})
})

Expand All @@ -110,7 +110,7 @@ describe('Search View', () => {
.find('li.tab')
cy.get('#result-list')
.find('li.bookmark')
.checkNoErrors()
cy.checkNoErrors()
})
it('can execute a precise search with non-ASCII chars successfully', () => {
cy.get('#search-approach-toggle')
Expand All @@ -119,31 +119,24 @@ describe('Search View', () => {
// Only make sure that search doesn't crash
cy.get('#result-list')
.should('not.have.length', 0)
.checkNoErrors()
cy.checkNoErrors()
})
})

describe('Fuzzy search', () => {
it('can switch to fuzzy search successfully', () => {
cy.get('#search-approach-toggle')
.contains('PRECISE')
cy.get('#search-approach-toggle')
.click()
cy.get('#search-approach-toggle')
.contains('FUZZY')
cy.get('#search-input')
.type(`JSON`)
cy.get('li.bookmark')
.checkNoErrors()
cy.get('#search-approach-toggle').should('have.text', 'PRECISE') // wait for initial value
cy.get('#search-approach-toggle').click()
cy.get('#search-approach-toggle').should('not.have.text', 'PRECISE')
cy.get('#search-approach-toggle').should('have.text', 'FUZZY')
cy.get('#search-input').type(`JSON`)
cy.get('li.bookmark').checkNoErrors()
})

it('can execute a fuzzy search successfully', () => {
cy.get('#search-approach-toggle')
.contains('PRECISE')
cy.get('#search-approach-toggle')
.click()
cy.get('#search-approach-toggle')
.contains('FUZZY')
cy.get('#search-approach-toggle').should('have.text', 'PRECISE')
cy.get('#search-approach-toggle').click()
cy.get('#search-approach-toggle').should('have.text', 'FUZZY')
cy.get('#search-input')
.type(`JSON`)
cy.get('li.bookmark')
Expand All @@ -159,23 +152,17 @@ describe('Search View', () => {
.find('li.tab')
cy.get('#result-list')
.find('li.bookmark')
.checkNoErrors()
cy.checkNoErrors()
})
})

it('can execute a precise search with non-ASCII chars successfully', () => {
cy.get('#search-approach-toggle')
.contains('PRECISE')
cy.get('#search-approach-toggle')
.click()
cy.get('#search-approach-toggle')
.contains('FUZZY')
cy.get('#search-input')
.type(`äe指事字₽`)
cy.get('#search-approach-toggle').should('have.text', 'PRECISE')
cy.get('#search-input').type(`äe指事字₽`)
// Only make sure that search doesn't crash
cy.get('#result-list')
.should('not.have.length', 0)
.checkNoErrors()
cy.checkNoErrors()
})

describe('Bookmark search', () => {
Expand All @@ -190,7 +177,7 @@ describe('Search View', () => {
.should('not.exist')
cy.get('.history')
.should('not.exist')
.checkNoErrors()
cy.checkNoErrors()
})
it('returns only bookmark results', () => {
cy.get('#search-input')
Expand All @@ -201,9 +188,8 @@ describe('Search View', () => {
.should('not.exist')
cy.get('.history')
.should('not.exist')
cy.get('#result-counter')
.contains('(5)')
.checkNoErrors()
cy.get('#result-counter').should('have.text', '(5)')
cy.checkNoErrors()
})
})

Expand All @@ -219,7 +205,7 @@ describe('Search View', () => {
.should('not.exist')
cy.get('.bookmark')
.should('not.exist')
.checkNoErrors()
cy.checkNoErrors()
})
it('only the history and tab results', () => {
cy.get('#search-input')
Expand All @@ -232,7 +218,7 @@ describe('Search View', () => {
.should('not.exist')
cy.get('#result-counter')
.contains('(4)')
.checkNoErrors()
cy.checkNoErrors()
})
})

Expand All @@ -248,7 +234,7 @@ describe('Search View', () => {
.should('not.exist')
cy.get('.history')
.should('not.exist')
.checkNoErrors()
cy.checkNoErrors()
})
it('returns only the tab results', () => {
cy.get('#search-input')
Expand All @@ -263,7 +249,7 @@ describe('Search View', () => {
.should('not.exist')
cy.get('#result-counter')
.contains('(1)')
.checkNoErrors()
cy.checkNoErrors()
})
})
})
16 changes: 5 additions & 11 deletions cypress/e2e/tags.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ describe('Tag View', () => {
cy.get('#tags-overview').find('#tags-list').find('[x-tag=json]').checkNoErrors()
})
it('can use tags for navigation', () => {
cy.get('#tags-overview')
.find('#tags-list')
.find('[x-tag=json]')
.click()
cy.get('#search-input')
.should('have.value', '#json')
cy.get('#result-list')
.should('not.have.length', 0)
cy.get('#tags-overview').find('#tags-list').find('[x-tag=json]').click()
cy.get('#search-input').should('have.value', '#json')
cy.get('#result-list').should('not.have.length', 0)
.find('[x-original-id=7]')
cy.get('#result-list')
.find('li.bookmark')
.checkNoErrors()
cy.get('#result-list').find('li.bookmark')
cy.checkNoErrors()
})
})
})
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "search-bookmarks-history-and-tabs",
"version": "1.9.8",
"version": "1.10.0",
"description": "Browser extension to (fuzzy) search and navigate bookmarks, history and open tabs.",
"main": "index.js",
"type": "module",
Expand Down
Loading

0 comments on commit c8dc2f9

Please sign in to comment.