Skip to content

feat!: Refactor content script UI functions and add helper for "integrated" UIs - #333

Merged
aklinker1 merged 10 commits into
mainfrom
merge-content-script-ui
Jan 11, 2024
Merged

aklinker1 merged 10 commits into
mainfrom
merge-content-script-ui

Conversation

@aklinker1

@aklinker1 aklinker1 commented Jan 9, 2024 •

Copy link
Copy Markdown
Member

This closes #273

Breaking changes:

  • type: "inline" | "overlay" | "modal" has been changed to position: "inline" | "overlay" | "modal"
  • createContentScriptUi({ ... }) → createShadowRootUi({ ... })
  • createContentScriptIframe({ ... }) → createIframeUi({ ... })
  • onRemove is now called before the UI is removed from the DOM, previously it was called after the UI was removed

@netlify

netlify Bot commented Jan 9, 2024 •

Copy link
Copy Markdown

✅ Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 0867da8
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/659f56814c630d000819ea77
😎 Deploy Preview https://deploy-preview-333--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@aklinker1 aklinker1 self-assigned this Jan 10, 2024
@codecov

codecov Bot commented Jan 11, 2024 •

Copy link
Copy Markdown

Codecov Report

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

Comparison is base (8683bd4) 78.31% compared to head (12a5de0) 78.08%.
Report is 2 commits behind head on main.

❗ Current head 12a5de0 differs from pull request most recent head 0867da8. Consider uploading reports for the commit 0867da8 to get more accurate results

Files Patch % Lines
src/client/content-scripts/ui/index.ts 86.00% 35 Missing ⚠️
src/client/content-scripts/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #333      +/-   ##
==========================================
- Coverage   78.31%   78.08%   -0.23%     
==========================================
  Files         103      102       -1     
  Lines        7087     7115      +28     
  Branches      624      620       -4     
==========================================
+ Hits         5550     5556       +6     
- Misses       1520     1542      +22     
  Partials       17       17              

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

@aklinker1

aklinker1 commented Jan 11, 2024 •

Copy link
Copy Markdown
Member Author

Main problem with this override approach, the type-hints and type error messages suck.

small.mp4

Overrides are great because the different types have different return values, but I'm gonna try something else...

@aklinker1

aklinker1 commented Jan 11, 2024 •

Copy link
Copy Markdown
Member Author

I tried merging the options into one object, and that worked well for input options, but I also had to combine the output types, and now the return type isn't inferred correctly...

I also tried adding the type as an additional parameter before the options in the overrides, but it still sucks at providing type hints.

Instead, I'm gonna keep the fucntions as separate functions, but remove the "ContentScript" from them.

@aklinker1 aklinker1 changed the title feat!: Merge content script UI into a single API feat!: Refactor content script UI functions Jan 11, 2024
@aklinker1 aklinker1 changed the title feat!: Refactor content script UI functions feat!: Refactor content script UI functions and add helper for "integrated" UIs Jan 11, 2024
@aklinker1
aklinker1 marked this pull request as ready for review January 11, 2024 02:42
@aklinker1
aklinker1 merged commit 5343430 into main Jan 11, 2024
@aklinker1
aklinker1 deleted the merge-content-script-ui branch January 11, 2024 02:48
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.

Merge content script UI functions

1 participant