- 16 Mar, 2021 11 commits
-
-
Robert Knight authored
When fetching annotations from the backend there is a trade-off between the time taken to generate a page (less if the page size is smaller) and the time taken to fetch all pages (less if the page size is larger). To optimize the perceived loading time we can pick a smaller page size for the first page, enabling the first screenful of annotations/threads to appear quickly, and then use a larger page size for the remaining pages. - Change the `pageSize` option for `SearchClient` from a fixed number to a callback that returns the page size for a given page index - Set the default value for the `pageSize` option to use a small page size (50) for the first page and a larger size (200) for remaining pages
-
Robert Knight authored
Consistently use the term "page" to refer to a subset of results fetched from the search API instead of "batch" or "chunk". This is more consistent within the rest of the client code and also consistent with the API documentation. - Rename `chunkSize` constructor argument to `pageSize` - Change internal references to "batch" or "chunk" in SearchClient to "page"
-
Eduardo Sanz García authored
Reordered fields according to the UI and capitalised properties.
-
Eduardo Sanz García authored
I have tested successfully on the latest version of Chrome, Safari and Firefox. I also tested successfully on an Android and iOS devices. I couldn't tested more exhaustively on other desktop/mobile browser versions because SauceLabs didn't allowed me to retrieve the pasted text. Closes https://github.com/hypothesis/product-backlog/issues/1180
-
Robert Knight authored
Reword this comment to try and make the intent of the code clearer.
-
Robert Knight authored
It is safe to call `load` while annotations are already being loaded, in that it does all the necessary cleanup/interruption of the existing fetch. However it wasn't immediately clear to me from the code that this was the case.
-
Robert Knight authored
Currently both the sidebar and notebook wait until the user's profile and groups are fetched before fetching annotations. This is because the search query to fetch annotations depends on the focused group. The groups query may take several hundred ms to complete, so this ends up delaying the initial fetch and display of annotations by that amount of time. In the notebook the common case is that the user is already logged in and the notebook is configured to display a specific group ("the direct linked group"): whatever the user had previously selected in the sidebar. In this scenario it is very likely that the direct-linked group will end up being the focused one after groups are fetched. Based on these assumptions, we can speed up the initial annotation by loading annotations from the direct-linked group. If the focused group ends up being different, annotations will just be re-fetched from the correct group once that is known.
-
Robert Knight authored
- Remove unused references to `offset` search query param - Add JSDoc to clarify what the `searchAfter` param is
-
Robert Knight authored
-
Robert Knight authored
- Add an additional test that checks the query params sent for each of the pages sent for a simple single-URI query. - Refactor the remaining SearchClient tests which still use promise-chains to use async/await instead for readability and consistency
-
Robert Knight authored
Optimize fetching pages of results from the backend by using cursor-based paging (via `search_after`) rather than offset-based paging (via `offset`, `limit`). Cursor-based paging is more efficient to handle in the backend as the starting position of a page within the overall result set increases. This also fixes a race condition where results at the boundary between pages might be fetched twice or not fetched if new matches for the query become available while results are fetched.
-
- 15 Mar, 2021 28 commits
-
-
Eduardo Sanz García authored
-
Eduardo Sanz García authored
I have tested successfully on the latest version of Chrome, Safari and Firefox. I also tested successfully on an Android and iOS devices. I couldn't tested more exhaustively on other desktop/mobile browser versions because SauceLabs didn't allowed me to retrieve the pasted text. Closes https://github.com/hypothesis/product-backlog/issues/1180
-
Eduardo Sanz García authored
Delegator class was a pub/sub event emitter for communication between different parts of the application in the host page. Instead of inherit this functionality, we have replaced by composition. Some arguments send by this system were unnecessarily wrapped in an array. We have unwrapped these arguments.
-
Lyza Danger Gardner authored
Ensure empty root threads are not counted when counting results by always setting this empty thread `visible:false` Fixes #3137
-
dependabot[bot] authored
Bumps [karma](https://github.com/karma-runner/karma) from 6.1.1 to 6.2.0. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](https://github.com/karma-runner/karma/compare/v6.1.1...v6.2.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.2.6 to 2.2.7. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](https://github.com/cure53/DOMPurify/compare/2.2.6...2.2.7) Signed-off-by: dependabot[bot] <support@github.com>
-
Lyza Danger Gardner authored
* Update `GroupList` to use store as source of default authority * Update `TagList` to use store as source of `defaultAuthority` * Update `UserMenu` to use store as source for `defaultAuthority`
-
Lyza Danger Gardner authored
Rename `authDomain` and extend comments to clarify
-
Lyza Danger Gardner authored
Refactor AnnotationUser to be more "dumb" like other leafy components
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
Add helper module with function for determining what name string to use when rendering the author of a given annotation (display name or username)
-
Lyza Danger Gardner authored
-
dependabot[bot] authored
Bumps [eslint](https://github.com/eslint/eslint) from 7.21.0 to 7.22.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.21.0...v7.22.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.13.9 to 7.13.10. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-preset-env) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.13.8 to 7.13.10. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-core) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.858.0 to 2.863.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.858.0...v2.863.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@hypothesis/frontend-shared](https://github.com/hypothesis/frontend-shared) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/hypothesis/frontend-shared/releases) - [Changelog](https://github.com/hypothesis/frontend-shared/blob/main/CHANGELOG.md) - [Commits](https://github.com/hypothesis/frontend-shared/commits/v1.10.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [chai](https://github.com/chaijs/chai) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](https://github.com/chaijs/chai/compare/4.3.3...v4.3.4) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.12.0 to 0.13.0. - [Release notes](https://github.com/KaTeX/KaTeX/releases) - [Changelog](https://github.com/KaTeX/KaTeX/blob/master/CHANGELOG.md) - [Commits](https://github.com/KaTeX/KaTeX/compare/v0.12.0...v0.13.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.7 to 8.2.8. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.2.7...8.2.8) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.4 to 18.3.5. - [Release notes](https://github.com/octokit/rest.js/releases) - [Commits](https://github.com/octokit/rest.js/compare/v18.3.4...v18.3.5) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [preact](https://github.com/preactjs/preact) from 10.5.12 to 10.5.13. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.5.12...10.5.13) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [mocha](https://github.com/mochajs/mocha) from 8.3.1 to 8.3.2. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v8.3.1...v8.3.2) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 6.2.1 to 6.2.2. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/6.2.1...6.2.2) Signed-off-by: dependabot[bot] <support@github.com>
-
Kyle Keating authored
-
Robert Knight authored
Add a test for what happens if a search is canceled and the in-flight request ends up failing.
-
Robert Knight authored
-
Robert Knight authored
Make the code easier to follow and update by modernizing it to ES6+ and linking to relevant Hypothesis API documentation. - Replace `self` with arrow-functions + `this` - Replace promise chains with async/await - Document the type of the `query` param to search requests - Add links to relevant Hypothesis API documentation
-
- 12 Mar, 2021 1 commit
-
-
Robert Knight authored
Reduce the perceived loading time in the notebook by fetching annotations in, roughly, the reverse chronological order in which they are displayed. By default `SearchClient` fetches annotations by ascending creation date. This makes sense in the sidebar as it typically correlates, roughly, with the order in which the sidebar presents annotations by default (document location order). For the notebook however this is suboptimal. - Add `sortBy` and `sortOrder` options to `SearchClient` and `loadAnnotations` to control fetch order, with the defaults remaining the same as before (`created`, `asc`). - In `NotebookView` set `sortBy` to `updated` and `sortOrder` to desc to fetch annotations in reverse chronological order.
-