Skip to content

Commit dd55018

Browse files
committed
impv: better weave loading interface
1 parent be48c08 commit dd55018

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

models/weaveinit/run_l1_node.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -619,5 +619,8 @@ func (m *InitializingAppLoading) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
619619
}
620620

621621
func (m *InitializingAppLoading) View() string {
622-
return m.Loading.View(m.state.weave.PreviousResponse)
622+
if m.Completing {
623+
return m.state.weave.PreviousResponse
624+
}
625+
return m.state.weave.PreviousResponse + m.Loading.View()
623626
}

utils/loading.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ func (m Loading) Update(msg tea.Msg) (Loading, tea.Cmd) {
6969
}
7070
}
7171

72-
func (m Loading) View(previousResponse string) string {
72+
func (m Loading) View() string {
7373
if m.frame >= len(m.Spinner.Frames) {
7474
return "(error)"
7575
}
7676
spinner := m.Style.Render(m.Spinner.Frames[m.frame])
7777

7878
if m.Completing {
79-
return previousResponse
79+
return ""
8080
}
81-
str := fmt.Sprintf("%s%s%s\n", previousResponse, spinner, m.Text)
81+
str := fmt.Sprintf("%s%s\n", spinner, m.Text)
8282
return str
8383
}
8484

0 commit comments

Comments
 (0)