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

[dashboard] Fix Arc favourites #20466

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

filiptronicek
Copy link
Member

Description

There's a funny bug that happened when you favorited the Gitpod Dashboard in Arc: when you open a favorited website, it does not want you to leave its origin and upon redirection to another one opens it in a new tab. This would be cool with us if we didn't try to redirect you on every workspace status update (spoiler alert: we do).

This PR stores a redirected property in the React state and prevents multiple redirects from happening. There's also a tiny piece of UI that tells you what happened if you end up back in the favorited tab, with buttons to more easily retry or get back to the dashboard.

image

Related Issue(s)

Fixes CLC-820

How to test

  1. Get Arc
  2. Favorite https://ft-fix-arc-redirects.preview.gitpod-dev.com/workspaces
  3. Try opening a workspace

/hold

@@ -458,11 +463,17 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
}

redirectTo(url: string) {
if (this.state.redirected) {
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

🫧 What are situations where we need to reset this value? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question: I'd say it's enough when React resets it when the page unmounts. On the page level, this prop should be permanent (or at least I don't see reasons why we'd forget about having redirected you somewhere).

@geropl
Copy link
Member

geropl commented Dec 19, 2024

@filiptronicek Can you re-deploy the preview pls? 🙏

@filiptronicek
Copy link
Member Author

@geropl aaah, it just broke. Let me deploy it now...

@filiptronicek
Copy link
Member Author

@geropl
Copy link
Member

geropl commented Dec 19, 2024

@filiptronicek I noted that I see the alert for a second before I'm effectively redirect. Not super important, but it talks about "probably opened in a new tab", while it gets replaced by the new content right after - which is a bit confusing.

Any ideas on how to avoid that? 🤔

@filiptronicek
Copy link
Member Author

@geropl: I noted that I see the alert for a second before I'm effectively redirect. Not super important, but it talks about "probably opened in a new tab", while it gets replaced by the new content right after - which is a bit confusing.

Any ideas on how to avoid that? 🤔

Great catch, I couldn't reproduce this myself but makes sense that it happens. I'm thinking of adding an additional prop that will trigger 2 seconds after we redirect, so that it's not there even before the UA gets the chance to properly redirect you.

@filiptronicek
Copy link
Member Author

We'll be merging this one after the New Year.

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

Successfully merging this pull request may close these issues.

3 participants