Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Make Google Doc Canvas checks more lenient #962

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

melink14
Copy link
Owner

@melink14 melink14 commented Apr 7, 2022

I found in offline mode I the cached Google Docs query selector was always false due to executing before page loaded. I now query the selector on every mousemove which seems fast enough. An improvement would be to memoize a function or perhaps add a on Dom loaded callback.
I also removed the check for if the target was svg or rect since there's at least one counter example to that assumption. For now let's avoid premature optimization.

I also had to update the tests to not overwrite the Google Docs class since it now needs to be present at each execution.

Fixes #897
Fixes #881

I found in offline mode I the cached Google Docs query selector was always false due to executing before page loaded. I now query the selector on every `mousemove` which seems fast enough. An improvement would be to memoize a function or perhaps add a on Dom loaded callback.
I also removed the check for if the target was `svg` or `rect` since there's at least one counter example to that assumption. For now let's avoid premature optimization.

I also had to update the tests to not overwrite the Google Docs class since it now needs to be present at each execution.

Fixes #897
Fixes #881
@codecov
Copy link

codecov bot commented Apr 7, 2022

Codecov Report

Merging #962 (eee0d91) into main (0579f8e) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #962      +/-   ##
==========================================
- Coverage   79.01%   78.97%   -0.05%     
==========================================
  Files           7        7              
  Lines        3007     3001       -6     
  Branches      175      174       -1     
==========================================
- Hits         2376     2370       -6     
  Misses        628      628              
  Partials        3        3              
Impacted Files Coverage Δ
extension/rikaicontent.ts 74.73% <100.00%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0579f8e...eee0d91. Read the comment docs.

@melink14
Copy link
Owner Author

melink14 commented Apr 7, 2022

Decrease in coverage is due to total number of lines decreasing.

@melink14 melink14 merged commit 6809154 into main Apr 7, 2022
@melink14 melink14 deleted the melink14/betterdocs branch April 7, 2022 09:25
melink14 pushed a commit that referenced this pull request Apr 7, 2022
### [2.3.2](v2.3.1...v2.3.2) (2022-04-07)

### Bug Fixes

* **ui:** Make Google Doc Canvas checks more lenient ([#962](#962)) ([6809154](6809154)), closes [#897](#897) [#881](#881)
* **ui:** Reset styles on the light dom container ([#960](#960)) ([e734a35](e734a35)), closes [#959](#959)
@melink14
Copy link
Owner Author

melink14 commented Apr 7, 2022

🎉 This PR is included in version 2.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant