- 09 Dec, 2021 2 commits
-
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
- 08 Dec, 2021 7 commits
-
-
Eduardo authored
Co-authored-by: Robert Knight <robertknight@gmail.com>
-
Eduardo authored
Co-authored-by: Robert Knight <robertknight@gmail.com>
-
Eduardo Sanz García authored
In order to toggle correctly the `Toolbar` button between `New page note` and `New annotation` we have created a new `guest-host` channel of communication. Previous code failed to toggle the button because it used an event emitter, hence assuming that the `Guest` was in the same frame as the host. - The `Sidebar` keeps track of the iframe that has currently text selected. It uses the `subFrameIdentifier`. If there is no `subFrameIdentifier` (currently the top `Guest` frame), it sets the identifier to 'main', referring to the frame with the main annotatable content. This will change in a follow up PR that will add more logic into which frame is tagged as 'main'. - Only one iframe at a time can have selected text. - The event emitter `hasSelectionChanged` has been replaced by three RPC methods: 'textSelectedAt`, 'textDeselectedAt', 'deselecTextExcept' - `deselecTextExcept` is used to clear text selections in other frames, except from the iframe that has the latest selection. This is not the neatest solution, but for now it works. On a follow up PR I will address the removal of the shadow left from previous a selection. Closes https://github.com/hypothesis/product-backlog/issues/1236
-
Robert Knight authored
To help us debug issues with sidebar-host connection setup [1], report an error to the sidebar if PortProvider receives a message which looks like a port request (data has the structure `{ frame1: string, frame2: string, type: 'request' }`) but comes from a non-Window source, invalid origin or is not a valid combination of frames. [1] https://sentry.io/organizations/hypothesis/issues/2810452318/
-
Robert Knight authored
When a guest frame with an opaque origin, such as file:// URL or a sandboxed iframe, sends a request for a port to the host frame, the `event.origin` value will be the string "null". This is not a legal value for the `targetOrigin` argument to `postMessage`, so we need to remap it to "*" (any origin).
-
Robert Knight authored
Dates are in fact JSON-serializable, but as strings. Recent changes to `isMessageEqual` mean that the `JSON.stringify` calls cannot fail, because the `isMessage` check ensures all the fields we serialize are strings. Writing a test to check for this failure mode is not possible. There is a refactoring hazard here, so I added a comment to call this out.
-
Robert Knight authored
When comparing a MessageEvent's data to an expected message, only compare the known fields of the message and ignore any unknown fields. Unknown fields don't cause problems for us in parsing the message, and there is a risk that it might cause us to silently ignore messages in some environments. We don't know yet if that actually happens.
-
- 07 Dec, 2021 4 commits
-
-
Robert Knight authored
Previously the boot script was not regenerated when its JS inputs changed, as opposed to the JSON manifest. This approach relies on `src/boot` not having dependencies on other modules. We could improve this by using `watchJS`, but that currently produces too much distracting log noise when running `make dev`.
-
Robert Knight authored
It was previously served as text/html, which caused warnings in some contexts.
-
Robert Knight authored
Update the representative feature tests to check for Shadow DOM v1 and CSS grid. This avoids loading the client in browsers that are definitely too old.
-
Lyza Danger Gardner authored
Fix a UI confusion by fully un-setting the user-focus filter if a empty user value is provided to the `changeFocusModeUser` RPC method. This prevents a confusing half-set user-focus filter from sticking around when an instructor returns to viewing all users in grading mode after focusing on one or more students.
-
- 06 Dec, 2021 12 commits
-
-
dependabot[bot] authored
Bumps [sass](https://github.com/sass/dart-sass) from 1.43.5 to 1.44.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.43.5...1.44.0) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@hypothesis/frontend-build](https://github.com/hypothesis/frontend-build) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/hypothesis/frontend-build/releases) - [Changelog](https://github.com/hypothesis/frontend-build/blob/main/CHANGELOG.md) - [Commits](https://github.com/hypothesis/frontend-build/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: "@hypothesis/frontend-build" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
Robert Knight authored
These tests access the `error.stack` property, which in turn triggers the `Error.prepareStackTrace` [1] handler installed by source-map-support [2]. This is expensive and has caused some CI timeouts. The workaround is to disable the `error.stack` processing for the duration of these tests. [1] https://v8.dev/docs/stack-trace-api#customizing-stack-traces [2] https://github.com/evanw/node-source-map-support/blob/ac2c3e4c633c66931981ac94b44e6963addbe3f4/source-map-support.js#L584
-
dependabot[bot] authored
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 12.0.0 to 12.0.1. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) - [Commits](https://github.com/puppeteer/puppeteer/compare/v12.0.0...v12.0.1) --- updated-dependencies: - dependency-name: puppeteer dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [preact](https://github.com/preactjs/preact) from 10.6.1 to 10.6.2. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.6.1...10.6.2) --- updated-dependencies: - dependency-name: preact dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
Robert Knight authored
- versionify was removed as part of the Browserify => Rollup transition - We now use URLSearchParams instead of the query-string/querystring packages for query string serialization and parsing
-
dependabot[bot] authored
Bumps [@hypothesis/frontend-shared](https://github.com/hypothesis/frontend-shared) from 4.3.0 to 4.4.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/compare/v4.3.0...v4.4.0) --- updated-dependencies: - dependency-name: "@hypothesis/frontend-shared" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.1038.0 to 2.1043.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.1038.0...v2.1043.0) --- updated-dependencies: - dependency-name: aws-sdk dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [core-js](https://github.com/zloirock/core-js) from 3.19.1 to 3.19.3. - [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/compare/v3.19.1...v3.19.3) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [rollup](https://github.com/rollup/rollup) from 2.60.1 to 2.60.2. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.60.1...v2.60.2) --- updated-dependencies: - dependency-name: rollup dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [eslint](https://github.com/eslint/eslint) from 8.3.0 to 8.4.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.3.0...v8.4.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [prettier](https://github.com/prettier/prettier) from 2.5.0 to 2.5.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.5.0...2.5.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 03 Dec, 2021 5 commits
-
-
Eduardo Sanz García authored
Follow up of #3983, see: * https://github.com/hypothesis/client/pull/3983#discussion_r760445342 * https://github.com/hypothesis/client/pull/3983#discussion_r760445894
-
Eduardo authored
Co-authored-by: Robert Knight <robertknight@gmail.com>
-
Eduardo Sanz García authored
Following the removal of `AnnotationSync` from `Guest` we correct the tests.
-
Eduardo Sanz García authored
AnnotationSync utility didn't have a clear purpose, except for assigning a temporarily `$tag` to newly created annotations. For that, it used an internal cache of annotation objects from the Guest, that were mutated in-place. `AnnotationSync` used a very indirect method of communication to the `Guest`, using an event emitter, even though their mutual relationship was quite straightforward. In this PR, we have: * Simplified the messages that are sent between the host and the sidebar. We have assumed that a `$tag` value is always present if it comes from the `sidebar`, and a temporarily `$tag` is assigned in the `Guest` class for newly created annotations. Therefore, the type of the message sent between these two frames can be simplified to always be of the shape of `AnnotationData`, a safe version of `Annotation`. * Added a few missing types. * Changed the RPC method `deleteAnnotation` to send astring tag, similar to other RPC methods, like `focusAnnotations` or `scrollToAnnoation`. As a consequence of that we changed the `Guest#detach` method signature.
-
Robert Knight authored
Currently only Chrome supports performing a structured clone of Errors. Implement a fallback so that we can get information about annotator-side errors in other browsers. Also improve handling if a non-Error value is passed to `sendError`.
-
- 02 Dec, 2021 9 commits
-
-
Robert Knight authored
The `crossorigin="anonymous"` attribute was added to `<link rel="preload">` elements created by the boot script because it was needed when preloading API responses, so that the response can be read. We don't need to use cross-origin requests when preloading stylesheets however, and we were seeing occassional errors in Chrome due to this (see https://github.com/hypothesis/client/issues/3987).
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
Previously `sendError` was tested indirectly via captureErrors. However since this is exported as an API from the module, it makes sense to test it directly.
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
Capture errors that happen while handling port requests in `PortProvider#listen` and forward them to the sidebar, so we can gain visibility into them.
-
Robert Knight authored
Add infrastructure that will allow us to gain visibility into errors happening in the host frame, in specifically wrapped blocks of code, by capturing the errors and forwarding them to the sidebar. The initial implementation requires that the browser is able to clone errors in `window.postMessage` calls, and currently only Chrome supports that. In other browsers forwarding errors will fail with a warning. - Add `shared/frame-error-capture.js` module with functions for capturing errors, registering a target frame to receive them and forwarding errors to the frame. - Register sidebar application as handler for errors in host frame in `Sidebar` constructor and de-register it in the destructor. - Call `handleErrorsInFrames` in `sidebar/util/sentry.js` to handle errors from host frame by sending them to Sentry.
-
- 01 Dec, 2021 1 commit
-
-
Lyza Danger Gardner authored
There is so much modification of the `menu-arrow` mixin that it's not worthwhile abstracting it out (and we're moving away from mixins).
-