@@ -3,7 +3,6 @@ package com.coder.toolbox
3
3
import com.coder.toolbox.store.CoderSecretsStore
4
4
import com.coder.toolbox.store.CoderSettingsStore
5
5
import com.coder.toolbox.util.toURL
6
- import com.coder.toolbox.views.CoderPage
7
6
import com.jetbrains.toolbox.api.core.diagnostics.Logger
8
7
import com.jetbrains.toolbox.api.core.os.LocalDesktopManager
9
8
import com.jetbrains.toolbox.api.localization.LocalizableStringFactory
@@ -14,10 +13,8 @@ import com.jetbrains.toolbox.api.remoteDev.states.EnvironmentStateColorPalette
14
13
import com.jetbrains.toolbox.api.remoteDev.ui.EnvironmentUiPageManager
15
14
import com.jetbrains.toolbox.api.ui.ToolboxUi
16
15
import kotlinx.coroutines.CoroutineScope
17
- import kotlinx.coroutines.delay
18
16
import java.net.URL
19
17
import java.util.UUID
20
- import kotlin.time.Duration.Companion.milliseconds
21
18
22
19
@Suppress(" UnstableApiUsage" )
23
20
data class CoderToolboxContext (
@@ -91,26 +88,4 @@ data class CoderToolboxContext(
91
88
i18n.ptrl(" OK" )
92
89
)
93
90
}
94
-
95
- /* *
96
- * Forces the title bar on the main page to be refreshed
97
- */
98
- suspend fun refreshMainPage () {
99
- // the url/title on the main page is only refreshed if
100
- // we're navigating to the main env page from another page.
101
- // If TBX is already on the main page the title is not refreshed
102
- // hence we force a navigation from a blank page.
103
- ui.showUiPage(CoderPage .emptyPage(this ))
104
-
105
-
106
- // Toolbox uses an internal shared flow with a buffer of 4 items and a DROP_OLDEST strategy.
107
- // Both showUiPage and showPluginEnvironmentsPage send events to this flow.
108
- // If we emit two events back-to-back, the first one often gets dropped and only the second is shown.
109
- // To reduce this risk, we add a small delay to let the UI coroutine process the first event.
110
- // Simply yielding the coroutine isn't reliable, especially right after Toolbox starts via URI handling.
111
- // Based on my testing, a 5–10 ms delay is enough to ensure the blank page is processed,
112
- // while still short enough to be invisible to users.
113
- delay(10 .milliseconds)
114
- envPageManager.showPluginEnvironmentsPage()
115
- }
116
91
}
0 commit comments