gitpod-io / gitpod-io/gitpod

gp preview requires a click before it opens Simple Browser

Open
#7,904 15 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

editor: code (browser) meta: never-stale team: IDE type: bug user experience
Dominant language
TypeScript
Stars
13.8k
Forks
1.4k
Avg merge
17h 58m
Merged PRs (30d)
5

Description

Bug description

In certain situations gp preview requires a user click before the Simple Browser opens a preview

I believe I have finally been able to consistently reproduce this issue in situations where the browser window running the Gitpod workspace does not have focus such as in the case of a multiple monitor workflow or a single monitor worflow where two windows are sharing the same screen but the window with the Gitpod workspace running in it doesn't have focus.

Also the below elements were also present in in my project repository when I was able to consistently reproduce this issue:

  • The port to be previewed is set to onOpen: ignore in .gitpod.yml
  • gp preview $(gp url $port) fires off from a .gitpod.yml task (where $port is whatever port you want to preview).

I have created a repository that I am pretty sure isolates the issue.

Steps to reproduce
  1. Create a new workspace from this repository
  2. Take focus away from the browser window that is running the workspace by clicking on another window but keep the original window visible.
  3. Wait for the build to finish

The preview browser should automatically open 3 seconds after the build finishes from the "Preview" terminal but nothing happens until you give the browser window focus by clicking anywhere on it.

Workspace affected
Expected behavior

Simple Browser should open without user interaction when a gp preview call is made even if the browser window does not have focus.

Example repository

https://github.com/apolopena/gp-preview-bug

Anything else?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the linked gp-preview-bug repository with the port set to onOpen: ignore and gp preview $(gp url $port) launched from .gitpod.yml. Reproduce the unfocused-browser case, then trace the gp preview path and Simple Browser opening behavior. Done means the preview opens automatically without a click when the workspace browser lacks focus.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.