gp preview requires a click before it opens Simple Browser
Nobody has claimed this yet.
- 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: ignorein.gitpod.yml gp preview $(gp url $port)fires off from a.gitpod.ymltask (where$portis whatever port you want to preview).
I have created a repository that I am pretty sure isolates the issue.
Steps to reproduce
- Create a new workspace from this repository
- Take focus away from the browser window that is running the workspace by clicking on another window but keep the original window visible.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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