diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d2eff..2e63675 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - rendering glitches when a Workspace is stopped while SSH connection is alive - misleading message saying that there are no workspaces rendered during manual authentication +- Coder Settings can now be accessed from the authentication wizard ## 0.2.0 - 2025-04-24 diff --git a/src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt b/src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt index 2cdbaf9..b422468 100644 --- a/src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt +++ b/src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt @@ -296,7 +296,7 @@ class CoderRemoteProvider( if (autologin && lastDeploymentURL.isNotBlank() && (lastToken.isNotBlank() || !settings.requireTokenAuth)) { try { AuthWizardState.goToStep(WizardStep.LOGIN) - return AuthWizardPage(context, true, ::onConnect) + return AuthWizardPage(context, settingsPage, true, ::onConnect) } catch (ex: Exception) { errorBuffer.add(ex) } @@ -306,7 +306,7 @@ class CoderRemoteProvider( firstRun = false // Login flow. - val authWizard = AuthWizardPage(context, false, ::onConnect) + val authWizard = AuthWizardPage(context, settingsPage, false, ::onConnect) // We might have navigated here due to a polling error. errorBuffer.forEach { authWizard.notify("Error encountered", it) diff --git a/src/main/kotlin/com/coder/toolbox/views/AuthWizardPage.kt b/src/main/kotlin/com/coder/toolbox/views/AuthWizardPage.kt index ca92ed7..feea50d 100644 --- a/src/main/kotlin/com/coder/toolbox/views/AuthWizardPage.kt +++ b/src/main/kotlin/com/coder/toolbox/views/AuthWizardPage.kt @@ -12,14 +12,17 @@ import kotlinx.coroutines.flow.update class AuthWizardPage( private val context: CoderToolboxContext, + private val settingsPage: CoderSettingsPage, initialAutoLogin: Boolean = false, onConnect: ( client: CoderRestClient, cli: CoderCLIManager, ) -> Unit, -) : CoderPage(context, context.i18n.ptrl("Authenticate to Coder")) { +) : CoderPage(context, context.i18n.ptrl("Authenticate to Coder"), false) { private val shouldAutoLogin = MutableStateFlow(initialAutoLogin) - + private val settingsAction = Action(context.i18n.ptrl("Settings"), actionBlock = { + context.ui.showUiPage(settingsPage) + }) private val signInStep = SignInStep(context, this::notify) private val tokenStep = TokenStep(context) private val connectStep = ConnectStep(context, shouldAutoLogin, this::notify, this::displaySteps, onConnect) @@ -47,7 +50,8 @@ class AuthWizardPage( if (signInStep.onNext()) { displaySteps() } - }) + }), + settingsAction ) } signInStep.onVisible() @@ -64,6 +68,7 @@ class AuthWizardPage( displaySteps() } }), + settingsAction, Action(context.i18n.ptrl("Back"), closesPage = false, actionBlock = { tokenStep.onBack() displaySteps() @@ -79,6 +84,7 @@ class AuthWizardPage( } actionButtons.update { listOf( + settingsAction, Action(context.i18n.ptrl("Back"), closesPage = false, actionBlock = { connectStep.onBack() shouldAutoLogin.update {