Skip to content

Conversation

@fioan89
Copy link
Collaborator

@fioan89 fioan89 commented Feb 24, 2025

  • fixes login screen and glitches related jumping to the workspaces page once the connection to Coder deployment is estabilished.
  • support for opening URLs in browser
  • fixes user agent reporting
  • fixes connection status rendering

- will also reflect on the jar/zip name
- copied from coder gateway plugin
- the API for browsing url(s) is no longer available
- this patch implements a basic URL opener that
  relies on native tools.
- if successfully signed in we go back to the
  main page which shows the environments/workspaces
- similar approach if user hits Cancel during sign in
- `EnvironmentUiPageManager` is an undocumented Toolbox
  component that has more flexibility to navigate between pages
- the connection status was unreadable due to the background
  and foreground colors used. The latest Toolbox version
  comes with standard color palettes that change based
  on the theme and environment state.
- plus some small extra refactorings that reduce the number
  of constructor parameters and rely on the service locator
- url was not displayed in the env page until the rest
  client was connected
- but we don't need to wait for the rest client to connect,
  the url is already available from settings
- Toolbox does not provide a plugin manager interface with metadata about current plugin.
  So we had to implement one for ourselves in order to have simple things like plugin version.
- the implementation relies on the extension.json which is deployed in the root of the
  jar (i.e. the plugin jar)
- the rest of the json fields are ignored for now
@fioan89 fioan89 marked this pull request as ready for review February 24, 2025 19:25
val dir = env.get("XDG_DATA_HOME")
if (dir.isNotBlank()) {
return Paths.get(dir, "coder-gateway")
return Paths.get(dir, "coder-toolbox")
Copy link
Member

Choose a reason for hiding this comment

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

I think we should drop the toolbox suffix here. There is nothing like a Coder toolbox. The coder is part of the JetBrains toolbox.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can probably do it as long as we're sure we are not overlapping (now or in the future) with coder cli manually installed.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. I will then keep the prefix. I was not sure what it was for.
@bcpeinhardt and @f0ssel may have more context here,

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

A general comment abut using the -toolbox suffix.
@bcpeinhardt can review the code better.

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

@bcpeinhardt I am approving to unblock so that we can keep moving frward.

@fioan89 fioan89 merged commit 7f9e1b3 into main Feb 26, 2025
@fioan89 fioan89 deleted the fix-connection-issues branch February 26, 2025 19:23
fioan89 added a commit that referenced this pull request Nov 3, 2025
This PR addresses two issues in the URI handler workflow to improve user
experience and reliability.

1. Streamline version fallback behavior
Problem: When the URI handler receives a build number that is no longer
available, the application would fall back to the latest version but
display a confirmation dialog. Netflix reported that this confirmation
dialog disrupts the user workflow.
Solution: Removed the confirmation dialog and replaced it with logging.
The handler now silently falls back to the latest available version when
the requested build number is unavailable, maintaining a seamless user
experience.

2. Fix connect page not displaying when Toolbox is already open
Problem: When Toolbox is already running and a URI is executed, the
connect page fails to display. Investigation revealed that the UI event
emitted via MutableSharedFlow(replay = 0) is lost because the UI
collector is not yet active when processEvent() is called.
Solution: Introduced a 66-100ms delay before emitting the UI event. This
delay ensures the collector is ready to receive events, preventing them
from being dropped. The timing was determined through testing and
appears to account for the collector initialization time.

Note: The delay in fix #2 is a workaround for what appears to be a
timing issue with the MutableSharedFlow collector initialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants