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

Browser Extension 2.0 #81

Merged
merged 1 commit into from
Sep 17, 2023
Merged

Browser Extension 2.0 #81

merged 1 commit into from
Sep 17, 2023

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Sep 4, 2023

This is a rewrite of the browser extension using the plasma framework, which allows to use React components and has a couple of other advantages.

The extension supports

  • github
  • gitlab
  • bitbucket
  • bitbucket-server

installations on any domain.

It also now starts workspaces with autostart=true which will automatically forward when landing in gitpod's create workspace page. A secondary button to "Open with options" is available in case a user wants to select a different IDE/ws class.

The rewrite also includes tests for the element selectors used to check if and where a button should be installed, so we get noticed when a website changes its design and breaks our integration.

@svenefftinge svenefftinge force-pushed the se/plasmo branch 13 times, most recently from 7e87346 to d9a1df2 Compare September 11, 2023 20:06
@svenefftinge svenefftinge marked this pull request as ready for review September 15, 2023 14:23
@svenefftinge svenefftinge changed the title [WIP] move to plasmo Browser Extension 2.0 Sep 15, 2023
@svenefftinge svenefftinge marked this pull request as draft September 15, 2023 14:27
@svenefftinge svenefftinge marked this pull request as ready for review September 15, 2023 14:31
@svenefftinge
Copy link
Member Author

@filiptronicek and @selfcontained I have fixed the issues we've seen yesterday. 👍

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Thanks a lot for taking this on, @svenefftinge. It lays a solid foundation upon which we can continue to build v2.

We also seem to be getting manifest version 3 support for free with this (could close #65) as well as an easier way to publish to Safari.

I've only tested on Chrome, because both of my Firefox installs kept saying that the packaged extension was corrupt, but I'm guessing that's something wrong on my end.

Copy link
Member

Choose a reason for hiding this comment

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

for a follow-up: make this a nightly GitHub Action workflow, also running on PRs as a check

Copy link
Member Author

Choose a reason for hiding this comment

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

</div>
</div>

{showDropdown && (
Copy link
Member

Choose a reason for hiding this comment

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

in a follow-up: let's make this accessible so you can open the dropdown with the keyboard

Copy link
Member Author

Choose a reason for hiding this comment

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

return (
<div id="gitpod-btn-nav" title="Gitpod" className={classNames("gitpod-button", application, ...(additionalClassNames || []))}>
<div className={classNames("button")}>
<a className={classNames("button-part", "action")} href={actions[0].href}>
Copy link
Member

Choose a reason for hiding this comment

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

Personally, I miss the automatic opening in a new tab. If changing this is intended, I'll be happy to contribute something to the settings later to optionally change it.

Copy link
Member Author

Choose a reason for hiding this comment

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

<div className={classNames("button")}>
<a className={classNames("button-part", "action")} href={actions[0].href}>
<span className={classNames("action-label")}>
<Logo className={classNames("action-logo")} width={14} height={14}/>
Copy link
Member

Choose a reason for hiding this comment

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

I'm a big fan of the logo here. It feels fresh and makes the button even more easily spotted.

In some contexts (like the file viewer on GitHub), we could try experimenting with the omission of the text and just having the logo there. Just an idea, but could be nice (most likely adds unnecessary complexity at this point)

Before After
image image

src/contents/button.tsx Show resolved Hide resolved
Comment on lines +16 to +23
const updateAddress = useCallback((address: string) => {
address = address.trim();
address = address.endsWith("/") ? address.slice(0, -1) : address;
const err = validate(address);
setError(err);
setAddress(address);
}, [setAddress, setError]);

Copy link
Member

Choose a reason for hiding this comment

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

in a follow up, I'll try to add the Desktop App parser here, so more formats are accepted.

Copy link
Member Author

Choose a reason for hiding this comment

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

src/popup.tsx Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

This is really cool, love it

Copy link
Member

Choose a reason for hiding this comment

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

We could look into how this looks in all of the different GitLab themes, but from what I've tested, it looks great everywhere even in dark mode.

@svenefftinge
Copy link
Member Author

Thank you @filiptronicek 🙏 I'll merge this so we can add some of the things you mentioned in smaller follow-ups.

@svenefftinge svenefftinge merged commit adbf0a4 into master Sep 17, 2023
1 check passed
@svenefftinge svenefftinge deleted the se/plasmo branch September 17, 2023 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants