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

🛠️ Cleanup: Integrate more properly with GitHub's design system #4

Open
JoshuaKGoldberg opened this issue Aug 26, 2022 · 2 comments
Labels
status: blocked Waiting for something else to be resolved type: cleanup Tech debt or other code/repository cleanups

Comments

@JoshuaKGoldberg
Copy link
Owner

GitHub uses a few web components to set up the Saved Replies dropdown: details-menu, fuzzy-list, and so on. That makes it a little tricky to manipulate their DOM manually the way this extension currently does.

It would be nice if this could instead use whatever APIs -if any?- those web components expose to more properly manipulate their contents. Then this extension's added replies would be more seamless -- and support keyboard extensions!

@JoshuaKGoldberg JoshuaKGoldberg added the status: needs investigation Further research required...? label Aug 26, 2022
@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! type: cleanup Tech debt or other code/repository cleanups and removed status: needs investigation Further research required...? labels Nov 14, 2023
@JoshuaKGoldberg
Copy link
Owner Author

Confirmed on a Twitch stream chat that in theory one should be able to use the Primer React components or the Web Components + correct classes (thanks @keithamus!). I'm going to run with the assumption that this is technically doable. Marking as accepting PRs!

Note (also thanks again, haha) the specifics of which components are named what do change over time. E.g. details-menu, fuzzy-list, etc. are changing. I'll try to remember to update this issue as PRs come into this repo.

@JoshuaKGoldberg JoshuaKGoldberg changed the title 🕵️ Investigation: Integrate more properly with GitHub's web components 🛠️ Cleanup: Integrate more properly with GitHub's web components Nov 14, 2023
@JoshuaKGoldberg
Copy link
Owner Author

I tried adding an import { ActionList } from "@primer/react" to the main content script. It crashes with:

Uncaught TypeError: Cannot read properties of null (reading 'get')`

...on this line of code inside the GitHub code:

customElements.get("live-region") || customElements.define("live-region", kl);

Turns out custom elements just plain aren't allowed in Chrome extensions: https://issues.chromium.org/issues/41118431

...so this issue is blocked on either:

  • Chrome extensions allowing custom elements
  • GitHub's code abandoning all uses of them

shakes fist at web components

@JoshuaKGoldberg JoshuaKGoldberg added status: blocked Waiting for something else to be resolved and removed status: accepting prs Please, send a pull request to resolve this! labels Dec 1, 2024
@JoshuaKGoldberg JoshuaKGoldberg changed the title 🛠️ Cleanup: Integrate more properly with GitHub's web components 🛠️ Cleanup: Integrate more properly with GitHub's design system Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked Waiting for something else to be resolved type: cleanup Tech debt or other code/repository cleanups
Projects
None yet
Development

No branches or pull requests

1 participant