Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed

- mTLS certificate refresh and http request retrying logic
- account name is now rendered immediately after login

## 0.8.2 - 2026-01-06

Expand Down
22 changes: 10 additions & 12 deletions src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import java.util.concurrent.atomic.AtomicBoolean
import kotlin.coroutines.cancellation.CancellationException
import kotlin.time.Duration.Companion.seconds
import kotlin.time.TimeSource
import com.jetbrains.toolbox.api.ui.components.AccountDropdownField as DropDownMenu
import com.jetbrains.toolbox.api.ui.components.AccountDropdownField as dropDownFactory

private val POLL_INTERVAL = 5.seconds
Expand Down Expand Up @@ -102,6 +101,10 @@ class CoderRemoteProvider(
override val environments: MutableStateFlow<LoadableState<List<CoderRemoteEnvironment>>> = MutableStateFlow(
LoadableState.Loading
)
private val accountDropdownField = dropDownFactory(context.i18n.pnotr("")) {
logout()
context.envPageManager.showPluginEnvironmentsPage()
}

private val errorBuffer = mutableListOf<Throwable>()

Expand Down Expand Up @@ -229,16 +232,7 @@ class CoderRemoteProvider(
/**
* A dropdown that appears at the top of the environment list to the right.
*/
override fun getAccountDropDown(): DropDownMenu? {
val username = client?.me?.username
if (username != null) {
return dropDownFactory(context.i18n.pnotr(username)) {
logout()
context.envPageManager.showPluginEnvironmentsPage()
}
}
return null
}
override fun getAccountDropDown() = accountDropdownField

override val additionalPluginActions: StateFlow<List<ActionDescription>> = MutableStateFlow(
listOf(
Expand Down Expand Up @@ -528,11 +522,15 @@ class CoderRemoteProvider(
this.cli = cli
environments.showLoadingMessage()
if (context.settingsStore.useAppNameAsTitle) {
context.logger.info("Displaying ${client.appName} as main page title")
coderHeaderPage.setTitle(context.i18n.pnotr(client.appName))
} else {
context.logger.info("Displaying ${client.url} as main page title")
coderHeaderPage.setTitle(context.i18n.pnotr(client.url.toString()))
}
context.logger.info("Displaying ${client.url} in the UI")
accountDropdownField.labelState.update {
context.i18n.pnotr(client.me.username)
}
pollJob = poll(client, cli)
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created")
}
Expand Down
Loading