Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ab431e

Browse files
authored
impl: poll workspaces when Toolbox screen becomes visible (#176)
Some users complained that Coder Toolbox has a noticeable delay inrendering the workspacesstatus compared with the web Dashboard, even though they have the samepolling frequency,which is every 5 seconds.However, the web Dashboard also reacts and when the tab receives focusfrom the user whichimproves the experience. This PR tries to implement the same behavior,when Coder Toolboxscreen becomes visible the polling is triggered immediately which shouldresult in a status update.
1 parentfc97059 commit6ab431e

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
##Unreleased
44

5+
###Changed
6+
7+
- workspaces status is now refresh every time Coder Toolbox becomes visible
8+
59
##0.6.2 - 2025-08-14
610

711
###Changed

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=0.6.2
1+
version=0.6.3
22
group=com.coder.toolbox
33
name=coder-toolbox

‎src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class CoderRemoteProvider(
5454

5555
privateval settings= context.settingsStore.readOnly()
5656

57-
// Create our services from the Toolbox ones.
5857
privateval triggerSshConfig=Channel<Boolean>(Channel.CONFLATED)
58+
privateval triggerProviderVisible=Channel<Boolean>(Channel.CONFLATED)
5959
privateval settingsPage:CoderSettingsPage=CoderSettingsPage(context, triggerSshConfig)
6060
privateval dialogUi=DialogUi(context)
6161

@@ -177,14 +177,19 @@ class CoderRemoteProvider(
177177

178178
select {
179179
onTimeout(POLL_INTERVAL) {
180-
context.logger.trace("workspace poller waked up by the$POLL_INTERVAL timeout")
180+
context.logger.debug("workspace poller waked up by the$POLL_INTERVAL timeout")
181181
}
182182
triggerSshConfig.onReceive { shouldTrigger->
183183
if (shouldTrigger) {
184-
context.logger.trace("workspace poller waked up because it should reconfigure the ssh configurations")
184+
context.logger.debug("workspace poller waked up because it should reconfigure the ssh configurations")
185185
cli.configSsh(lastEnvironments.map { it.asPairOfWorkspaceAndAgent() }.toSet())
186186
}
187187
}
188+
triggerProviderVisible.onReceive { isCoderProviderVisible->
189+
if (isCoderProviderVisible) {
190+
context.logger.debug("workspace poller waked up by Coder Toolbox which is currently visible, fetching latest workspace statuses")
191+
}
192+
}
188193
}
189194
lastPollTime=TimeSource.Monotonic.markNow()
190195
}
@@ -293,6 +298,11 @@ class CoderRemoteProvider(
293298
visibilityState.update {
294299
visibility
295300
}
301+
if (visibility.providerVisible) {
302+
context.cs.launch {
303+
triggerProviderVisible.send(true)
304+
}
305+
}
296306
}
297307

298308
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp