- 15 Apr, 2021 2 commits
-
-
Robert Knight authored
- Introduce a union type for current route names - Use `Record<Key, Value>` rather than `Object.<Key, Value>` as it is stricter (eg. it is non-nullable)
-
Robert Knight authored
Services in `src/sidebar/services` are effectively classes. They are currently implemented with a convention that was more common pre-ES6 where the constructor is a function that creates the fields as local variables and the methods using closures and returns an object that references the closures. This pattern has advantages, especially pre-ES6, as it avoids issues with incorrect use of `this` and hides internal state from consumers. However it also has downsides: - It is less obvious to readers that they are looking at something that is logically a class - This is not an idiom we use elsewhere in the codebase, where we use native classes instead - Static analysis tools don't support this pattern for creating a class as well as they support a native class. For example `TS` creates a named type for native classes, which is convenient to reference in JSDoc comments This commit starts a process of refactoring service classes to ES classes which are named `<Thing>Service`, using the router service as a first example. Per recently agreed conventions, the classes are named rather than default exports.
-
- 14 Apr, 2021 1 commit
-
-
Kyle Keating authored
When the host config value for `requestConfigFromFrame` is an object containing a string and a number, it is assumed that the remaining host config is be fetched from the parent frame via RPC. In this context, any other values passed along via the iframe URL hash are ignored. One such value is the `group` which is used by the notebook to focus a group and filter only to that groups annotations. This changes the method that merges the configs to allow that `group` value to be taken from the iframe's url and incorporated into the final merged config so that the notebook can set that value in its own store.
-
- 13 Apr, 2021 6 commits
-
-
Eduardo Sanz García authored
-
Eduardo Sanz García authored
Both `SearchClient` and `load-annotations::load` had the same default parameters. We have decided to leave the default parameters only in one place instead of two. This more specific test proves that removing the default parameters in `load-annoationas::load` still uses the default parameters in the `SearchClient`.
-
Eduardo Sanz García authored
I added more specific types to services, that was otherwise listed as `Object`.
-
Eduardo Sanz García authored
This PR displays a button when there are new/deleted/updated annotations on that the group. Clicking on the button updates the annotation thread with the updated annotations. Currently, the button is placed by the thread count. If there are filters applied in the notebook the button is not shown. To test this change make sure you update `h` to the latest version (so it includes https://github.com/hypothesis/h/pull/6580)
-
Robert Knight authored
This addresses PR feedback.
-
Robert Knight authored
The visible part of PDF highlights are created by SVG elements which are multiply-blended with the PDF content to enhance legibility of highlighted text. The blueish background for focused highlights was still being applied to the transparent text layer on top of the PDF which contains the `<hypothesis-highlight>` elements. This impacted the legibility of focused highlights. Improve the readability of PDF highlights by instead modifying the fill color of the SVG element.
-
- 12 Apr, 2021 15 commits
-
-
dependabot[bot] authored
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.13.12 to 7.13.15. - [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.15/packages/babel-preset-env) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.10.0 to 3.10.1. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/zloirock/core-js/commits/v3.10.1/packages/core-js) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.9 to 8.2.10. - [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.9...8.2.10) 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.14 to 7.13.15. - [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.15/packages/babel-core) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.23.1 to 7.23.2. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.23.1...v7.23.2) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.880.0 to 2.884.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.880.0...v2.884.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.3 to 4.2.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.3...v4.2.4) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [enzyme-adapter-preact-pure](https://github.com/preactjs/enzyme-adapter-preact-pure) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/preactjs/enzyme-adapter-preact-pure/releases) - [Changelog](https://github.com/preactjs/enzyme-adapter-preact-pure/blob/master/CHANGELOG.md) - [Commits](https://github.com/preactjs/enzyme-adapter-preact-pure/compare/v3.0.0...v3.1.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.13.0 to 0.13.2. - [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.13.0...v0.13.2) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [eslint](https://github.com/eslint/eslint) from 7.23.0 to 7.24.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.23.0...v7.24.0) Signed-off-by: dependabot[bot] <support@github.com>
-
Robert Knight authored
In issue discussions, tests and various parts of the code there are mentions of side-by-side mode being active or not. The `Guest` class didn't store this state directly but instead had a `closeSidebarOnDocumentClick` state which is always the inverse of "is side-by-side active?". Make the code easier to follow by storing the "is side-by-side active?" state directly. This will also avoid a misnamed variable if in future the state has other effects besides changing whether clicking on the document closes the sidebar. - Replace `closeSidebarOnDocumentClick` with a private `_sideBySideActive` property, exposed via a read-only `sideBySideActive` getter - Refactor tests to only use the public API of Guest (calling `Guest#fitSideBySide` or reading `sideBySideActive`)
-
Robert Knight authored
Remove the fallback logic that uses `location.href` and `document.title` as the document URL and metadata if using the integration-specific code (HTML or PDF) to get the document URL and metadata fails. Instead just let the async exception propagate. Currently this will result in no annotation/highlight being created and a console error. In future we should improve this by showing an error notification to the user. Recording the wrong document metadata with an annotation is worse than not creating an annotation at all: The user will be unaware that there is a problem yet the annotation will likely fail to show up in future or be displayed with completely wrong metadata in the Notebook. Therefore we want the failure here to be obvious so that the user notifies us of the problem and doesn't create a bunch of annotations which later "disappear". Fixes #3204
-
Robert Knight authored
Add test to check that anchors not associated with the removed annotation are preserved.
-
Robert Knight authored
-
Robert Knight authored
Rewrite the `Guest#anchor` method to simplify the control flow and generally make it easier to understand and change. There are no functional changes for annotations with zero or one entry in the `target` field (all existing Hypothesis annotations). There is a functional change to handling of annotations with multiple targets. Previously `anchor` would try to be smart about only re-anchoring targets which were not already anchored. In the new implementation all targets for an annotation are re-anchored. This will have no effect in practice because the Hypothesis client only supports creating annotations with a single target and the h backend can only store a single target per annotation. However the Hypothesis API does allow for multiple targets per annotation, in line with the W3C Web Annotations specs in which a single annotation can refer to multiple parts of a document. - Convert `anchor` method to async and replace Promise chains with async/await - Replace the logic that removes existing anchors and highlights for an annotation with a call to the `detach` method. This required adding an internal parameter to `detach` to control whether `anchorsChanged` is emitted, so that `anchor` only emits `anchorsChanged` once. - Add an explicit error to `Promise.reject` calls in tests so that the tests are easier to debug if they fail
-
- 09 Apr, 2021 10 commits
-
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
Devise a way to "extend" a common base playground app with local-app routes and patterns
-
Lyza Danger Gardner authored
In the soon-future, we'll want to extract the common bits of the UI Playground app to the `frontend-shared` repository. This is step 1.
-
Lyza Danger Gardner authored
Only `@forward` specific mixins and create a function to retrieve color settings out of the `_config` partial
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Robert Knight authored
If opening the login popup window using `window.open` fails or succeeds but fails to return a `Window` reference to the caller then show a more helpful error message. There are various rare scenarios (browser bugs, browser extensions) which might cause this to happen. There is not a whole lot we can do to recover, but at least we can show a better error message.
-
- 08 Apr, 2021 2 commits
-
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
- 07 Apr, 2021 4 commits
-
-
Lyza Danger Gardner authored
Use `IconButton` in `ShareAnnotationsPanel` and `AnnotationShareControl`, with custom styling to make the buttons pair well with a text input. It would be ideal to create a design pattern from the combo of the input + button in the future.
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
Replace uses of `Button` in the Thread component and adjust styling for stronger alignment in both desktop and touch interfaces.
-
Lyza Danger Gardner authored
-