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

Remove share providers and fix various share bugs #18

Merged
merged 7 commits into from
Feb 15, 2024

Conversation

cdrini
Copy link
Contributor

@cdrini cdrini commented Feb 8, 2024

I started by trying to find a way to specify a direct share url from bookreader, but couldn't quite find a way to make that happen in a reasonable fashion. But did find some nice cleanups to do while investigating the code!

  • Remove ShareProvider abstraction ; it was making things kinda convoluted
  • Use URLSearchParams everywhere; fixed various url encoding issues
  • Fix Tumblr share link incorrect
  • Fix click region of share buttons not full-width (could only click on the word Twitter, not the whole row).

Copy link

github-actions bot commented Feb 8, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-02-15 23:05 UTC

@cdrini cdrini force-pushed the refactor/share-providers branch 2 times, most recently from 59db1d3 to cc5b621 Compare February 8, 2024 23:47
@cdrini cdrini force-pushed the refactor/share-providers branch from cc5b621 to 6d47a91 Compare February 8, 2024 23:50
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c970600) 94.53% compared to head (6d47a91) 94.51%.

Files Patch % Lines
src/menus/share-panel.ts 99.20% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
- Coverage   94.53%   94.51%   -0.02%     
==========================================
  Files          15        9       -6     
  Lines        1664     1513     -151     
  Branches       61       52       -9     
==========================================
- Hits         1573     1430     -143     
+ Misses         88       81       -7     
+ Partials        3        2       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@iisa iisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just had a question if we can keep toggle test.

test/iaux-sharing-options.test.ts Show resolved Hide resolved
'Free Download, Borrow, and Streaming',
'Internet Archive',
]
.filter(Boolean)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: why do we need to filter? should we have defaults for the desc, creator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes things didn't have a creator was the main case.

it('toggles visibility of embed options', async () => {
const el = (await fixture(container())) as IauxSharingOptions;

el.toggleEmbedOptions(new Event('click'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably do...

Suggested change
el.toggleEmbedOptions(new Event('click'));
el.shadowRoot.querySelector('embed dropdown').click();

@iisa iisa merged commit 1c30aad into main Feb 15, 2024
3 of 4 checks passed
@iisa iisa deleted the refactor/share-providers branch February 15, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants