@@ -3,6 +3,7 @@ package com.varabyte.kobweb.cli.common
33import com.varabyte.kobweb.cli.common.kotter.handleConsoleOutput
44import com.varabyte.kobweb.server.api.ServerEnvironment
55import com.varabyte.kobweb.server.api.SiteLayout
6+ import com.varabyte.kotter.foundation.anim.textAnimOf
67import com.varabyte.kotter.foundation.collections.liveListOf
78import com.varabyte.kotter.foundation.input.Key
89import com.varabyte.kotter.foundation.input.Keys
@@ -282,6 +283,8 @@ fun RunScope.handleGradleOutput(line: String, isError: Boolean, onGradleEvent: (
282283// Windows flickering while still presenting enough information for users. If people complain,
283284// 5 is too small, we can allow users to configure this somehow, e.g. via CLI params.
284285class GradleAlertBundle (session : Session , private val pageSize : Int = 5 ) {
286+ private val spinnerAnim = session.textAnimOf(Anims .SPINNER )
287+
285288 private val warnings = session.liveListOf<GradleAlert .Warning >()
286289 private val errors = session.liveListOf<GradleAlert .Error >()
287290 private var lastProgressEvent by session.liveVarOf<GradleAlert .Progress ?>(null )
@@ -363,19 +366,19 @@ class GradleAlertBundle(session: Session, private val pageSize: Int = 5) {
363366 fun renderSyncMessage (renderScope : RenderScope ) = renderScope.apply {
364367 renderScope.apply {
365368 if (! hasFirstTaskRun) {
366- val syncMessage = " Syncing project"
369+ val syncMessage = " $spinnerAnim Syncing project"
367370 black(isBright = true ) {
368371 text(syncMessage)
369372 val session = renderScope.section.session
370- val descTruncated = lastProgressEvent?.let {
371- session.textMetrics.truncateToWidth(
372- it. desc,
373+ ( lastProgressEvent?.desc ? : " Initializing " ). let { desc ->
374+ val descTruncated = session.textMetrics.truncateToWidth(
375+ desc,
373376 // -3 accounts for parentheses and space
374377 session.terminalSize.width - syncMessage.length - 3 ,
375378 ellipsis = EllipsisPresets .SYMBOL
376379 )
377- } ? : " Initializing "
378- text( " ( $descTruncated ) " )
380+ text( " ( $descTruncated ) " )
381+ }
379382 textLine()
380383 }
381384
0 commit comments