scroll to bottom when text is generated (#24)

- also restore circleci
This commit is contained in:
David Koski
2024-03-14 13:18:28 -07:00
committed by GitHub
parent 0fb74cbfdc
commit a1431e7155
2 changed files with 16 additions and 11 deletions

View File

@@ -43,17 +43,12 @@ workflows:
when:
and:
- matches:
pattern: "^(?!pull/)[-_./\\w]+$"
pattern: "^(?!pull/)[-\\w]+$"
value: << pipeline.git.branch >>
- not: << pipeline.parameters.nightly_build >>
- not: << pipeline.parameters.weekly_build >>
jobs:
- hold:
type: approval
- apple/authenticate:
context: pr-approval
- mac_build_and_test:
requires: [ hold ]
- mac_build_and_test
prb:
when:

View File

@@ -16,11 +16,21 @@ struct ContentView: View {
VStack {
// show the model output
ScrollView(.vertical) {
if llm.running {
ProgressView()
ScrollViewReader { sp in
if llm.running {
ProgressView()
}
Text(llm.output)
.textSelection(.enabled)
.onChange(of: llm.output) { _, _ in
sp.scrollTo("bottom")
}
Spacer()
.frame(width: 1, height: 1)
.id("bottom")
}
Text(llm.output)
.textSelection(.enabled)
}
HStack {